Refactor Ledger Python module into Python package #2196
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Allowing to extend the Python Ledger package with pure Python classes and methods as well as adding functionality to existing native classes using Python.
This is a draft PR as I'd like to get a conversation going about the pros and cons of the proposed change.
On the one hand this change will bring a lot of flexibility for future additions written entirely in Python and decouples the Python API for people using the Ledger Python package from what is exposed by Ledger's C++ native code via Boost.Python.
On the other hand this may break backwards compatibility, yet the change to migrate script is fairly straight-forward: Change
import ledger
toimport ledger.core as ledger
.I'm not using
ledger python
much, so things may break there, for example it was necessary to change the module name intest/baseline/feat-value_py3.test
fromledger
to_core
in order to make the tests pass.There may be ways around it, I'm not sure yet.