Skip to main content

Simple package for creating mockdata for a live database, according to specified relational schema.

Project description

Mock data generation

This is small project for generating artificial / mock data, conforming to the specified DB schema. It can be useful to either generate pseudo-realistic data in the database, or prepare large amounts of mock data for stress testing.

The package allows for generating mock data for specified database schema.

Configuration file schema:

{
  "connection": "postgresql+psycopg2://admin:test@172.17.0.1:5432/ChmielDB",
  "tables": {
        "Projects":{
        "id": "PK serial",
        "project_name": "first_name",
        "project_owner": "FK Users.id"
      },
      "Users": {
        "id": "PK serial",
        "first_name": "first_name",
        "last_name": "last_name",
        "email": "email UNIQUE",
        "password": "password",
        "role": "OPTION IN (USER, ADMIN)",
        "address": "address",
        "birth_date": "timestamp",
        "phone_number": "phone"
      },
      "IntermediaryTable: Projects_Users": {
        "project_id": "FK Projects.id",
        "user_id": "FK Users.id"
      },
  },
  "objects_count": {
    "Users": 25,
    "Projects": 10,
    "Projects_Users": 250,
  }

Allowed column keywords:

Disclaimer:

The program only checks for uniqueness and integrity withing itself, there can still be error if there's already existing data in the database.

Project details


Download files

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

Source Distribution

db_mockdata-0.1.1.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

db_mockdata-0.1.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file db_mockdata-0.1.1.tar.gz.

File metadata

  • Download URL: db_mockdata-0.1.1.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for db_mockdata-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3007c3ff053cdfe62c7ead0c7ed7170b3f45d59fee8245cb0674c77c9a1f81cb
MD5 ae5c0154bed2ae2250b216d06a399415
BLAKE2b-256 a67a10915a45dffda801d84d296576cf5f031cfd9bbf4b6b632b4aab3a8b68c4

See more details on using hashes here.

File details

Details for the file db_mockdata-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: db_mockdata-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for db_mockdata-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8e19743fd452341db69f281ca9fc9896c53459b731b27c897c0f54b95b9f272b
MD5 e52506a1d7e02d910b3c81e4f8c158e4
BLAKE2b-256 d3c999b2a57c33a2eccbccfd9f43c481cb320d21ccb92e7c5cabaacb0970cbc5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page