Skip to main content

Interactive TUI database seeder

Project description

Copia logo

Copia

CI PyPI License Docs Ruff


Seed your database without the hassle.

Most frameworks either ship a seeder with questionable decisions, or don't ship one at all. Copia is a TUI-based database seeder with its own declarative language — you describe what data you want, column by column, and Copia generates and inserts it.

id:         uuid()
username:   username()
email:      email(safe=True)
role:       enum('admin', 'editor', 'viewer')
created_at: past_date()

Why Copia

You have this table:

CREATE TABLE users (
  id           CHAR(36)      NOT NULL PRIMARY KEY,
  username     VARCHAR(50)   NOT NULL UNIQUE,
  email        VARCHAR(255)  NOT NULL UNIQUE,
  password     VARCHAR(255)  NOT NULL,
  role         ENUM('admin', 'editor', 'viewer') NOT NULL,
  created_at   DATE          NOT NULL
);

Without copia, seeding it looks like this:

INSERT INTO users (id, username, email, password, role, created_at)
VALUES
  ('a1b2c3d4-...', 'john_doe',    'john@example.com',  '$2b$12$...', 'admin',  '2023-04-12'),
  ('e5f6g7h8-...', 'jane_smith',  'jane@example.com',  '$2b$12$...', 'editor', '2024-01-05'),
  ('i9j0k1l2-...', 'bob_99',      'bob@example.com',   '$2b$12$...', 'viewer', '2022-11-30'),
  ('m3n4o5p6-...', 'alice_w',     'alice@example.com', '$2b$12$...', 'admin',  '2023-08-19'),
  ('q7r8s9t0-...', 'charlie_k',   'charlie@example.com','$2b$12$...','editor', '2024-03-02');
  -- ... 55 more rows. good luck with that.

With copia:

id:          uuid()
username:    username()
email:       email(safe=True)
password:    password(length=16)
role:        enum('admin', 'editor', 'viewer')
created_at:  past_date()

Features

  • Simple language — if you know what a function call looks like, you know the Copia DSL
  • Realistic data — built on Faker, 25+ generators out of the box
  • Relational-awareref('table.column') samples from existing rows, so foreign keys just work
  • Interactive TUI — write, preview, and insert without leaving your terminal

Installation

pip install copia-seed

Requires Python 3.13+. MySQL and MariaDB are supported.

Quickstart

copia init       # generate a config template
copia            # launch the TUI

Documentation

the official copia documentation is available here


License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

copia_seed-0.2.1.tar.gz (618.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

copia_seed-0.2.1-py3-none-any.whl (41.9 kB view details)

Uploaded Python 3

File details

Details for the file copia_seed-0.2.1.tar.gz.

File metadata

  • Download URL: copia_seed-0.2.1.tar.gz
  • Upload date:
  • Size: 618.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for copia_seed-0.2.1.tar.gz
Algorithm Hash digest
SHA256 127b560ffb88f5834f568295bbae81822eb6b3e07d600f0138d8a641199afdc6
MD5 d9f44e4c961ebbdac48a82fddd5f7e68
BLAKE2b-256 a4f0cca8e921732d8a885167147036b2e5aed6c61cbe17d44d97f752cff1344e

See more details on using hashes here.

Provenance

The following attestation bundles were made for copia_seed-0.2.1.tar.gz:

Publisher: release.yml on gitmobkab/copia

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file copia_seed-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: copia_seed-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 41.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for copia_seed-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cdb5c0eef97c72ca1a103f809f134365f582fd445dc9415602bf569e98542ad3
MD5 52e732f9a12baeeebbdf3104ca19d8ff
BLAKE2b-256 f06270ea2e8b723b89e9d24f354df1b2aa94b066a3c1396b7e20cff420fd07d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for copia_seed-0.2.1-py3-none-any.whl:

Publisher: release.yml on gitmobkab/copia

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page