Metadata-Version: 2.1
Name: potc-treevalue
Version: 0.0.1
Summary: Treevalue support of potc.
Home-page: https://github.com/potc-dev/potc-treevalue
Author: HansBug
Author-email: hansbug@buaa.edu.cn
License: Apache License, Version 2.0
Keywords: potc,treevalue
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: potc (>=0.0.3)
Requires-Dist: treevalue (>=1.0.0)
Provides-Extra: doc
Requires-Dist: sphinx (~=3.2.0) ; extra == 'doc'
Requires-Dist: sphinx-rtd-theme (~=0.4.3) ; extra == 'doc'
Requires-Dist: enum-tools ; extra == 'doc'
Requires-Dist: sphinx-toolbox ; extra == 'doc'
Requires-Dist: plantumlcli (>=0.0.2) ; extra == 'doc'
Requires-Dist: packaging ; extra == 'doc'
Requires-Dist: sphinx-multiversion (~=0.2.4) ; extra == 'doc'
Requires-Dist: where (~=1.0.2) ; extra == 'doc'
Requires-Dist: easydict (<2,>=1.7) ; extra == 'doc'
Requires-Dist: numpy (<2,>=1.19) ; extra == 'doc'
Provides-Extra: test
Requires-Dist: coverage (>=5) ; extra == 'test'
Requires-Dist: mock (>=4.0.3) ; extra == 'test'
Requires-Dist: flake8 (~=3.5) ; extra == 'test'
Requires-Dist: pytest (~=6.2.5) ; extra == 'test'
Requires-Dist: pytest-cov (~=3.0.0) ; extra == 'test'
Requires-Dist: pytest-mock (~=3.6.1) ; extra == 'test'
Requires-Dist: pytest-xdist (>=1.34.0) ; extra == 'test'
Requires-Dist: pytest-rerunfailures (~=10.2) ; extra == 'test'
Requires-Dist: pytest-timeout (~=2.0.2) ; extra == 'test'
Requires-Dist: easydict (<2,>=1.7) ; extra == 'test'
Requires-Dist: numpy (<2,>=1.19) ; extra == 'test'
Requires-Dist: where (>=1.0.2) ; extra == 'test'

# potc-treevalue

[![PyPI](https://img.shields.io/pypi/v/potc-treevalue)](https://pypi.org/project/potc-treevalue/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/potc-treevalue)](https://pypi.org/project/potc-treevalue/)
![Loc](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/HansBug/3a975cb01e1a4ec1bc363ec8049485b9/raw/loc.json)
![Comments](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/HansBug/3a975cb01e1a4ec1bc363ec8049485b9/raw/comments.json)

[![Code Test](https://github.com/potc-dev/potc-treevalue/workflows/Code%20Test/badge.svg)](https://github.com/potc-dev/potc-treevalue/actions?query=workflow%3A%22Code+Test%22)
[![Badge Creation](https://github.com/potc-dev/potc-treevalue/workflows/Badge%20Creation/badge.svg)](https://github.com/potc-dev/potc-treevalue/actions?query=workflow%3A%22Badge+Creation%22)
[![Package Release](https://github.com/potc-dev/potc-treevalue/workflows/Package%20Release/badge.svg)](https://github.com/potc-dev/potc-treevalue/actions?query=workflow%3A%22Package+Release%22)
[![codecov](https://codecov.io/gh/potc-dev/potc-treevalue/branch/main/graph/badge.svg?token=XJVDP4EFAT)](https://codecov.io/gh/potc-dev/potc-treevalue)

[![GitHub stars](https://img.shields.io/github/stars/potc-dev/potc-treevalue)](https://github.com/potc-dev/potc-treevalue/stargazers)
[![GitHub forks](https://img.shields.io/github/forks/potc-dev/potc-treevalue)](https://github.com/potc-dev/potc-treevalue/network)
![GitHub commit activity](https://img.shields.io/github/commit-activity/m/potc-dev/potc-treevalue)
[![GitHub issues](https://img.shields.io/github/issues/potc-dev/potc-treevalue)](https://github.com/potc-dev/potc-treevalue/issues)
[![GitHub pulls](https://img.shields.io/github/issues-pr/potc-dev/potc-treevalue)](https://github.com/potc-dev/potc-treevalue/pulls)
[![Contributors](https://img.shields.io/github/contributors/potc-dev/potc-treevalue)](https://github.com/potc-dev/potc-treevalue/graphs/contributors)
[![GitHub license](https://img.shields.io/github/license/potc-dev/potc-treevalue)](https://github.com/potc-dev/potc-treevalue/blob/master/LICENSE)

[Potc](https://github.com/potc-dev/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`

```python
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.

```shell
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.


