seedbase 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- seedbase-0.1.0/PKG-INFO +79 -0
- seedbase-0.1.0/README.md +135 -0
- seedbase-0.1.0/pyproject.toml +49 -0
- seedbase-0.1.0/setup.cfg +4 -0
- seedbase-0.1.0/src/seedbase/README.md +53 -0
- seedbase-0.1.0/src/seedbase/__init__.py +20 -0
- seedbase-0.1.0/src/seedbase/cli.py +1129 -0
- seedbase-0.1.0/src/seedbase/core.py +903 -0
- seedbase-0.1.0/src/seedbase/exporters.py +159 -0
- seedbase-0.1.0/src/seedbase/parsers/__init__.py +48 -0
- seedbase-0.1.0/src/seedbase/parsers/csv_parser.py +30 -0
- seedbase-0.1.0/src/seedbase/parsers/db_connect_parser.py +65 -0
- seedbase-0.1.0/src/seedbase/parsers/json_parser.py +47 -0
- seedbase-0.1.0/src/seedbase/parsers/mysql_parser.py +134 -0
- seedbase-0.1.0/src/seedbase/parsers/postgresql_parser.py +10 -0
- seedbase-0.1.0/src/seedbase/pytest_plugin.py +151 -0
- seedbase-0.1.0/src/seedbase/sdk.py +197 -0
- seedbase-0.1.0/src/seedbase.egg-info/PKG-INFO +79 -0
- seedbase-0.1.0/src/seedbase.egg-info/SOURCES.txt +20 -0
- seedbase-0.1.0/src/seedbase.egg-info/dependency_links.txt +1 -0
- seedbase-0.1.0/src/seedbase.egg-info/entry_points.txt +5 -0
- seedbase-0.1.0/src/seedbase.egg-info/top_level.txt +1 -0
seedbase-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: seedbase
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Generate realistic test data for your databases. Schema-aware, relationship-preserving, privacy-safe.
|
|
5
|
+
Author-email: Seedbase <hello@seedba.se>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://seedba.se
|
|
8
|
+
Project-URL: Documentation, https://docs.seedba.se
|
|
9
|
+
Project-URL: Repository, https://github.com/seedbase/seedbase
|
|
10
|
+
Project-URL: Changelog, https://github.com/seedbase/seedbase/blob/main/CHANGELOG.md
|
|
11
|
+
Keywords: testing,test-data,database,synthetic-data,data-generation
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Topic :: Database
|
|
23
|
+
Classifier: Topic :: Software Development :: Testing
|
|
24
|
+
Requires-Python: >=3.10
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
|
|
27
|
+
# Seedbase
|
|
28
|
+
|
|
29
|
+
Generate realistic, relationship-preserving, privacy-safe test data for your databases — and pull it straight into your local or CI database.
|
|
30
|
+
|
|
31
|
+
Seedbase lives on [seedba.se](https://seedba.se): you model (or import) a schema there, generate datasets, and use this package to pull them into Postgres, MySQL, SQLite and more. Schema-aware, foreign-key-correct, reproducible by seed.
|
|
32
|
+
|
|
33
|
+
## Install
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
pip install seedbase
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Zero dependencies — pure Python (3.10+).
|
|
40
|
+
|
|
41
|
+
## CLI quickstart
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
seedbase login # opens the browser, stores a token
|
|
45
|
+
seedbase init # creates .seedbase.json (project + target DB)
|
|
46
|
+
seedbase generate --seed 42 # trigger a generation on the platform
|
|
47
|
+
seedbase pull all # write schema + data into your target DB
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The CLI is pull-oriented: schema and datasets live on the platform, you pull them into your database. Other commands: `projects`, `generations`, `pull schema|data`, `diff`, `export config`, `import config`.
|
|
51
|
+
|
|
52
|
+
## Python SDK
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
from seedbase import SeedbaseClient
|
|
56
|
+
|
|
57
|
+
client = SeedbaseClient(token="dr_sk_...") # or from ~/.seedbase/config.json
|
|
58
|
+
gen = client.generate(project_id, seed=42, wait=True)
|
|
59
|
+
data = client.download(gen["id"], fmt="sql")
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## pytest fixtures
|
|
63
|
+
|
|
64
|
+
Seedbase ships a pytest plugin, so a freshly seeded dataset is one fixture away:
|
|
65
|
+
|
|
66
|
+
```python
|
|
67
|
+
def test_orders(seeded_data):
|
|
68
|
+
assert seeded_data # deterministic test data pulled from the platform
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Configure via env (`SEEDBASE_TOKEN`, `SEEDBASE_PROJECT`, `SEEDBASE_SEED`) or `pytest.ini`.
|
|
72
|
+
|
|
73
|
+
## Links
|
|
74
|
+
|
|
75
|
+
- Website: https://seedba.se
|
|
76
|
+
- Docs: https://seedba.se/docs
|
|
77
|
+
- API keys: https://seedba.se/settings?tab=api-keys
|
|
78
|
+
|
|
79
|
+
MIT licensed.
|
seedbase-0.1.0/README.md
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# Seedbase (Concept v1.0 Implementation)
|
|
2
|
+
|
|
3
|
+
This workspace now contains a full-stack implementation of the updated `KONZEPT.md`:
|
|
4
|
+
|
|
5
|
+
- Engine: `src/seedbase/` and `backend/engine/`
|
|
6
|
+
- Backend: Django 5 + DRF (`backend/`)
|
|
7
|
+
- Frontend: React 18 + Vite + Tailwind + React Flow (`frontend/`)
|
|
8
|
+
- Deployment: Dockerfiles + `docker-compose.yml`
|
|
9
|
+
|
|
10
|
+
## Implemented Scope
|
|
11
|
+
|
|
12
|
+
- Multi-format import:
|
|
13
|
+
- CSV bundles
|
|
14
|
+
- JSON / JSONL
|
|
15
|
+
- SQL dump parsing (INSERT-based parser)
|
|
16
|
+
- DB connect endpoint scaffold (Team+ feature gate, placeholder implementation)
|
|
17
|
+
- Auto-detection:
|
|
18
|
+
- types, enums, sequences
|
|
19
|
+
- FK references via `_id` + value matching
|
|
20
|
+
- masked columns (`email`, `name`, `phone` patterns)
|
|
21
|
+
- Column modes:
|
|
22
|
+
- `fixed`, `enum`, `random`, `date_rebase`, `sequence`, `reference`, `derived`, `masked`
|
|
23
|
+
- Date rebase engine:
|
|
24
|
+
- delta-preserving temporal shift (`today` or explicit target date)
|
|
25
|
+
- Derived expressions:
|
|
26
|
+
- safe expression evaluator (whitelisted operators/functions)
|
|
27
|
+
- Export formats:
|
|
28
|
+
- PostgreSQL, MySQL, MariaDB, SQLite, MS SQL Server
|
|
29
|
+
- CSV (ZIP for multi-table)
|
|
30
|
+
- JSON, JSONL
|
|
31
|
+
- Backend modules:
|
|
32
|
+
- accounts/auth
|
|
33
|
+
- datasets (upload/inspect/graph/generate)
|
|
34
|
+
- generations (status + download)
|
|
35
|
+
- teams + memberships
|
|
36
|
+
- subscriptions + Mollie integration scaffold
|
|
37
|
+
- API key management + DRF API key authentication
|
|
38
|
+
- Frontend flows:
|
|
39
|
+
- landing page
|
|
40
|
+
- login/register
|
|
41
|
+
- dashboard
|
|
42
|
+
- upload & inspect
|
|
43
|
+
- visual FK editor (React Flow nodes/edges, mode editing)
|
|
44
|
+
- generate & download
|
|
45
|
+
- teams
|
|
46
|
+
- settings/subscription
|
|
47
|
+
- i18n:
|
|
48
|
+
- frontend `en` / `de`
|
|
49
|
+
- backend locale setup
|
|
50
|
+
|
|
51
|
+
## Repository Layout
|
|
52
|
+
|
|
53
|
+
```text
|
|
54
|
+
.
|
|
55
|
+
├── KONZEPT.md
|
|
56
|
+
├── pyproject.toml
|
|
57
|
+
├── src/seedbase/ # Engine package + CLI prototype
|
|
58
|
+
├── backend/ # Django/DRF app
|
|
59
|
+
├── frontend/ # React/Vite app
|
|
60
|
+
├── docker-compose.yml
|
|
61
|
+
└── examples/ # Sample input + config
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Quick Start (Engine CLI)
|
|
65
|
+
|
|
66
|
+
No installation required in restricted environments:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
cd /Users/marcelglaser/Arbeiten/seedbase
|
|
70
|
+
PYTHONPATH=src python3 -m seedbase.cli inspect \
|
|
71
|
+
--input examples/input \
|
|
72
|
+
--source-type csv \
|
|
73
|
+
--config examples/config.json
|
|
74
|
+
|
|
75
|
+
PYTHONPATH=src python3 -m seedbase.cli generate \
|
|
76
|
+
--input examples/input \
|
|
77
|
+
--source-type csv \
|
|
78
|
+
--output-dir output/live-run \
|
|
79
|
+
--format postgresql \
|
|
80
|
+
--rows 100 \
|
|
81
|
+
--rebase-to today \
|
|
82
|
+
--seed 42 \
|
|
83
|
+
--config examples/config.json
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Backend Setup
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
cd /Users/marcelglaser/Arbeiten/seedbase/backend
|
|
90
|
+
python3 -m venv .venv
|
|
91
|
+
source .venv/bin/activate
|
|
92
|
+
pip install -r requirements.txt
|
|
93
|
+
python manage.py migrate
|
|
94
|
+
python manage.py runserver
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
API base: `http://localhost:8000/api/v1`
|
|
98
|
+
|
|
99
|
+
Main endpoint groups:
|
|
100
|
+
- `/api/v1/auth/*`
|
|
101
|
+
- `/api/v1/datasets/*` + `/upload/`, `/inspect/`, `/graph/`, `/preview/`, `/generate/`
|
|
102
|
+
- `/api/v1/generations/{id}/` + `/download/`
|
|
103
|
+
- `/api/v1/api-keys/*`
|
|
104
|
+
- `/api/v1/teams/*`
|
|
105
|
+
- `/api/v1/subscription/*`
|
|
106
|
+
|
|
107
|
+
## Frontend Setup
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
cd /Users/marcelglaser/Arbeiten/seedbase/frontend
|
|
111
|
+
npm install
|
|
112
|
+
npm run dev
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Frontend URL: `http://localhost:5173`
|
|
116
|
+
|
|
117
|
+
## Docker Compose
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
cd /Users/marcelglaser/Arbeiten/seedbase
|
|
121
|
+
docker compose up -d --build
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Services:
|
|
125
|
+
- `app` (Django + gunicorn)
|
|
126
|
+
- `celery`
|
|
127
|
+
- `frontend` (Nginx static)
|
|
128
|
+
- `db` (PostgreSQL 16)
|
|
129
|
+
- `redis`
|
|
130
|
+
|
|
131
|
+
## Notes
|
|
132
|
+
|
|
133
|
+
- Mollie checkout is implemented with real API-path support plus fallback mode when no API key is configured.
|
|
134
|
+
- DB-connect import supports `sqlite://` and `postgresql://` connection strings.
|
|
135
|
+
- SQL dump parser currently targets common `INSERT INTO ... VALUES ...` patterns.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "seedbase"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Generate realistic test data for your databases. Schema-aware, relationship-preserving, privacy-safe."
|
|
9
|
+
readme = "src/seedbase/README.md"
|
|
10
|
+
license = {text = "MIT"}
|
|
11
|
+
requires-python = ">=3.10"
|
|
12
|
+
authors = [
|
|
13
|
+
{name = "Seedbase", email = "hello@seedba.se"},
|
|
14
|
+
]
|
|
15
|
+
keywords = ["testing", "test-data", "database", "synthetic-data", "data-generation"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Environment :: Console",
|
|
19
|
+
"Intended Audience :: Developers",
|
|
20
|
+
"License :: OSI Approved :: MIT License",
|
|
21
|
+
"Operating System :: OS Independent",
|
|
22
|
+
"Programming Language :: Python :: 3",
|
|
23
|
+
"Programming Language :: Python :: 3.10",
|
|
24
|
+
"Programming Language :: Python :: 3.11",
|
|
25
|
+
"Programming Language :: Python :: 3.12",
|
|
26
|
+
"Programming Language :: Python :: 3.13",
|
|
27
|
+
"Topic :: Database",
|
|
28
|
+
"Topic :: Software Development :: Testing",
|
|
29
|
+
]
|
|
30
|
+
dependencies = []
|
|
31
|
+
|
|
32
|
+
[project.urls]
|
|
33
|
+
Homepage = "https://seedba.se"
|
|
34
|
+
Documentation = "https://docs.seedba.se"
|
|
35
|
+
Repository = "https://github.com/seedbase/seedbase"
|
|
36
|
+
Changelog = "https://github.com/seedbase/seedbase/blob/main/CHANGELOG.md"
|
|
37
|
+
|
|
38
|
+
[project.scripts]
|
|
39
|
+
seedbase = "seedbase.cli:main"
|
|
40
|
+
|
|
41
|
+
[project.entry-points.pytest11]
|
|
42
|
+
seedbase = "seedbase.pytest_plugin"
|
|
43
|
+
|
|
44
|
+
[tool.setuptools]
|
|
45
|
+
package-dir = {"" = "src"}
|
|
46
|
+
|
|
47
|
+
[tool.setuptools.packages.find]
|
|
48
|
+
where = ["src"]
|
|
49
|
+
exclude = ["seedbase.tests*"]
|
seedbase-0.1.0/setup.cfg
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Seedbase
|
|
2
|
+
|
|
3
|
+
Generate realistic, relationship-preserving, privacy-safe test data for your databases — and pull it straight into your local or CI database.
|
|
4
|
+
|
|
5
|
+
Seedbase lives on [seedba.se](https://seedba.se): you model (or import) a schema there, generate datasets, and use this package to pull them into Postgres, MySQL, SQLite and more. Schema-aware, foreign-key-correct, reproducible by seed.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pip install seedbase
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Zero dependencies — pure Python (3.10+).
|
|
14
|
+
|
|
15
|
+
## CLI quickstart
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
seedbase login # opens the browser, stores a token
|
|
19
|
+
seedbase init # creates .seedbase.json (project + target DB)
|
|
20
|
+
seedbase generate --seed 42 # trigger a generation on the platform
|
|
21
|
+
seedbase pull all # write schema + data into your target DB
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The CLI is pull-oriented: schema and datasets live on the platform, you pull them into your database. Other commands: `projects`, `generations`, `pull schema|data`, `diff`, `export config`, `import config`.
|
|
25
|
+
|
|
26
|
+
## Python SDK
|
|
27
|
+
|
|
28
|
+
```python
|
|
29
|
+
from seedbase import SeedbaseClient
|
|
30
|
+
|
|
31
|
+
client = SeedbaseClient(token="dr_sk_...") # or from ~/.seedbase/config.json
|
|
32
|
+
gen = client.generate(project_id, seed=42, wait=True)
|
|
33
|
+
data = client.download(gen["id"], fmt="sql")
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## pytest fixtures
|
|
37
|
+
|
|
38
|
+
Seedbase ships a pytest plugin, so a freshly seeded dataset is one fixture away:
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
def test_orders(seeded_data):
|
|
42
|
+
assert seeded_data # deterministic test data pulled from the platform
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Configure via env (`SEEDBASE_TOKEN`, `SEEDBASE_PROJECT`, `SEEDBASE_SEED`) or `pytest.ini`.
|
|
46
|
+
|
|
47
|
+
## Links
|
|
48
|
+
|
|
49
|
+
- Website: https://seedba.se
|
|
50
|
+
- Docs: https://seedba.se/docs
|
|
51
|
+
- API keys: https://seedba.se/settings?tab=api-keys
|
|
52
|
+
|
|
53
|
+
MIT licensed.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"""Seedbase MVP prototype package."""
|
|
2
|
+
|
|
3
|
+
from .core import (
|
|
4
|
+
DatasetProfile,
|
|
5
|
+
GenerationPlan,
|
|
6
|
+
build_profile,
|
|
7
|
+
generate_dataset,
|
|
8
|
+
load_csv_tables,
|
|
9
|
+
)
|
|
10
|
+
from .sdk import SeedbaseClient, SeedbaseError
|
|
11
|
+
|
|
12
|
+
__all__ = [
|
|
13
|
+
"DatasetProfile",
|
|
14
|
+
"GenerationPlan",
|
|
15
|
+
"build_profile",
|
|
16
|
+
"generate_dataset",
|
|
17
|
+
"load_csv_tables",
|
|
18
|
+
"SeedbaseClient",
|
|
19
|
+
"SeedbaseError",
|
|
20
|
+
]
|