Skip to main content

Treevalue support of potc.

Project description

potc-treevalue

PyPI PyPI - Python Version Loc Comments

Code Test Badge Creation Package Release codecov

GitHub stars GitHub forks GitHub commit activity GitHub issues GitHub pulls Contributors GitHub license

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

potc-treevalue-0.0.1.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

potc_treevalue-0.0.1-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file potc-treevalue-0.0.1.tar.gz.

File metadata

  • Download URL: potc-treevalue-0.0.1.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for potc-treevalue-0.0.1.tar.gz
Algorithm Hash digest
SHA256 d9c5af47b430c89d9b947dc438ca4054c4ea53b369d1e6724020504354739244
MD5 dd9a96e76b9bced24539da26a38eb6ef
BLAKE2b-256 253076f838a282024c6560e3b8ff73b70a82156aac4e786ca93abfea6858db58

See more details on using hashes here.

File details

Details for the file potc_treevalue-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: potc_treevalue-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for potc_treevalue-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 576080e5b66c0c91ade6a5f01cc606b4c3da9591baab8473bf23c3b1e901f045
MD5 da2955d0ab31d28f882b4eb0625dc5e9
BLAKE2b-256 4ae56bd6e625dcbf5a497ee2eb9b2b8ce0aa3ae2fccce90513ba12d82adefe56

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page