Name | DJG JSON |
Version |
0.0.1
JSON |
| download |
home_page | None |
Summary | JSON generation based on schema. |
upload_time | 2024-08-29 19:01:04 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.10 |
license | MIT License Copyright (c) 2024 Dominik Moos 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
json-generation
json-schema
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# DJG
DJG is a simple library and cli tool generating JSON objects based on a given schema.
*DJG is in very early development.
Currently only properties of type number and string are supported.*
## Installation
Install via pip
```bash
$ pip install djg
```
## Usage
#### As Python module
```python
from djg import generate
import json
schema = {
"type": "object",
"properties": {
"ProductIdentifier": {
"type": "object",
"properties": {
"Name": {"type": "string", "pattern": "[a-zA-Z]{5,10}"},
"Uid": {"type": "number", "minimum": 1000, "maximum": 100000},
},
},
"ProductQuantity": {
"type": "number",
"minimum": 0,
"maximum": 100,
},
},
}
json_object = generate(schema)
```
#### CLI
```bash
djg --help
usage: djg.py [-h] -s SCHEMA_FILE [-o FILE]
djg - create random JSON objects based on a given schema.
options:
-h, --help show this help message and exit
-s SCHEMA_FILE, --schema SCHEMA_FILE
JSON Schema loaction
-o FILE, --output FILE
JSON output location - default is stdout
```
Raw data
{
"_id": null,
"home_page": null,
"name": "DJG",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "json, json-generation, json-schema",
"author": null,
"author_email": "Domink Moos <dominik.moos@proton.me>",
"download_url": "https://files.pythonhosted.org/packages/c8/f7/cad885a258cc621d349921e3c56ab16878e99075cbde54b285f3be68db7d/djg-0.0.1.tar.gz",
"platform": null,
"description": "# DJG\nDJG is a simple library and cli tool generating JSON objects based on a given schema.\n\n*DJG is in very early development.\nCurrently only properties of type number and string are supported.*\n\n\n## Installation\nInstall via pip\n```bash\n$ pip install djg\n```\n\n## Usage\n#### As Python module\n```python\nfrom djg import generate\nimport json\n\nschema = {\n \"type\": \"object\",\n \"properties\": {\n \"ProductIdentifier\": {\n \"type\": \"object\",\n \"properties\": {\n \"Name\": {\"type\": \"string\", \"pattern\": \"[a-zA-Z]{5,10}\"},\n \"Uid\": {\"type\": \"number\", \"minimum\": 1000, \"maximum\": 100000},\n },\n },\n \"ProductQuantity\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 100,\n },\n },\n}\n\njson_object = generate(schema)\n```\n\n#### CLI\n```bash\ndjg --help\n\nusage: djg.py [-h] -s SCHEMA_FILE [-o FILE]\n\ndjg - create random JSON objects based on a given schema.\n\noptions:\n -h, --help show this help message and exit\n -s SCHEMA_FILE, --schema SCHEMA_FILE\n JSON Schema loaction\n -o FILE, --output FILE\n JSON output location - default is stdout\n```\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2024 Dominik Moos 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": "JSON generation based on schema.",
"version": "0.0.1",
"project_urls": null,
"split_keywords": [
"json",
" json-generation",
" json-schema"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5e082badb1d551f96aab653be20655e715bebb4a6df919eac8fb84bdfab7c736",
"md5": "fcad11fec7ed34b65b651cfd08cfbdb5",
"sha256": "8672f0850bd60f25eb5c3ba5586f174b05040e7e9dce587e4de02b5a98d494d6"
},
"downloads": -1,
"filename": "djg-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "fcad11fec7ed34b65b651cfd08cfbdb5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 3938,
"upload_time": "2024-08-29T19:01:02",
"upload_time_iso_8601": "2024-08-29T19:01:02.414902Z",
"url": "https://files.pythonhosted.org/packages/5e/08/2badb1d551f96aab653be20655e715bebb4a6df919eac8fb84bdfab7c736/djg-0.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c8f7cad885a258cc621d349921e3c56ab16878e99075cbde54b285f3be68db7d",
"md5": "d9ed40046f20ed97d31a1e9c8e33946d",
"sha256": "a29948609d9142e979b88f25219636c1903bd7443f704e55315f941900007bac"
},
"downloads": -1,
"filename": "djg-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "d9ed40046f20ed97d31a1e9c8e33946d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 5104,
"upload_time": "2024-08-29T19:01:04",
"upload_time_iso_8601": "2024-08-29T19:01:04.539743Z",
"url": "https://files.pythonhosted.org/packages/c8/f7/cad885a258cc621d349921e3c56ab16878e99075cbde54b285f3be68db7d/djg-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-29 19:01:04",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "djg"
}