db-mockdata


Namedb-mockdata JSON
Version 0.4.4 PyPI version JSON
download
home_pageNone
SummarySimple package for creating mockdata for a live database, according to specified relational schema.
upload_time2024-11-21 11:33:10
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT License
keywords mock database faker
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## 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.

## Simple 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,
  }
```

## Advanced configuration file schema:

```
{
  "connection": "postgresql+psycopg2://admin:test@172.22.0.1:5432/JobMarketDB",
  "tables": {
    "app_users": {
      "user_id": "PK UUID",
      "company": "FK_UUID company.company_id",
      "email": "email UNIQUE",
      "first_name": "first_name",
      "last_name": "last_name",
      "phone": "first_name",
      "role": "OPTION IN (USER,ADMIN)",
      "is_blocked": "bool",
      "email_verified": "bool",
      "employee_verified": "bool",
      "created_at": "timestamp RANGE(2023-01-01 00:00:00,2024-12-24 22:12:00)",
      "password_hash": "first_name"
    },
    "skills": {
      "skill_id": "PK UUID",
      "profile_id": "FK_UUID user_profiles.profile_id",
      "skill_name": "first_name",
      "proficiency_level": "first_name",
      "updated_at": "timestamp RANGE(2023-01-01 00:00:00,2024-12-24 22:12:00)"
    },
    "chat_messages": {
      "message_id": "PK UUID",
      "chat_id": "FK_UUID chats.chat_id",
      "content": "long_text RANGE(6, 20)",
      "created_by": "FK_UUID app_users.user_id",
      "created_by_display": "first_name",
      "read_by": "first_name",
      "deleted_by": "first_name",
      "created_at": "timestamp RANGE(2023-01-01 00:00:00,2024-12-24 22:12:00)",
      "updated_at": "timestamp RANGE(2023-01-01 00:00:00,2024-12-24 22:12:00)"
    },
    "job": {
      "job_id": "PK UUID",
      "company_id": "FK_UUID company.company_id",
      "job_title": "first_name",
      "job_description": "long_text RANGE(6, 20)",
      "required_skills": "jsonb:json1",
      "required_experience": "long_text RANGE(6, 20)",
      "location": "first_name",
      "salary": "float RANGE(100,12000) DISTRIBUTION(normal,mean=1,std=1)",
      "created_at": "timestamp RANGE(2023-01-01 00:00:00,2024-12-24 22:12:00) RANGE()"
    },
    "experiences": {
      "experience_id": "PK UUID",
      "profile_id": "FK_UUID user_profiles.profile_id",
      "company_name": "FK_UUID company.company_id",
      "role": "first_name",
      "start_date": "timestamp RANGE(2023-01-01 00:00:00,2024-12-24 22:12:00)",
      "end_date": "timestamp RANGE(2023-01-01 00:00:00,2024-12-24 22:12:00)",
      "updated_at": "timestamp RANGE(2023-01-01 00:00:00,2024-12-24 22:12:00)"
    },
    "educations": {
      "education_id": "PK UUID",
      "profile_id": "first_name",
      "institution_name": "first_name",
      "degree": "first_name",
      "location": "country+city(\"en_US\",\"en_GB\",\"fr_FR\",\"de_DE\",\"it_IT\",\"es_ES\",\"pl_PL\",\"nl_NL\",\"pt_PT\",\"sv_SE\",\"da_DK\",\"fi_FI\",\"no_NO\",\"cs_CZ\",\"hu_HU\",\"en_CA\",\"sk_SK\")",
      "start_date": "timestamp RANGE(2023-01-01 00:00:00,2024-12-24 22:12:00)",
      "end_date": "timestamp RANGE(2023-01-01 00:00:00,2024-12-24 22:12:00)",
      "updated_at": "timestamp RANGE(2023-01-01 00:00:00,2024-12-24 22:12:00)"
    },
    "company": {
      "company_id": "PK UUID",
      "company_name": "first_name",
      "location": "first_name",
      "industry": "first_name",
      "description": "first_name",
      "verified": "bool",
      "created_at": "timestamp RANGE(2023-01-01 00:00:00,2024-12-24 22:12:00)",
      "updated_at": "timestamp RANGE(2023-01-01 00:00:00,2024-12-24 22:12:00)"
    },
    "chats": {
      "chat_id": "PK UUID",
      "name": "first_name",
      "created_by": "first_name",
      "deleted_by": "first_name",
      "last_message": "first_name",
      "tags": "first_name",
      "created_at": "timestamp RANGE(2023-01-01 00:00:00,2024-12-24 22:12:00)",
      "updated_at": "timestamp RANGE(2023-01-01 00:00:00,2024-12-24 22:12:00)"
    },
    "IntermediaryTable: user_chats":{
      "chat_id": "FK_UUID chats.chat_id",
      "user_id": "FK_UUID app_users.user_id"
    },
    "user_profiles": {
      "profile_id": "PK UUID",
      "user_id": "FK_UUID app_users.user_id",
      "resume_path": "first_name",
      "profile_picture_path": "first_name",
      "updated_at": "timestamp RANGE(2023-01-01 00:00:00,2024-12-24 22:12:00)"
    },
    "user_settings": {
      "settings_id": "PK UUID",
      "user_id": "FK_UUID app_users.user_id",
      "offers_notification": "bool",
      "newsletter_notification": "bool",
      "recruiter_messages": "bool",
      "push_notification": "bool",
      "updated_at": "timestamp RANGE(2023-01-01 00:00:00,2024-12-24 22:12:00)"
    }
  },
  "json_schemas": [
    {
      "json1": {
        "fields": [
          {
            "skills": {
               "type": "array",
               "item_count": "RANGE(1, 5)",
               "content": {
                  "type": "object",
                  "fields": {
                    "name": {
                      "type": "string",
                      "options": ["Python", "JavaScript", "Java", "C++", "Go", "Ruby"]
                    },
                    "level": {
                      "type": "integer",
                      "range": [1, 5]
                    }
                  }
               }
            }
          }
        ]
      }
    }
  ],
  "objects_count": {
    "app_users": 200,
    "skills": 500,
    "chat_messages": 8000,
    "job": 250,
    "experiences": 100,
    "educations": 200,
    "company": 20,
    "chats": 50,
    "user_profiles": 500,
    "user_settings": 500,
    "user_chats": 10000
  }
}
```

### Allowed column keywords:

TODO

#### 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.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "db-mockdata",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "mock, database, faker",
    "author": null,
    "author_email": "Mateusz Molenda <devexperrior@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/32/92/ba9ee92894fac2b9ad8bfc4b02c8e5022e7484c3c512e7bbdea33ee310b5/db_mockdata-0.4.4.tar.gz",
    "platform": null,
    "description": "## Mock data generation\n\nThis is small project for generating artificial / mock data, conforming to the specified DB schema.\nIt can be useful to either generate pseudo-realistic data in the database, or prepare large amounts of mock data for stress testing.\n\n\nThe package allows for generating mock data for specified database schema.\n\n## Simple configuration file schema:\n\n```  \n{\n  \"connection\": \"postgresql+psycopg2://admin:test@172.17.0.1:5432/ChmielDB\",\n  \"tables\": {\n        \"Projects\":{\n        \"id\": \"PK serial\",\n        \"project_name\": \"first_name\",\n        \"project_owner\": \"FK Users.id\"\n      },\n      \"Users\": {\n        \"id\": \"PK serial\",\n        \"first_name\": \"first_name\",\n        \"last_name\": \"last_name\",\n        \"email\": \"email UNIQUE\",\n        \"password\": \"password\",\n        \"role\": \"OPTION IN (USER, ADMIN)\",\n        \"address\": \"address\",\n        \"birth_date\": \"timestamp\",\n        \"phone_number\": \"phone\"\n      },\n      \"IntermediaryTable: Projects_Users\": {\n        \"project_id\": \"FK Projects.id\",\n        \"user_id\": \"FK Users.id\"\n      },\n  },\n  \"objects_count\": {\n    \"Users\": 25,\n    \"Projects\": 10,\n    \"Projects_Users\": 250,\n  }\n```\n\n## Advanced configuration file schema:\n\n```\n{\n  \"connection\": \"postgresql+psycopg2://admin:test@172.22.0.1:5432/JobMarketDB\",\n  \"tables\": {\n    \"app_users\": {\n      \"user_id\": \"PK UUID\",\n      \"company\": \"FK_UUID company.company_id\",\n      \"email\": \"email UNIQUE\",\n      \"first_name\": \"first_name\",\n      \"last_name\": \"last_name\",\n      \"phone\": \"first_name\",\n      \"role\": \"OPTION IN (USER,ADMIN)\",\n      \"is_blocked\": \"bool\",\n      \"email_verified\": \"bool\",\n      \"employee_verified\": \"bool\",\n      \"created_at\": \"timestamp RANGE(2023-01-01 00:00:00,2024-12-24 22:12:00)\",\n      \"password_hash\": \"first_name\"\n    },\n    \"skills\": {\n      \"skill_id\": \"PK UUID\",\n      \"profile_id\": \"FK_UUID user_profiles.profile_id\",\n      \"skill_name\": \"first_name\",\n      \"proficiency_level\": \"first_name\",\n      \"updated_at\": \"timestamp RANGE(2023-01-01 00:00:00,2024-12-24 22:12:00)\"\n    },\n    \"chat_messages\": {\n      \"message_id\": \"PK UUID\",\n      \"chat_id\": \"FK_UUID chats.chat_id\",\n      \"content\": \"long_text RANGE(6, 20)\",\n      \"created_by\": \"FK_UUID app_users.user_id\",\n      \"created_by_display\": \"first_name\",\n      \"read_by\": \"first_name\",\n      \"deleted_by\": \"first_name\",\n      \"created_at\": \"timestamp RANGE(2023-01-01 00:00:00,2024-12-24 22:12:00)\",\n      \"updated_at\": \"timestamp RANGE(2023-01-01 00:00:00,2024-12-24 22:12:00)\"\n    },\n    \"job\": {\n      \"job_id\": \"PK UUID\",\n      \"company_id\": \"FK_UUID company.company_id\",\n      \"job_title\": \"first_name\",\n      \"job_description\": \"long_text RANGE(6, 20)\",\n      \"required_skills\": \"jsonb:json1\",\n      \"required_experience\": \"long_text RANGE(6, 20)\",\n      \"location\": \"first_name\",\n      \"salary\": \"float RANGE(100,12000) DISTRIBUTION(normal,mean=1,std=1)\",\n      \"created_at\": \"timestamp RANGE(2023-01-01 00:00:00,2024-12-24 22:12:00) RANGE()\"\n    },\n    \"experiences\": {\n      \"experience_id\": \"PK UUID\",\n      \"profile_id\": \"FK_UUID user_profiles.profile_id\",\n      \"company_name\": \"FK_UUID company.company_id\",\n      \"role\": \"first_name\",\n      \"start_date\": \"timestamp RANGE(2023-01-01 00:00:00,2024-12-24 22:12:00)\",\n      \"end_date\": \"timestamp RANGE(2023-01-01 00:00:00,2024-12-24 22:12:00)\",\n      \"updated_at\": \"timestamp RANGE(2023-01-01 00:00:00,2024-12-24 22:12:00)\"\n    },\n    \"educations\": {\n      \"education_id\": \"PK UUID\",\n      \"profile_id\": \"first_name\",\n      \"institution_name\": \"first_name\",\n      \"degree\": \"first_name\",\n      \"location\": \"country+city(\\\"en_US\\\",\\\"en_GB\\\",\\\"fr_FR\\\",\\\"de_DE\\\",\\\"it_IT\\\",\\\"es_ES\\\",\\\"pl_PL\\\",\\\"nl_NL\\\",\\\"pt_PT\\\",\\\"sv_SE\\\",\\\"da_DK\\\",\\\"fi_FI\\\",\\\"no_NO\\\",\\\"cs_CZ\\\",\\\"hu_HU\\\",\\\"en_CA\\\",\\\"sk_SK\\\")\",\n      \"start_date\": \"timestamp RANGE(2023-01-01 00:00:00,2024-12-24 22:12:00)\",\n      \"end_date\": \"timestamp RANGE(2023-01-01 00:00:00,2024-12-24 22:12:00)\",\n      \"updated_at\": \"timestamp RANGE(2023-01-01 00:00:00,2024-12-24 22:12:00)\"\n    },\n    \"company\": {\n      \"company_id\": \"PK UUID\",\n      \"company_name\": \"first_name\",\n      \"location\": \"first_name\",\n      \"industry\": \"first_name\",\n      \"description\": \"first_name\",\n      \"verified\": \"bool\",\n      \"created_at\": \"timestamp RANGE(2023-01-01 00:00:00,2024-12-24 22:12:00)\",\n      \"updated_at\": \"timestamp RANGE(2023-01-01 00:00:00,2024-12-24 22:12:00)\"\n    },\n    \"chats\": {\n      \"chat_id\": \"PK UUID\",\n      \"name\": \"first_name\",\n      \"created_by\": \"first_name\",\n      \"deleted_by\": \"first_name\",\n      \"last_message\": \"first_name\",\n      \"tags\": \"first_name\",\n      \"created_at\": \"timestamp RANGE(2023-01-01 00:00:00,2024-12-24 22:12:00)\",\n      \"updated_at\": \"timestamp RANGE(2023-01-01 00:00:00,2024-12-24 22:12:00)\"\n    },\n    \"IntermediaryTable: user_chats\":{\n      \"chat_id\": \"FK_UUID chats.chat_id\",\n      \"user_id\": \"FK_UUID app_users.user_id\"\n    },\n    \"user_profiles\": {\n      \"profile_id\": \"PK UUID\",\n      \"user_id\": \"FK_UUID app_users.user_id\",\n      \"resume_path\": \"first_name\",\n      \"profile_picture_path\": \"first_name\",\n      \"updated_at\": \"timestamp RANGE(2023-01-01 00:00:00,2024-12-24 22:12:00)\"\n    },\n    \"user_settings\": {\n      \"settings_id\": \"PK UUID\",\n      \"user_id\": \"FK_UUID app_users.user_id\",\n      \"offers_notification\": \"bool\",\n      \"newsletter_notification\": \"bool\",\n      \"recruiter_messages\": \"bool\",\n      \"push_notification\": \"bool\",\n      \"updated_at\": \"timestamp RANGE(2023-01-01 00:00:00,2024-12-24 22:12:00)\"\n    }\n  },\n  \"json_schemas\": [\n    {\n      \"json1\": {\n        \"fields\": [\n          {\n            \"skills\": {\n               \"type\": \"array\",\n               \"item_count\": \"RANGE(1, 5)\",\n               \"content\": {\n                  \"type\": \"object\",\n                  \"fields\": {\n                    \"name\": {\n                      \"type\": \"string\",\n                      \"options\": [\"Python\", \"JavaScript\", \"Java\", \"C++\", \"Go\", \"Ruby\"]\n                    },\n                    \"level\": {\n                      \"type\": \"integer\",\n                      \"range\": [1, 5]\n                    }\n                  }\n               }\n            }\n          }\n        ]\n      }\n    }\n  ],\n  \"objects_count\": {\n    \"app_users\": 200,\n    \"skills\": 500,\n    \"chat_messages\": 8000,\n    \"job\": 250,\n    \"experiences\": 100,\n    \"educations\": 200,\n    \"company\": 20,\n    \"chats\": 50,\n    \"user_profiles\": 500,\n    \"user_settings\": 500,\n    \"user_chats\": 10000\n  }\n}\n```\n\n### Allowed column keywords:\n\nTODO\n\n#### Disclaimer:\nThe program only checks for uniqueness and integrity withing itself, there can still be error if there's already existing data in the database.\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Simple package for creating mockdata for a live database, according to specified relational schema.",
    "version": "0.4.4",
    "project_urls": {
        "Issues": "https://github.com/Experrior/db-mockdata/issues",
        "Repository": "https://github.com/Experrior/db-mockdata.git"
    },
    "split_keywords": [
        "mock",
        " database",
        " faker"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "de5d849de5f04d91fd281df3b3b620f6afd1c3d1ad96d0d0694ab4d4fe1b94b9",
                "md5": "64307cb6e5522577c8a0e1ea0be81f40",
                "sha256": "0d9a3ae696bf8e05b9ad09af9054feb000d4e0fdafc187c1ec26a6ececd874fb"
            },
            "downloads": -1,
            "filename": "db_mockdata-0.4.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "64307cb6e5522577c8a0e1ea0be81f40",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 8662,
            "upload_time": "2024-11-21T11:33:09",
            "upload_time_iso_8601": "2024-11-21T11:33:09.387251Z",
            "url": "https://files.pythonhosted.org/packages/de/5d/849de5f04d91fd281df3b3b620f6afd1c3d1ad96d0d0694ab4d4fe1b94b9/db_mockdata-0.4.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3292ba9ee92894fac2b9ad8bfc4b02c8e5022e7484c3c512e7bbdea33ee310b5",
                "md5": "8362a759bd0809fe32a3457fe69a37d5",
                "sha256": "f3aa7204aea9d5842a808adeaf0c64e29a05a373b6369d1355e7a740a3019ba9"
            },
            "downloads": -1,
            "filename": "db_mockdata-0.4.4.tar.gz",
            "has_sig": false,
            "md5_digest": "8362a759bd0809fe32a3457fe69a37d5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 9974,
            "upload_time": "2024-11-21T11:33:10",
            "upload_time_iso_8601": "2024-11-21T11:33:10.660963Z",
            "url": "https://files.pythonhosted.org/packages/32/92/ba9ee92894fac2b9ad8bfc4b02c8e5022e7484c3c512e7bbdea33ee310b5/db_mockdata-0.4.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-21 11:33:10",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Experrior",
    "github_project": "db-mockdata",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "db-mockdata"
}
        
Elapsed time: 4.39580s