seedbase 0.1.0__py3-none-any.whl
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/README.md +53 -0
- seedbase/__init__.py +20 -0
- seedbase/cli.py +1129 -0
- seedbase/core.py +903 -0
- seedbase/exporters.py +159 -0
- seedbase/parsers/__init__.py +48 -0
- seedbase/parsers/csv_parser.py +30 -0
- seedbase/parsers/db_connect_parser.py +65 -0
- seedbase/parsers/json_parser.py +47 -0
- seedbase/parsers/mysql_parser.py +134 -0
- seedbase/parsers/postgresql_parser.py +10 -0
- seedbase/pytest_plugin.py +151 -0
- seedbase/sdk.py +197 -0
- seedbase-0.1.0.dist-info/METADATA +79 -0
- seedbase-0.1.0.dist-info/RECORD +18 -0
- seedbase-0.1.0.dist-info/WHEEL +5 -0
- seedbase-0.1.0.dist-info/entry_points.txt +5 -0
- seedbase-0.1.0.dist-info/top_level.txt +1 -0
seedbase/README.md
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.
|
seedbase/__init__.py
ADDED
|
@@ -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
|
+
]
|