Metadata-Version: 2.3
Name: djg
Version: 0.1.0
Summary: JSON generation based on schema.
Author-email: Domink Moos <dominik.moos@proton.me>
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.
License-File: LICENSE
Keywords: json,json-generation,json-schema
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Utilities
Requires-Python: >=3.10
Requires-Dist: exrex
Description-Content-Type: text/markdown

# 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 = gen_from_schema(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
```
