Adon


NameAdon JSON
Version 1.0.2 PyPI version JSON
download
home_page
SummaryConvert Python objects or JSON files to a compacter format!
upload_time2024-01-26 20:01:30
maintainer
docs_urlNone
authorPatattMan
requires_python>=3.9
licenseMIT License Copyright (c) 2023 ThereAre12Months Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords json web adon
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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.

```bash
adon -c someFile.json someFile.adon  
```
 \- compiles 'someFile.json' to 'someFile.adon'  

<br>

```bash
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.  

```bash
adon -d someFile.adon someFile.json
```  
 \- decompiles 'someFile.adon' to 'someFile.json'  
<br>

```bash
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.

```python
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:
```python
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.

```python
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

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "Adon",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "JSON,web,Adon",
    "author": "PatattMan",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/4b/28/7af841f32d113c92343d9c184ccdfa72bdef993b4b28aa6eabde95e826ef/Adon-1.0.2.tar.gz",
    "platform": null,
    "description": "# Adon\r\n Adon is a faster, more efficient alternative to JSON\r\n\r\n### Why would you use Adon instead of JSON?\r\n - Adon files are on average 1.4x smaller then a JSON file.\r\n - In Adon a lot of the limitations of JSON are gone. (any type can be used as a key in a dictionary)\r\n\r\n# Installation\r\n**Using pip:**  \r\n\r\n    python -m pip install adon  \r\n\r\n\r\n# Usage\r\nYou can use Adon in the terminal and in a python script.\r\n\r\n## Terminal\r\n### Compiling JSON to Adon\r\nYou 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.\r\n\r\n```bash\r\nadon -c someFile.json someFile.adon  \r\n```\r\n \\- compiles 'someFile.json' to 'someFile.adon'  \r\n\r\n<br>\r\n\r\n```bash\r\nadon -c otherFile.json  \r\n```\r\n \\- compiles 'otherFile.json' to 'otherFile.adon'\r\n***\r\n### Decompiling Adon to JSON\r\nYou can decompile Adon to JSON using the `adon -d` command, followed by the Adon file and optionally the JSON file.  \r\n\r\n```bash\r\nadon -d someFile.adon someFile.json\r\n```  \r\n \\- decompiles 'someFile.adon' to 'someFile.json'  \r\n<br>\r\n\r\n```bash\r\nadon -d otherFile.adon\r\n```  \r\n \\- decompiles 'otherFile.adon' to 'otherFile.json'\r\n\r\n## Python script\r\n### Compiling Python Object to Adon\r\nThe Adon module has a function `dump()` that can be used to convert a Python object to a bytearray with Adon formatting.\r\n\r\n```python\r\nimport adon\r\n\r\nproduct = {\r\n    \"name\": \"Magic Wand\",\r\n    \"price\": 109.5,\r\n    \"available\": True,\r\n    \"category\": \"magic\"\r\n}\r\n\r\nobj = adon.dump(product)\r\n```\r\n\r\nThis Adon object can than be used on its own, or it can be written to a file:\r\n```python\r\nwith open(\"fileName.adon\", \"wb\") as f:\r\n    f.write(obj)\r\n```\r\n\r\n**Note that currently only strings, integers, floats, booleans, NoneType, lists, tuples, dictionaries, bytearrays and bytes are supported.**\r\n***\r\n\r\n### Decompiling Adon back to Python Object\r\nThe Adon module also contains a function to revert the Adon back to a Python object.\r\n\r\n```python\r\nimport adon\r\n\r\nfruits = [\r\n    \"banana\",\r\n    \"apple\",\r\n    \"mango\"\r\n]\r\n\r\n# convert to Adon\r\nobj = adon.dump(someFruit)\r\n\r\n# convert to Python object\r\nval = adon.load(obj)\r\n\r\nprint(val) \r\n# ['banana', 'apple', 'mango']\r\n```\r\n\r\n# Versioning\r\n\r\n## 1.0.2\r\n- Performance improvements\r\n- Reorganization\r\n\r\n## 1.0.1\r\n- Bytes + Bytearrays\r\n\r\n## 1.0.0\r\n- strings, integers, floats, booleans, NoneType, lists, tuples, dictionaries\r\n- `dump()` + `load()` functions\r\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 ThereAre12Months  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Convert Python objects or JSON files to a compacter format!",
    "version": "1.0.2",
    "project_urls": {
        "Homepage": "https://github.com/ThereAre12Months/Adon"
    },
    "split_keywords": [
        "json",
        "web",
        "adon"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "efb48682d289dc22875d6b8b7df7c41b2df65d5d221ad860544fcf5f082554a6",
                "md5": "7c4bfd389027e856c6ab964b174d71a8",
                "sha256": "068a426bfa4d09051da7c4d1fb764e184b38045b074d43a9716304cf80415695"
            },
            "downloads": -1,
            "filename": "Adon-1.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7c4bfd389027e856c6ab964b174d71a8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 7233,
            "upload_time": "2024-01-26T20:01:22",
            "upload_time_iso_8601": "2024-01-26T20:01:22.836518Z",
            "url": "https://files.pythonhosted.org/packages/ef/b4/8682d289dc22875d6b8b7df7c41b2df65d5d221ad860544fcf5f082554a6/Adon-1.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4b287af841f32d113c92343d9c184ccdfa72bdef993b4b28aa6eabde95e826ef",
                "md5": "60477c0f34e7f603af5d48a4caa78301",
                "sha256": "5c83f19cb7e39930b763c2b72e6609c3050281e4c840ebc6edd00cc597a26c7c"
            },
            "downloads": -1,
            "filename": "Adon-1.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "60477c0f34e7f603af5d48a4caa78301",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 6135,
            "upload_time": "2024-01-26T20:01:30",
            "upload_time_iso_8601": "2024-01-26T20:01:30.755489Z",
            "url": "https://files.pythonhosted.org/packages/4b/28/7af841f32d113c92343d9c184ccdfa72bdef993b4b28aa6eabde95e826ef/Adon-1.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-26 20:01:30",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ThereAre12Months",
    "github_project": "Adon",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "adon"
}
        
Elapsed time: 0.16709s