potc-treevalue
Potc support for treevalue module.
Installation
You can simply install it with pip command line from the official PyPI site.
pip install potc-treevalue
Quick Start
After potc-treevalue is installed, you can convert the treevalue objects into executable source code without any additional operations.
We can create a python script which is named test_simple.py
from potc import transvars
from treevalue import FastTreeValue, raw
r = raw({'a': 1, 'b': 2, 'c': [3, 4]})
t = FastTreeValue({
'a': 1, 'b': 'this is a string',
'c': [], 'd': {
'x': raw({'a': 1, 'b': (None, Ellipsis)}),
'y': {3, 4, 5}
}
})
st = t._detach()
if __name__ == '__main__':
_code = transvars(
{'t': t, 'st': t._detach(), 'r': r},
reformat='pep8'
)
print(_code)
The output result should be like this
from treevalue import FastTreeValue, raw
from treevalue.tree.common import create_storage
__all__ = ['r', 'st', 't']
r = raw({'a': 1, 'b': 2, 'c': [3, 4]})
st = create_storage({
'a': 1,
'b': 'this is a string',
'c': [],
'd': {
'x': raw({
'a': 1,
'b': (None, ...)
}),
'y': {3, 4, 5}
}
})
t = FastTreeValue({
'a': 1,
'b': 'this is a string',
'c': [],
'd': {
'x': raw({
'a': 1,
'b': (None, ...)
}),
'y': {3, 4, 5}
}
})
And, you can use the following CLI command to get the same output results as above.
potc export -v 'test_simple.t' -v 'test_simple.st' -v 'test_simple.r'
Contributing
We appreciate all contributions to improve potc and potc-treevalue, both logic and system designs. Please refer to CONTRIBUTING.md for more guides.
License
potc-treevalue released under the Apache 2.0 license.
Release files for potc-treevalue 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| potc-treevalue-0.0.1.tar.gz | 8.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| potc_treevalue-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.8 kB
Release files / potc-treevalue-0.0.1.tar.gz
| Download URL | potc-treevalue-0.0.1.tar.gz |
|---|---|
| Size | 8.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d9c5af47b430c89d9b947dc438ca4054c4ea53b369d1e6724020504354739244
|
|
BLAKE2b-256 checksum How to use checksums |
253076f838a282024c6560e3b8ff73b70a82156aac4e786ca93abfea6858db58
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|
Release files / potc_treevalue-0.0.1-py3-none-any.whl
| Download URL | potc_treevalue-0.0.1-py3-none-any.whl |
|---|---|
| Size | 8.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
576080e5b66c0c91ade6a5f01cc606b4c3da9591baab8473bf23c3b1e901f045
|
|
BLAKE2b-256 checksum How to use checksums |
4ae56bd6e625dcbf5a497ee2eb9b2b8ce0aa3ae2fccce90513ba12d82adefe56
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|