<div align="center">
# ASON: Adaptive Structure Object Notation
<br>
[](https://github.com/muhammad-fiaz/ason/actions/workflows/package-tests.yaml)
[](https://pypi.org/project/ason/)
[](https://pypi.org/project/ason/)
[](https://pypi.org/project/ason/)
[](https://github.com/muhammad-fiaz/ason)
[](https://github.com/muhammad-fiaz/ason/issues)
[](https://github.com/muhammad-fiaz/ason/stargazers)
[](https://github.com/muhammad-fiaz/ason/network)
[](https://github.com/muhammad-fiaz)
[](https://github.com/sponsors/muhammad-fiaz)
[](https://github.com/muhammad-fiaz/ason/blob/main/LICENSE)
[](https://github.com/muhammad-fiaz/ason)
ASON is a Python library designed for adaptive data serialization. It seamlessly handles various data structures, offering flexibility and simplicity inspired by JSON.
</div>
## Installation
```bash
pip install ason
```
## Usage
```python3
# Usage example for Ason class
from ason import ason
# Create an Ason object
data = '{"name": "${name}", "age": ${age}, "city": "${city}", "hobbies": ["${hobby1}", "${hobby2}"]}'
ason_data = ason.loads(data)
# Set values for variables
ason_data.set("name", "John")
ason_data.set("age", 30)
ason_data.set("city", "New York")
ason_data.set("hobby1", "Reading")
ason_data.set("hobby2", "Coding")
# Print the result after setting variables
result_after_set = ason_data.dumps()
print("Result after setting variables:")
print(result_after_set)
print()
# Replace a key dynamically
ason_data.replace("age", "new_age", 25)
# Append a value to the 'hobbies' list
ason_data.append("hobbies", "Gardening")
# Print the result after replacing and appending
result_after_modify = ason_data.dumps()
print("Result after replacing and appending:")
print(result_after_modify)
print()
# Get the value associated with a key
city_value = ason_data.get("city")
print("Value for key 'city':", city_value)
print()
# Accessing values using square bracket notation
name_value = ason_data["name"]
print("Value for key 'name' using square bracket notation:", name_value)
print()
# Set a value using square bracket notation
ason_data["new_key"] = "new_value"
print("Result after setting a value using square bracket notation:")
print(ason_data.dumps())
```
This example demonstrates how to create an Ason object, load data, set values for variables, and then dump the result. The output will be a dictionary with the replaced values:
Result after setting variables:
```json
{"name": "John", "age": "30", "city": "New York", "hobbies": ["${hobby1}", "${hobby2}"]}
```
Result after replacing and appending:
```json
{"name": "John", "new_age": 25, "city": "New York", "hobbies": ["${hobby1}", "${hobby2}", "Gardening"]}
```
Value for key 'city': New York
Value for key 'name' using square bracket notation: John
Result after setting a value using square bracket notation:
```json
{"name": "John", "new_age": 25, "city": "New York", "hobbies": ["${hobby1}", "${hobby2}", "Gardening"], "new_key": "new_value"}
```
## Contributing
Contributions are welcome! Before contributing, please read our [Contributing Guidelines](CONTRIBUTING.md) to ensure a smooth and collaborative development process.
## Code of Conduct
Please review our [Code of Conduct](CODE_OF_CONDUCT.md) to understand the standards of behavior we expect from contributors and users of this project.
## License
This project is licensed under the [Apache 2.0 License](). See [LICENSE](LICENSE) for more details.
## Support the Project
<br>
<div align="center">
<h5> <strong> 💰 You can help me improve more by offering a little support on any platform❤️</strong></h5>
[](https://buymeacoffee.com/muhammadfiaz) [](https://patreon.com/muhammadfiaz) [](https://ko-fi.com/muhammadfiaz)
[](https://github.com/sponsors/muhammad-fiaz)
[](https://opencollective.com/muhammadfiaz)
</div>
## Happy Coding ❤️
Raw data
{
"_id": null,
"home_page": "https://github.com/muhammad-fiaz/ason.git",
"name": "ason",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "ason,json,serialization,structured data,python",
"author": "Muhammad Fiaz",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/55/12/1ed6f59ce28c90997606a434dc01dc0c716323e03cad470f761cdd7f9c9a/ason-0.0.1.tar.gz",
"platform": null,
"description": "<div align=\"center\">\n \n# ASON: Adaptive Structure Object Notation\n\n<br>\n\n[](https://github.com/muhammad-fiaz/ason/actions/workflows/package-tests.yaml)\n[](https://pypi.org/project/ason/)\n[](https://pypi.org/project/ason/)\n[](https://pypi.org/project/ason/)\n[](https://github.com/muhammad-fiaz/ason)\n[](https://github.com/muhammad-fiaz/ason/issues)\n[](https://github.com/muhammad-fiaz/ason/stargazers)\n[](https://github.com/muhammad-fiaz/ason/network)\n\n[](https://github.com/muhammad-fiaz)\n[](https://github.com/sponsors/muhammad-fiaz)\n[](https://github.com/muhammad-fiaz/ason/blob/main/LICENSE)\n[](https://github.com/muhammad-fiaz/ason)\n\nASON is a Python library designed for adaptive data serialization. It seamlessly handles various data structures, offering flexibility and simplicity inspired by JSON.\n\n\n</div>\n\n\n\n## Installation\n\n```bash\npip install ason\n```\n\n## Usage\n\n```python3\n# Usage example for Ason class\n\nfrom ason import ason\n\n# Create an Ason object\ndata = '{\"name\": \"${name}\", \"age\": ${age}, \"city\": \"${city}\", \"hobbies\": [\"${hobby1}\", \"${hobby2}\"]}'\nason_data = ason.loads(data)\n\n# Set values for variables\nason_data.set(\"name\", \"John\")\nason_data.set(\"age\", 30)\nason_data.set(\"city\", \"New York\")\nason_data.set(\"hobby1\", \"Reading\")\nason_data.set(\"hobby2\", \"Coding\")\n\n# Print the result after setting variables\nresult_after_set = ason_data.dumps()\nprint(\"Result after setting variables:\")\nprint(result_after_set)\nprint()\n\n# Replace a key dynamically\nason_data.replace(\"age\", \"new_age\", 25)\n\n# Append a value to the 'hobbies' list\nason_data.append(\"hobbies\", \"Gardening\")\n\n# Print the result after replacing and appending\nresult_after_modify = ason_data.dumps()\nprint(\"Result after replacing and appending:\")\nprint(result_after_modify)\nprint()\n\n# Get the value associated with a key\ncity_value = ason_data.get(\"city\")\nprint(\"Value for key 'city':\", city_value)\nprint()\n\n# Accessing values using square bracket notation\nname_value = ason_data[\"name\"]\nprint(\"Value for key 'name' using square bracket notation:\", name_value)\nprint()\n\n# Set a value using square bracket notation\nason_data[\"new_key\"] = \"new_value\"\nprint(\"Result after setting a value using square bracket notation:\")\nprint(ason_data.dumps())\n\n\n```\nThis example demonstrates how to create an Ason object, load data, set values for variables, and then dump the result. The output will be a dictionary with the replaced values:\n\nResult after setting variables:\n```json\n\n{\"name\": \"John\", \"age\": \"30\", \"city\": \"New York\", \"hobbies\": [\"${hobby1}\", \"${hobby2}\"]}\n```\nResult after replacing and appending:\n```json\n\n{\"name\": \"John\", \"new_age\": 25, \"city\": \"New York\", \"hobbies\": [\"${hobby1}\", \"${hobby2}\", \"Gardening\"]}\n```\nValue for key 'city': New York\n\nValue for key 'name' using square bracket notation: John\n\nResult after setting a value using square bracket notation:\n```json\n\n{\"name\": \"John\", \"new_age\": 25, \"city\": \"New York\", \"hobbies\": [\"${hobby1}\", \"${hobby2}\", \"Gardening\"], \"new_key\": \"new_value\"}\n```\n\n## Contributing\nContributions are welcome! Before contributing, please read our [Contributing Guidelines](CONTRIBUTING.md) to ensure a smooth and collaborative development process.\n\n## Code of Conduct\n\nPlease review our [Code of Conduct](CODE_OF_CONDUCT.md) to understand the standards of behavior we expect from contributors and users of this project.\n\n## License\nThis project is licensed under the [Apache 2.0 License](). See [LICENSE](LICENSE) for more details.\n\n## Support the Project\n<br>\n<div align=\"center\">\n\n<h5> <strong> \ud83d\udcb0 You can help me improve more by offering a little support on any platform\u2764\ufe0f</strong></h5>\n\n[](https://buymeacoffee.com/muhammadfiaz) [](https://patreon.com/muhammadfiaz) [](https://ko-fi.com/muhammadfiaz)\n[](https://github.com/sponsors/muhammad-fiaz)\n[](https://opencollective.com/muhammadfiaz)\n</div>\n\n\n\n## Happy Coding \u2764\ufe0f\n\n\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "ASON: Adaptive Structure Object Notation - Python library for handling structured data with flexibility and ease.",
"version": "0.0.1",
"project_urls": {
"Bug Tracker": "https://github.com/muhammad-fiaz/ason/issues",
"Documentation": "https://github.com/muhammad-fiaz/ason#readme",
"Homepage": "https://github.com/muhammad-fiaz/ason.git",
"Source Code": "https://github.com/muhammad-fiaz/ason.git"
},
"split_keywords": [
"ason",
"json",
"serialization",
"structured data",
"python"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "55121ed6f59ce28c90997606a434dc01dc0c716323e03cad470f761cdd7f9c9a",
"md5": "34c05c755835e4aaf8c1646c5fab79a6",
"sha256": "fa0182429b39c6a34f7b11fad5d92d4831e6bbd9a12a3d85b6f7ccb85567c4cd"
},
"downloads": -1,
"filename": "ason-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "34c05c755835e4aaf8c1646c5fab79a6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 10582,
"upload_time": "2024-01-12T12:11:23",
"upload_time_iso_8601": "2024-01-12T12:11:23.719733Z",
"url": "https://files.pythonhosted.org/packages/55/12/1ed6f59ce28c90997606a434dc01dc0c716323e03cad470f761cdd7f9c9a/ason-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-12 12:11:23",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "muhammad-fiaz",
"github_project": "ason",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "ason"
}