# Generated Data That Makes Sense (GDTMS)
A Python library for generating realistic, relational test data with referential integrity. GDTMS creates meaningful data for database testing, development, and prototyping by maintaining relationships between tables and generating contextually appropriate values.
## Features
- **Relational data generation** with foreign key relationships
- **Multiple data types** including names, emails, addresses, phone numbers, dates, and more
- **Composite data types** for complex field generation
- **Unique constraints** support to prevent duplicate values
- **Self-referencing tables** for hierarchical data structures
- **MySQL output format** with proper SQL syntax
- **Configurable record counts** per table
- **Null value support** with configurable probability
## Installation
```bash
pip install generated-data-that-makes-sense
```
## Quick Start
```python
from gdtms.entities.schema import Schema
from gdtms.entities.table import Table
from gdtms.entities.field import Field
from gdtms.data_types.autoincrement import Autoincrement
from gdtms.data_types.first_name import FirstName
from gdtms.data_types.last_name import LastName
from gdtms.data_types.email import Email
from gdtms.views.mysql import Mysql
# Create a schema
schema = Schema()
# Create a users table
users_table = Table(name="users", num_records_to_generate=10)
users_table.add_fields([
Field("id", Autoincrement()),
Field("first_name", FirstName()),
Field("last_name", LastName()),
Field("email", Email())
])
schema.add_table(users_table)
# Generate SQL output
view = Mysql()
sql_output = schema.dump(view)
print(sql_output)
```
## Supported Data Types
- `Autoincrement` - Auto-incrementing integers
- `FirstName` - Realistic first names
- `LastName` - Realistic last names
- `Email` - Valid email addresses
- `PhoneNumber` - Formatted phone numbers
- `Address` - Street addresses
- `City` - City names
- `ZipPostal` - ZIP/postal codes
- `Date` - Date values
- `Number` - Numeric ranges
- `Url` - Valid URLs
- `DomainName` - Domain names
- `Adjective` - Descriptive adjectives
- `Noun` - Common nouns
- `Verb` - Action verbs
- `HardcodedValue` - Fixed values
- `Reference` - Foreign key relationships
- `Composite` - Combinations of multiple data types
## Advanced Usage
### Creating Related Tables
```python
# Create parent table
countries = Table(name="countries", num_records_to_generate=5)
countries.add_fields([
Field("id", Autoincrement()),
Field("name", Noun())
])
# Create child table with foreign key
users = Table(name="users", num_records_to_generate=20)
users.add_fields([
Field("id", Autoincrement()),
Field("country_id", Reference(countries)),
Field("name", FirstName())
])
```
### Unique Constraints
```python
from gdtms.entities.unique_key import UniqueKey
username_field = Field("username", Email())
users_table.add_field(username_field)
users_table.add_unique_key(UniqueKey([username_field]))
```
### Composite Data Types
```python
from gdtms.data_types.composite import Composite
# Generate questions like "What red car do you drive?"
question_field = Field("question", Composite([
HardcodedValue("What"),
Adjective(),
Noun(),
Verb(),
HardcodedValue("?")
]))
```
## License
MIT License
Raw data
{
"_id": null,
"home_page": null,
"name": "generated-data-that-makes-sense",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "testing, generator, data, relational, database, mysql",
"author": null,
"author_email": "Dmitry Smolovich <dsmolovich@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/df/ff/4ee307ad337e93e5180da6eab08ad48882da8f841a54316ef338d40d3d0c/generated_data_that_makes_sense-1.0.0.tar.gz",
"platform": null,
"description": "# Generated Data That Makes Sense (GDTMS)\n\nA Python library for generating realistic, relational test data with referential integrity. GDTMS creates meaningful data for database testing, development, and prototyping by maintaining relationships between tables and generating contextually appropriate values.\n\n## Features\n\n- **Relational data generation** with foreign key relationships\n- **Multiple data types** including names, emails, addresses, phone numbers, dates, and more\n- **Composite data types** for complex field generation\n- **Unique constraints** support to prevent duplicate values\n- **Self-referencing tables** for hierarchical data structures\n- **MySQL output format** with proper SQL syntax\n- **Configurable record counts** per table\n- **Null value support** with configurable probability\n\n## Installation\n\n```bash\npip install generated-data-that-makes-sense\n```\n\n## Quick Start\n\n```python\nfrom gdtms.entities.schema import Schema\nfrom gdtms.entities.table import Table\nfrom gdtms.entities.field import Field\nfrom gdtms.data_types.autoincrement import Autoincrement\nfrom gdtms.data_types.first_name import FirstName\nfrom gdtms.data_types.last_name import LastName\nfrom gdtms.data_types.email import Email\nfrom gdtms.views.mysql import Mysql\n\n# Create a schema\nschema = Schema()\n\n# Create a users table\nusers_table = Table(name=\"users\", num_records_to_generate=10)\nusers_table.add_fields([\n Field(\"id\", Autoincrement()),\n Field(\"first_name\", FirstName()),\n Field(\"last_name\", LastName()),\n Field(\"email\", Email())\n])\n\nschema.add_table(users_table)\n\n# Generate SQL output\nview = Mysql()\nsql_output = schema.dump(view)\nprint(sql_output)\n```\n\n## Supported Data Types\n\n- `Autoincrement` - Auto-incrementing integers\n- `FirstName` - Realistic first names\n- `LastName` - Realistic last names \n- `Email` - Valid email addresses\n- `PhoneNumber` - Formatted phone numbers\n- `Address` - Street addresses\n- `City` - City names\n- `ZipPostal` - ZIP/postal codes\n- `Date` - Date values\n- `Number` - Numeric ranges\n- `Url` - Valid URLs\n- `DomainName` - Domain names\n- `Adjective` - Descriptive adjectives\n- `Noun` - Common nouns\n- `Verb` - Action verbs\n- `HardcodedValue` - Fixed values\n- `Reference` - Foreign key relationships\n- `Composite` - Combinations of multiple data types\n\n## Advanced Usage\n\n### Creating Related Tables\n\n```python\n# Create parent table\ncountries = Table(name=\"countries\", num_records_to_generate=5)\ncountries.add_fields([\n Field(\"id\", Autoincrement()),\n Field(\"name\", Noun())\n])\n\n# Create child table with foreign key\nusers = Table(name=\"users\", num_records_to_generate=20)\nusers.add_fields([\n Field(\"id\", Autoincrement()),\n Field(\"country_id\", Reference(countries)),\n Field(\"name\", FirstName())\n])\n```\n\n### Unique Constraints\n\n```python\nfrom gdtms.entities.unique_key import UniqueKey\n\nusername_field = Field(\"username\", Email())\nusers_table.add_field(username_field)\nusers_table.add_unique_key(UniqueKey([username_field]))\n```\n\n### Composite Data Types\n\n```python\nfrom gdtms.data_types.composite import Composite\n\n# Generate questions like \"What red car do you drive?\"\nquestion_field = Field(\"question\", Composite([\n HardcodedValue(\"What\"),\n Adjective(),\n Noun(),\n Verb(),\n HardcodedValue(\"?\")\n]))\n```\n\n## License\n\nMIT License\n",
"bugtrack_url": null,
"license": null,
"summary": "Relational data generator that creates meaningful test data with referential integrity",
"version": "1.0.0",
"project_urls": {
"Homepage": "https://github.com/dsmolovich/generated-data-that-makes-sense",
"Repository": "https://github.com/dsmolovich/generated-data-that-makes-sense"
},
"split_keywords": [
"testing",
" generator",
" data",
" relational",
" database",
" mysql"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "559037a7afbec1d2e8fcca4133e6ae0c662cd077567cb9160da07cb47c015f10",
"md5": "e6eb07630c18b88fb2db9e0ab918f1ae",
"sha256": "4cb81848b9a86039b3a360fb5ad0a56ffff19768c0c85e6691504eb63e223fe1"
},
"downloads": -1,
"filename": "generated_data_that_makes_sense-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e6eb07630c18b88fb2db9e0ab918f1ae",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 712780,
"upload_time": "2025-08-27T01:47:28",
"upload_time_iso_8601": "2025-08-27T01:47:28.340953Z",
"url": "https://files.pythonhosted.org/packages/55/90/37a7afbec1d2e8fcca4133e6ae0c662cd077567cb9160da07cb47c015f10/generated_data_that_makes_sense-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "dfff4ee307ad337e93e5180da6eab08ad48882da8f841a54316ef338d40d3d0c",
"md5": "20aaca43e26c437d36e6c6ae87b20383",
"sha256": "cfa8611b7ca3e0f9ecaa0a0da45691a0b72376a4ccb15c62e6b93ae3f3b1326c"
},
"downloads": -1,
"filename": "generated_data_that_makes_sense-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "20aaca43e26c437d36e6c6ae87b20383",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 696934,
"upload_time": "2025-08-27T01:47:42",
"upload_time_iso_8601": "2025-08-27T01:47:42.528824Z",
"url": "https://files.pythonhosted.org/packages/df/ff/4ee307ad337e93e5180da6eab08ad48882da8f841a54316ef338d40d3d0c/generated_data_that_makes_sense-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-27 01:47:42",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "dsmolovich",
"github_project": "generated-data-that-makes-sense",
"github_not_found": true,
"lcname": "generated-data-that-makes-sense"
}