A XML, JSON,... decode library
Project description
PyDecoder
A XML, JSON,… decode library
Free software: BSD license
Documentation: https://pydecoder.readthedocs.io.
Features
Decode and validate values from XML and JSON.
Install
To install PyDecoder, run this command in your terminal:
$ pip install pydecoder
Example
>>> from pydecoder.fields import required, optional
>>> from pydecoder.json import to_int, to_string, decode
# Define data
>>> data = {'foo': 'Text', 'bar': 1}
# Describe data
>>> decoders = [
... required('foo', to_string),
... required('bar', to_int),
... optional('baz', to_int, -5),
... ]
# Decode/verify data
>>> decode(lambda x: x, decoders, data)
Result(status='Ok', value=['Text', 1, -5])
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.1.0 (2017-05-21)
First release on PyPI.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pydecoder-1.0.3.tar.gz.
File metadata
- Download URL: pydecoder-1.0.3.tar.gz
- Upload date:
- Size: 17.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63c564d8896fe97a7064cba43e27d9ac7c87dd5aeb1df374dac3c308ce07ec87
|
|
| MD5 |
e639bf36387377ae6e6cfd27086da17c
|
|
| BLAKE2b-256 |
e4a7b3fd2aa4341b00716c9eb5902505a1d7bcaf232cf9cf4f20834b332b0a1d
|
File details
Details for the file pydecoder-1.0.3-py2.py3-none-any.whl.
File metadata
- Download URL: pydecoder-1.0.3-py2.py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
484a5e88d072ebe6eeb151c83d1ad2d0b00af47c8a5346507ec1b8d85716a4f3
|
|
| MD5 |
53f788bb508e93b548b20f9bd0f4d003
|
|
| BLAKE2b-256 |
fda0ddbde6b38d5291b4611476b7726eeef59670d8d45a8ad0f7f755b7f201ba
|