Deep Python bindings for Clojure enabling seamless interop, allowing Clojure to call Python libraries and vice versa.
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.
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.
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.
Python bindings for Clojure
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.
Links Python objects to JVM GC, automatically releasing references when unreachable, which simplifies resource management and prevents memory leaks, mentioned in the features section.
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.
Facilitates fast, iterative development in the Clojure REPL, with community examples for plotting and text generation, emphasizing smooth workflow integration.
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.
Dynamic Python calls have latency; the library recommends `make-fastcallable` or static code generation for speed, indicating inherent trade-offs in inter-language communication.
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.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.