PyDeclares
This library provides a simple API for encoding and decoding declared classes to and from JSON, XML, FORM-DATA or QueryString.
It's very easy to get started.
Quickstart
pip install pydeclares
from pydeclares import var, Declared
class Person(Declared):
name = var(str)
age = var(int)
# decode json string
data = '{"name": "Tom", "age": 18}'
person = Person.from_json(data)
assert person.name == "Tom"
assert person.age == 18
# you can encode to xml after decode json string
result = person.to_xml()
assert result == '<person><name>Tom</name><age>18</age></person>'
# or form-data
result = person.to_form_data()
assert result == "name=Tom&age=18"
# or query string
person = Person(name="tom@a", age=18)
result = person.to_query_string()
assert result == "name=tom%40a&age=18"
Metadata
Release files for pydeclares 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pydeclares-1.0.3.tar.gz | 19.1 kB | Without provenance | Details for pydeclares-1.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pydeclares-1.0.3-py3-none-any.whl | Python 3 | none | any | Details for pydeclares-1.0.3-py3-none-any.whl |
Total release size: 42.9 kB
Release files / pydeclares-1.0.3.tar.gz
| Download URL | pydeclares-1.0.3.tar.gz |
|---|---|
| Size | 19.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e58ac9805bdd94b271d90c9b353cbfee465f135105eb3ddad08b9f65c89b2187
|
|
BLAKE2b-256 checksum How to use checksums |
386c9913b0a1959bc1c583a37a49cf01ff49b7d8d11679b81519e84f482c7114
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.6.2
|
Release files / pydeclares-1.0.3-py3-none-any.whl
| Download URL | pydeclares-1.0.3-py3-none-any.whl |
|---|---|
| Size | 23.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e07811e967509aa64c7be15f01959bb0635b01689f9082ef443a6ef659dd14e3
|
|
BLAKE2b-256 checksum How to use checksums |
aa2e29ab24434f3ca1380e84cc99753658cc170ba4076e215e4a1167a71da8b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.6.2
|
Security for pydeclares 1.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.