Adon
Adon is a faster, more efficient alternative to JSON
Why would you use Adon instead of JSON?
- Adon files are on average 1.4x smaller then a JSON file.
- In Adon a lot of the limitations of JSON are gone. (any type can be used as a key in a dictionary)
Installation
Using pip:
python -m pip install adon
Usage
You can use Adon in the terminal and in a python script.
Terminal
Compiling JSON to Adon
You can compile JSON to Adon with the adon -c command, followed by the name of the JSON file and optionally the name of the Adon file.
adon -c someFile.json someFile.adon
- compiles 'someFile.json' to 'someFile.adon'
adon -c otherFile.json
- compiles 'otherFile.json' to 'otherFile.adon'
Decompiling Adon to JSON
You can decompile Adon to JSON using the adon -d command, followed by the Adon file and optionally the JSON file.
adon -d someFile.adon someFile.json
- decompiles 'someFile.adon' to 'someFile.json'
adon -d otherFile.adon
- decompiles 'otherFile.adon' to 'otherFile.json'
Python script
Compiling Python Object to Adon
The Adon module has a function dump() that can be used to convert a Python object to a bytearray with Adon formatting.
import adon
product = {
"name": "Magic Wand",
"price": 109.5,
"available": True,
"category": "magic"
}
obj = adon.dump(product)
This Adon object can than be used on its own, or it can be written to a file:
with open("fileName.adon", "wb") as f:
f.write(obj)
Note that currently only strings, integers, floats, booleans, NoneType, lists, tuples, dictionaries, bytearrays and bytes are supported.
Decompiling Adon back to Python Object
The Adon module also contains a function to revert the Adon back to a Python object.
import adon
fruits = [
"banana",
"apple",
"mango"
]
# convert to Adon
obj = adon.dump(someFruit)
# convert to Python object
val = adon.load(obj)
print(val)
# ['banana', 'apple', 'mango']
Versioning
1.0.2
- Performance improvements
- Reorganization
1.0.1
- Bytes + Bytearrays
1.0.0
- strings, integers, floats, booleans, NoneType, lists, tuples, dictionaries
dump()+load()functions
Metadata
Release files for Adon 1.0.2
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 |
|---|---|---|---|---|
| Adon-1.0.2.tar.gz | 6.1 kB | Without provenance | Details for Adon-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| Adon-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for Adon-1.0.2-py3-none-any.whl |
Total release size: 13.4 kB
Release files / Adon-1.0.2.tar.gz
| Download URL | Adon-1.0.2.tar.gz |
|---|---|
| Size | 6.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5c83f19cb7e39930b763c2b72e6609c3050281e4c840ebc6edd00cc597a26c7c
|
|
BLAKE2b-256 checksum How to use checksums |
4b287af841f32d113c92343d9c184ccdfa72bdef993b4b28aa6eabde95e826ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.12.0b3
|
Release files / Adon-1.0.2-py3-none-any.whl
| Download URL | Adon-1.0.2-py3-none-any.whl |
|---|---|
| Size | 7.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
068a426bfa4d09051da7c4d1fb764e184b38045b074d43a9716304cf80415695
|
|
BLAKE2b-256 checksum How to use checksums |
efb48682d289dc22875d6b8b7df7c41b2df65d5d221ad860544fcf5f082554a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.12.0b3
|
Security for Adon 1.0.2
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.