What problem does it solve?
Integrating Python's vast machine learning and data science ecosystem with Clojure applications can be complex. This Skill provides a quick reference for libpython-clj, enabling seamless interoperability, automatic data conversion, and direct access to Python libraries like NumPy, Pandas, and HuggingFace from Clojure.
Core Features & Use Cases
- Seamless Integration: Import Python modules as Clojure namespaces and call Python functions with idiomatic Clojure syntax.
- Automatic Data Conversion: Effortlessly pass Clojure data structures to Python functions and receive results back in Clojure format.
- ML Library Access: Directly utilize powerful Python libraries like NumPy for numerical operations, Pandas for data manipulation, and HuggingFace Transformers for AI models.
- Use Case: A Clojure agent needs to perform sentiment analysis using a pre-trained HuggingFace model. This Skill guides the setup of
libpython-clj, importing the transformers library, and calling the sentiment pipeline directly from Clojure.
Quick Start
Initialize libpython-clj in your Clojure project.
Import the 'numpy' module as 'np'.
Create a NumPy array from a Clojure vector: (np/array [1 2 3]).