libpython-clj 2.025
Python bindings for Clojure.
Topics
- LibPython-CLJ Usage
- Embedding Clojure In Python
- Python Environments
- So Many Parenthesis!
- Scopes And Garbage Collection
- Slicing And Slices
Namespaces
libpython-clj2.codegen
Generate a namespace on disk for a python module or instances
Public variables and functions:
libpython-clj2.embedded
Tools for embedding clojure into a python host process. See jbridge.py for python details. This namespace relies on the classpath having nrepl and cider-nrepl on it. For example:
Public variables and functions:
libpython-clj2.java-api
A java api is exposed for libpython-clj2. The methods below are statically callable without the leading '-'. Note that returned python objects implement the respective java interfaces so a python dict will implement java.util.Map, etc. There is some startup time as Clojure dynamically compiles the source code but this binding should have great runtime characteristics in comparison to any other java python engine.
Public variables and functions:
libpython-clj2.python
Python bindings for Clojure. This library dynamically finds the installed python, loads the shared library and allows Clojure users to use Python modules as if they were Clojure namespaces.
Public variables and functions:
- $a
- $c
- ->jvm
- ->py-dict
- ->py-list
- ->py-tuple
- ->python
- add-module
- afn
- as-jvm
- as-list
- as-map
- as-python
- attr-type-map
- call-attr
- call-attr-kw
- callable?
- cfn
- create-class
- def-unpack
- dir
- from-import
- get-attr
- get-item
- has-attr?
- has-item?
- import-as
- import-module
- initialize!
- is-instance?
- make-callable
- make-fastcallable
- make-instance-fn
- make-kw-instance-fn
- module-dict
- path->py-obj
- py*
- py**
- py.
- py.-
- py..
- python-type
- run-simple-string
- set-attr!
- set-attrs!
- set-item!
- set-items!
- stack-resource-context
- with
- with-gil
- with-gil-stack-rc-context
- with-manual-gil
- with-manual-gil-stack-rc-context
libpython-clj2.python.class
Namespace to help create a new python class from Clojure. Used as a core implementation technique for bridging JVM objects into python.
Public variables and functions:
libpython-clj2.python.np-array
Bindings for deeper intergration of numpy into the tech.v3.datatype system. This allows seamless usage of numpy arrays in datatype and tensor functionality such as enabling the tech.v3.tensor/ensure-tensor call to work with numpy arrays -- using zero copying when possible.
Public variables and functions:
libpython-clj2.require
Namespace implementing requiring python modules as Clojure namespaces. This works via scanning the module for metadata and dynamically building the Clojure namespace.
Public variables and functions: