postseed (Python)
Realistic Postgres seed data. In seconds. Postseed generates seed data that respects your foreign keys, enums and uniqueness, never leaves your machine, and is deterministic: the same schema, seed and version give byte-identical output.
This package bundles the Postseed engine and runs it with Node.js 20 or newer (it must be on your PATH, or set POSTSEED_NODE). Nothing else to install.
pip install postseed
postseed # opens Studio, the local web app, on 127.0.0.1
Command line
postseed generate --schema schema.sql --rows 50 --seed 42 --out seed.sql
postseed insert --url "$DATABASE_URL" --dry-run # validate against your database, then roll back
postseed insert --url "$DATABASE_URL" --yes # really insert, in one transaction
See the documentation for every option.
From Python
import postseed
sql = postseed.generate(
"""
CREATE TABLE users (id serial PRIMARY KEY, email text UNIQUE NOT NULL);
CREATE TABLE posts (id serial PRIMARY KEY, user_id int NOT NULL REFERENCES users(id), title text);
""",
rows=25,
seed=42,
)
# `sql` is a transactional script: every post points at a real user, every email is unique.
generate(schema_sql, *, rows=50, seed=42, format="sql", tables=None, table_rows=None, null_ratio=None, now=None)
returns the text (format is "sql" or "json") and raises postseed.PostseedError with the engine's message
if it cannot. The same arguments always return the same text.
postseed.run(args, input=None) runs any CLI command and returns a subprocess.CompletedProcess.
Notes
- Python 3.8 or newer. The package is pure Python plus a bundled JavaScript engine, so there is one wheel for every platform.
- It is the same engine as the
postseednpm package and thepostseedgem, so output is identical across all three. - MIT licensed.
Metadata
Release files for postseed 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| postseed-0.1.0.tar.gz | 1.5 MB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| postseed-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 3.0 MB
Release files / postseed-0.1.0.tar.gz
| Download URL | postseed-0.1.0.tar.gz |
|---|---|
| Size | 1.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b271d8b871309685216ceb4e5496dbf5d1f2a4d6494323ef9075db84965a0d65
|
|
BLAKE2b-256 checksum How to use checksums |
f910c1f973793ca12c7a32f84fc1bee1996ee0211cf35e11bb8bbe9084b7a4d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / postseed-0.1.0-py3-none-any.whl
| Download URL | postseed-0.1.0-py3-none-any.whl |
|---|---|
| Size | 1.5 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0afb4715aa78adfe1fee8db9eb0f689e1ad233087a11d942be41d5ad4d303a61
|
|
BLAKE2b-256 checksum How to use checksums |
f728122fd98343fd8460e4750b10da7112632f5ee31f537a7eb99d2d1a0fb3ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Security for postseed 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.