livebook-dev/pythonx
67.9
Adequate · 18 September 2026
1.7k
lines of production code
C++
with Elixir
1
measurement over time
What this system is
Pythonx is an Elixir library that embeds a Python interpreter within Elixir processes to evaluate Python code and exchange data structures. It provides robust support for distributed environments by managing Python object lifecycles across nodes and handling thread safety via the GIL. The system allows flexible configuration of Python versions and package managers, while ensuring accurate static analysis of Python code scopes and reliable error reporting.
Features
Initial release of Pythonx v0.3.0 with changelog and build updates
This entry documents the initial release (v0.3.0) of the Pythonx library, which embeds a Python interpreter within the Elixir process to evaluate Python code and convert data structures. The release includes a new CHANGELOG.md documenting the history, a RELEASE.md for publishing procedures, and updates to the build system (Makefile, Makefile.win) to support C++ compilation with visibility hiding and fine-grained configuration. The README is updated to reflect the new dependency structure and usage patterns, including the introduction of the \pythonx\ Python module for sending tagged objects to Elixir processes.
(repo-wide) · high confidence
Removals
Removal of local Fine serialization library
The local C++ implementation of the Fine serialization library (fine.hpp) has been removed from the c\_src/pythonx directory. This change reflects the migration of Fine to an external dependency, meaning the code previously maintained locally is no longer part of this repository's source tree.
_c\src/pythonx · high confidence
Behavioural changes
Corrected global variable scanning for exception handler scopes
The AST global scanning logic now correctly accounts for variables defined within exception handlers. Previously, the scanner did not recognize that exception handler bodies exist within the outer scope while the handler target variable is local to that handler, leading to potential misidentification of undefined references. This change introduces a dedicated scope tracking mechanism for exception handlers, ensuring that variables defined in the handler target are not falsely flagged as global references while still allowing access to outer-scope variables.
lib/pythonx/ast · high confidence
Improved Python thread safety and error reporting in c\_src
The C++ source files in c\_src have been reorganized and updated to fix evaluation crashes when the group leader is on a different node. The GIL management logic was rewritten to use per-thread PyThreadState and PyEval\_RestoreThread/PyEval\_SaveThread instead of PyGILState\_Ensure/Release, preventing segfaults with libraries like pybind11. Additionally, new Python C API symbols (e.g., PyErr\_Clear, PyInterpreterState\_Get) are now loaded, and the Pythonx.Error object now includes type, value, and traceback fields for better error context.
_c\src · high confidence
Support for FLAME initialization and free-threaded Python
Pythonx now supports initialization on FLAME nodes via new \install\_env/0\ and \install\_paths/0\ functions, which capture and restore the initialization state using persistent terms and environment variables. Additionally, the \uv\_init/2\ function now accepts a \:python\ option to install specific Python variants, such as free-threaded builds (e.g., "3.14t"), and a \:uv\_version\ option to select the uv package manager version. The legacy \init/3\ function remains available for manual Python installation but is superseded by \uv\_init/2\ for most use cases.
lib · high confidence
Support for distributed Python objects and configurable Python/uv versions
Pythonx now supports distributed garbage collection for Python objects sent between nodes, ensuring that remote objects remain alive on their owner node until explicitly untracked. The library also allows configuring the downloaded uv version and selecting a specific Python interpreter (including free-threaded builds) via compile-time and runtime options. Additionally, the encoder protocol now accepts an encoder function argument to support custom encoding logic, and the application startup ensures SIGCHLD handling is correct on Unix to prevent blocking in child process waits.
lib/pythonx · high confidence
Test coverage
Added tests for Pythonx encoding, evaluation, and distributed features; Added tests for global scanning in Python try/except blocks.
Dependencies
Add precompilation support and new dependencies
The project now includes a precompilation workflow for its native code, introducing the \cc\_precompiler\ and \fine\ dependencies to manage C compilation and include paths. It also adds \flame\ as an optional dependency and updates the application configuration to start \:inets\, \:ssl\, and \:public\_key\ by default. Additionally, the package metadata and documentation sources have been formalized to improve publishing and documentation generation.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 68.
Lenses
- Code Health 100
- Architecture 100
- Maturity 61
- Readiness 62
- Security 72
Changes since last survey
- 82 commits — 77 feature/other, 5 fixes
By area
- (root) — 38 commits
- lib/pythonx — 17 commits
- c_src/pythonx — 11 commits
- lib/pythonx.ex — 9 commits
- .github/workflows — 4 commits
- c_src/pythonx.cpp — 3 commits
Notable commits
- fix: Fix evaluation crashing when group leader is from another node (#27)
- fix: Fix examples in Fine docs
- fix: Fix globals scanning for exception handlers
- fix: Fix segmentation fault caused by using libraries depending on pybind11 (#9)
- fix: Fix waiting on child processes blocking indefinitely (#15)
- change: Add :generated to ~PY assignments
- change: Add :native_tls option to Pythonx.uv_init/2 (#41)
- change: Add :python option to uv_init/2 for free-threaded Python support (#45)
- change: Add PYTHONX_CACHE_DIR to customize cache location
- change: Add Python API for sending messages to Elixir (#38)
- change: Add Pythonx.eval/3 options for customizing stdout and stderr destination (#5)
- change: Add Pythonx.install_env/0 and Pythonx.install_paths/0 to enable FLAME (#35)
- change: Add initial documentation for Fine
- change: Add more docs on free-threaded Python
- change: Add more encoder and decoder implementations to fine
- change: Add precompilation workflow
- change: Add type, value, traceback objects back to Pythonx.Error (#47)
- change: Allow configuring the uv version that is downloaded (#30)
- change: Avoid persistent term read error
- change: Change eval to return nil when code does not end with an expression
- …and 62 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
livebook-dev/pythonx was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 18 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 58446f0824a7bff76d6ecdbc694f54d2ddfab3ba — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-5d04157a340d.