Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Machine Learning
  3. Libpython-clj

Libpython-clj

EPL-2.0Clojure

Deep Python bindings for Clojure enabling seamless interop, allowing Clojure to call Python libraries and vice versa.

GitHubGitHub
1.2k stars73 forks0 contributors

What is Libpython-clj?

libpython-clj is a library that provides deep Python bindings for Clojure, enabling seamless interoperability between the two languages. It allows Clojure developers to directly import and use Python modules, call Python functions, and transfer data efficiently, while also supporting embedding Clojure within Python processes. This solves the problem of accessing Python's rich ecosystem of ML and scientific libraries from the JVM.

Target Audience

Clojure developers who need to leverage Python libraries for machine learning, data science, or scientific computing, as well as teams working in mixed Clojure/Python environments seeking deeper integration.

Value Proposition

Developers choose libpython-clj for its deep, REPL-oriented integration that treats Python modules like Clojure namespaces, its automatic garbage collection bridging, and high-performance data transfer capabilities with NumPy, avoiding the overhead of typical foreign function interfaces.

Overview

Python bindings for Clojure

Use Cases

Best For

  • Using Python machine learning libraries (e.g., MXNet, OpenCV) from Clojure applications
  • Embedding Clojure logic within Python scripts or applications
  • Data science workflows that combine Clojure's REPL with Python's NumPy/pandas
  • Building hybrid JVM/Python systems with bidirectional callbacks
  • Accessing Conda-managed Python environments from Clojure projects
  • Generating static Clojure wrappers for Python modules for improved performance

Not Ideal For

  • Projects requiring zero-configuration or instant startup without Python environment initialization
  • Teams with no Python expertise or unwilling to manage Conda/virtualenv environments
  • Real-time systems where the overhead of JVM-Python inter-process communication is unacceptable
  • Applications that exclusively use Python with no need for Clojure integration

Pros & Cons

Pros

Seamless Module Import

Allows importing Python modules as Clojure namespaces using `require-python`, enabling direct use of libraries like NumPy and OpenCV, as demonstrated in the facial recognition example.

Automatic Garbage Collection

Links Python objects to JVM GC, automatically releasing references when unreachable, which simplifies resource management and prevents memory leaks, mentioned in the features section.

Efficient Data Transfer

Supports high-performance copies to/from NumPy arrays and callbacks, optimizing data exchange for machine learning workflows, highlighted in the Java API and new features.

REPL-Oriented Design

Facilitates fast, iterative development in the Clojure REPL, with community examples for plotting and text generation, emphasizing smooth workflow integration.

Cons

Complex Setup Process

Initialization requires manual specification of Python executable and library paths, and errors like 'Failed to find a valid python library!' can occur with statically linked Python, necessitating OS-level fixes.

Performance Overhead

Dynamic Python calls have latency; the library recommends `make-fastcallable` or static code generation for speed, indicating inherent trade-offs in inter-language communication.

Ecosystem Dependency

Heavily reliant on Python environment configuration, leading to potential issues with library discovery and version conflicts, as noted in the environments section and Conda setup requirements.

Frequently Asked Questions

Quick Stats

Stars1,201
Forks73
Contributors0
Open Issues35
Last commit3 months ago
CreatedSince 2019

Tags

#conda#scientific-computing#repl#python3#python#interoperability#python-bindings#clojure#jvm#machine-learning#numpy

Built With

C
Clojure
J
JNA

Included in

Machine Learning72.2k
Auto-fetched 5 hours ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub