Skip to main content

Json raw data to object

Project description

jsontofu.png

Usage

@dataclass
class Data:
    test_str: str
    test_int: int

obj = jsontofu.decode({'test_str': 'test', 'test_int': 123}, Data)

# Now you can call test_str like this
obj.test_str

Installation

pip install git+git://github.com/rondou/jsontofu.git

or

pipenv install 'git+ssh://git@github.com/rondou/jsontofu.git#egg=jsontofu'

Development

pipenv install
pipenv install -d
pipenv run "pytest -s"

Coverage

pipenv run 'pytest tests --cov=jsontofu'

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

jsontofu-0.0.4.tar.gz (4.3 kB view hashes)

Uploaded Source

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