ntt-json-model-parser
The project for parsing the data from .json file (use json format) to a object in Python
Usage
Firstly, define the model.
from ntt_json_model_parser import Parser, ModelProperty, Model, Property
@Model
class Lecture:
def __init__(self) -> None:
self._strName = ""
self._nAttempts = 0
@Property
def strName(self) -> str:
return self._strName
@Property
def nAttempts(self) -> int:
return self._nAttempts
@Model
class Person:
def __init__(self) -> None:
self._strName = ""
self._nAge = 0
self._lecLecture : Lecture = Lecture()
@Property
def strName(self) -> str:
return self._strName
@Property
def nAge(self) -> int:
return self._nAge
@ModelProperty(Lecture)
def lecLecture(self) -> Lecture:
return self._lecLecture
Then using
dictObjectData = {
"strName": "Thao Nguyen The",
"nAge": 23,
"lecLecture": None
}
perFirstStudent: Person = Parser.DeSerializeFromDict(Person, dictObjectData)
# The student will have the name: `Nguyen The Thao` and the lecture with default value
dictObjectData = {
"strName": "Thao Nguyen The",
"nAge": 23,
}
perFirstStudent: Person = Parser.DeSerializeFromDict(Person, dictObjectData)
dictSerializedData = Parser.SerializeToDict(perFirstStudent)
The same result for the Serialize method
Metadata
Release files for ntt-json-model-parser 1.1.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 |
|---|---|---|---|---|
| ntt-json-model-parser-1.1.3.tar.gz | 6.8 kB | Without provenance | Details for ntt-json-model-parser-1.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ntt_json_model_parser-1.1.3-py3-none-any.whl | Python 3 | none | any | Details for ntt_json_model_parser-1.1.3-py3-none-any.whl |
Total release size: 16.6 kB
Release files / ntt-json-model-parser-1.1.3.tar.gz
| Download URL | ntt-json-model-parser-1.1.3.tar.gz |
|---|---|
| Size | 6.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
42b3610e43a891cc142b301c2a8aa7f1f1526a3d09257533ec04863489937384
|
|
BLAKE2b-256 checksum How to use checksums |
a94fe8fa11776e5a4d5053d38a29f9b88c7d270cb7c887a39e68fa27c82b8c96
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.7
|
Release files / ntt_json_model_parser-1.1.3-py3-none-any.whl
| Download URL | ntt_json_model_parser-1.1.3-py3-none-any.whl |
|---|---|
| Size | 9.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f0db403c2a1d1512d20af1039330284a6ef2f4a4eb4c439d9d46bc2e8d76c106
|
|
BLAKE2b-256 checksum How to use checksums |
c1b2ab0596495108b7d09f83450d3ab6b569fc540885c6642458c6e53d764955
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.7
|
Security for ntt-json-model-parser 1.1.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.