Skip to main content

Just another Data Offline Generator

Project description

https://github.com/petrnymsa/jdog/workflows/build-test/badge.svg https://readthedocs.org/projects/jdog/badge/?version=latest

Just another Data Offline Generator (JDOG) 🐶

🗎 Full documentation.

  • JDOG is Python library which helps generate sample data for your projects.
  • JDOG can be run also as CLI tool.
  • For generating sample data, the data scheme is provided
  • The scheme is in JSON format

Scheme

  • Scheme is provided in JSON format with special placeholders.
  • Placeholder is something like variable, where generated data will be replaced.
  • Output is nearly the same as scheme besides replaced placeholders.

In the simplest form, given JSON scheme

{
    "name": "Bob",
    "age" : "18"
}

is valid scheme although no additional generation will proceed.

The simplest example can be

{
    "name": "Bob",
    "age": "{{number(18,100)}"
}

which produce Bob with any age between <18, 99> e.g:

{
    "name": "Bob",
    "age": 26
}

More useful example

{
    "{{range(people, 4)}}": {
        "name": "{{first_name}}",
        "age" : "{{number(18, 100)}}"

    }
}

generates array of size 4 with objects containing name and age. The result

{
    "people": [{
            "name": "Bob",
            "age": "18"
        },
        {
            "name": "Alice",
            "age": 25
        },
        {
            "name": "George",
            "age": 85
        },
        {
            "name": "Janice",
            "age": 34
        }
    ]
}

TODO - faker info

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for jdog, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size jdog-0.1.0.tar.gz (9.8 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page