=======
JSONTas
=======
JSONTas is a tool for generating dynamic JSON data.
Description
===========
JSONTas adds conditionals and logic to JSON files in order to create dynamic JSON data depending on which dataset you supply.
It opens up the possibility to create generic tools where most of the operations are done by executing JSONTas on the data.
Documentation: https://jsontas.readthedocs.io/en/latest
Features
========
- Simple yet powerful syntax.
- HTTP requests on parse
- Separation of environments by providing different datasets.
Installation
============
Install the project by running:
pip install jsontas
Examples
========
First we create two datasets. One for our 'dev' environment and one for our 'prod' environment.
Dataset 'dev.json'
------------------
.. code-block:: JSON
{
"mode": "dev",
"database": "dev_db"
}
Dataset 'prod.json'
-------------------
.. code-block:: JSON
{
"mode": "prod",
"database": "prod_db"
}
JSONTas JSON file
-----------------
Next up, let's create our JSONTas file.
.. code-block:: JSON
{
"database": {
"host": "myawesomedb.example.com",
"database": "$database"
},
"message": {
"$condition": {
"if": {
"key": "$mode",
"operator": "$eq",
"value": "dev"
},
"then": "This is the DEV server.",
"else": "This is the PROD server."
}
}
}
JSONTas execute with 'dev' dataset
----------------------------------
.. code-block:: bash
jsontas -d dev.json data.json
.. code-block:: JSON
{
"database": {
"host": "myawesomedb.example.com",
"database": "dev_db"
},
"message": "This is the DEV server."
}
JSONTas execute with 'prod' dataset
-----------------------------------
.. code-block:: bash
jsontas -d prod.json data.json
.. code-block:: JSON
{
"database": {
"host": "myawesomedb.example.com",
"database": "prod_db"
},
"message": "This is the PROD server."
}
These examples only show the bare minimum.
For more examples look at our documentation at: https://jsontas.readthedocs.io/en/latest
Contribute
==========
- Issue Tracker: https://github.com/AxisCommunications/jsontas/issues
- Source Code: https://github.com/AxisCommunications/jsontas
Support
=======
If you are having issues, please let us know.
Email tobias.persson@axis.com or just write an issue.
Raw data
{
"_id": null,
"home_page": "https://github.com/AxisCommunications/jsontas/",
"name": "jsontas",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Tobias Persson",
"author_email": "tobias.persson@axis.com",
"download_url": "https://files.pythonhosted.org/packages/5f/b3/3dd6b70f3e2a31dde835caf41b035b9a0a467d8c6ad37d884bf5d1d8a725/jsontas-1.4.0.tar.gz",
"platform": "any",
"description": "=======\nJSONTas\n=======\n\nJSONTas is a tool for generating dynamic JSON data.\n\nDescription\n===========\n\nJSONTas adds conditionals and logic to JSON files in order to create dynamic JSON data depending on which dataset you supply.\n\nIt opens up the possibility to create generic tools where most of the operations are done by executing JSONTas on the data.\n\nDocumentation: https://jsontas.readthedocs.io/en/latest\n\n\nFeatures\n========\n\n- Simple yet powerful syntax.\n- HTTP requests on parse\n- Separation of environments by providing different datasets.\n\nInstallation\n============\n\nInstall the project by running:\n\n pip install jsontas\n\nExamples\n========\n\nFirst we create two datasets. One for our 'dev' environment and one for our 'prod' environment.\n\nDataset 'dev.json'\n------------------\n\n.. code-block:: JSON\n\n {\n \"mode\": \"dev\",\n \"database\": \"dev_db\"\n }\n\n\nDataset 'prod.json'\n-------------------\n\n.. code-block:: JSON\n\n {\n \"mode\": \"prod\",\n \"database\": \"prod_db\"\n }\n\nJSONTas JSON file\n-----------------\n\nNext up, let's create our JSONTas file.\n\n.. code-block:: JSON\n\n {\n \"database\": {\n \"host\": \"myawesomedb.example.com\",\n \"database\": \"$database\"\n },\n \"message\": {\n \"$condition\": {\n \"if\": {\n \"key\": \"$mode\",\n \"operator\": \"$eq\",\n \"value\": \"dev\"\n },\n \"then\": \"This is the DEV server.\",\n \"else\": \"This is the PROD server.\"\n }\n }\n }\n\nJSONTas execute with 'dev' dataset\n----------------------------------\n\n.. code-block:: bash\n\n jsontas -d dev.json data.json\n\n.. code-block:: JSON\n\n {\n \"database\": {\n \"host\": \"myawesomedb.example.com\",\n \"database\": \"dev_db\"\n },\n \"message\": \"This is the DEV server.\"\n }\n\nJSONTas execute with 'prod' dataset\n-----------------------------------\n\n.. code-block:: bash\n\n jsontas -d prod.json data.json\n\n.. code-block:: JSON\n\n {\n \"database\": {\n \"host\": \"myawesomedb.example.com\",\n \"database\": \"prod_db\"\n },\n \"message\": \"This is the PROD server.\"\n }\n\nThese examples only show the bare minimum.\nFor more examples look at our documentation at: https://jsontas.readthedocs.io/en/latest\n\nContribute\n==========\n\n- Issue Tracker: https://github.com/AxisCommunications/jsontas/issues\n- Source Code: https://github.com/AxisCommunications/jsontas\n\nSupport\n=======\n\nIf you are having issues, please let us know.\nEmail tobias.persson@axis.com or just write an issue.\n\n\n",
"bugtrack_url": null,
"license": "Apache License, Version 2.0",
"summary": "JSONTas is a tool for generating dynamic JSON structures.",
"version": "1.4.0",
"project_urls": {
"Documentation": "https://jsontas.readthedocs.io/",
"Homepage": "https://github.com/AxisCommunications/jsontas/"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7ec23f197c23ffa0546314b7e64f13871dc7a8df5f0e724a5e172d565aa9ea67",
"md5": "8935630637ba2b1f2ec34461086b06d7",
"sha256": "31e1bc6904ff84f63279220b01b7b39227b1e9b33cc259540cd4714a840dd136"
},
"downloads": -1,
"filename": "jsontas-1.4.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "8935630637ba2b1f2ec34461086b06d7",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 28761,
"upload_time": "2021-10-15T13:21:49",
"upload_time_iso_8601": "2021-10-15T13:21:49.601266Z",
"url": "https://files.pythonhosted.org/packages/7e/c2/3f197c23ffa0546314b7e64f13871dc7a8df5f0e724a5e172d565aa9ea67/jsontas-1.4.0-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5fb33dd6b70f3e2a31dde835caf41b035b9a0a467d8c6ad37d884bf5d1d8a725",
"md5": "11f42ec376b2a22f15eb2b006de08af9",
"sha256": "2bc14b8a85358310b97c06dbeaa51f4cc5e0808f53641d7c987c511096084b8a"
},
"downloads": -1,
"filename": "jsontas-1.4.0.tar.gz",
"has_sig": false,
"md5_digest": "11f42ec376b2a22f15eb2b006de08af9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 32235,
"upload_time": "2021-10-15T13:21:51",
"upload_time_iso_8601": "2021-10-15T13:21:51.860884Z",
"url": "https://files.pythonhosted.org/packages/5f/b3/3dd6b70f3e2a31dde835caf41b035b9a0a467d8c6ad37d884bf5d1d8a725/jsontas-1.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2021-10-15 13:21:51",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "AxisCommunications",
"github_project": "jsontas",
"travis_ci": false,
"coveralls": true,
"github_actions": false,
"requirements": [],
"lcname": "jsontas"
}