Skip to main content

CSVCatalog

a simple cli tool for wrangling csv files and shoving them into a sqlite database. no more manual scripts, no more headaches

What's this? 🤔

tired of messing around with csvs and databases separately? me too. that's why i built catalog. it's a simple, no-nonsense tool that lets you:

  • import csv files into a sqlite database with an interactive wizard.
  • search your data with a powerful, flexible query syntax.
  • export your data back to csv whenever you need it.
  • manage your database with a set of easy-to-use commands.

Getting Started 🚀

  1. install
pip install csvcatalog
  1. open the interactive catalog

run csvcatalog without arguments to open the terminal ui. it shows a searchable table list with a small footer summary. click a table (or press enter) to open it in a new tab below the top bar. everything works with both the keyboard and the mouse:

csvcatalog

if the configured database does not exist yet, the ui asks for a path instead of failing. path inputs suggest existing directories and .db/.sqlite files: use ↓ to browse suggestions, or just type a new path to create it. the same happens when you change the database path in settings.

opened tables become code-editor style tabs with a close cross, so you can switch between several tables without losing search or sort state. the table editor supports paged loading, server-side search, sorting by clicking column headers, editing a full row, adding and deleting rows, and renaming or deleting columns from the edit modal. large cell values are loaded only when you open a row, while the list uses truncated previews. search lives in a modal, so the table list always gets the full screen. the selected-table actions (view, edit, delete, export) live in the overview footer; the table viewer footer has row/table actions and pagination.

the layout adapts to the terminal size: the table list fills all available space, summary counters live in a small footer at the end of the list, and every scrollable area has its own scrollbar.

key action
/ open search
s open settings
f manage saved filters
e edit the selected table
d delete the selected table
r refresh the catalog
Ctrl+W close the active table tab
Ctrl+C twice quit

shortcuts also work on a russian keyboard layout (s / ы, f / а, e / у, d / в, r / к, / or . for search). Ctrl+F, Ctrl+R and Ctrl+E work regardless of layout.

  1. run a command

the basic structure is csvcatalog COMMAND [ARGS]. for example, to see all commands:

csvcatalog --help

by default, the database is stored in a user-specific data directory. you can specify a custom database file with the dbfile command:

# Optional
csvcatalog settings dbfile /path/to/your/database.db

you can setup aes256 encryption for database file

# Optional
csvcatalog settings encryption true
  1. extract your csv data table
csvcatalog extract path/to/my/data.csv

Commands 🕹️

typer provides help for all commands. just run csvcatalog --help or csvcatalog <command> --help for more details.

  • extract <file.csv>: run an interactive wizard to import a csv file. you can map columns, select which ones to import, apply regex filters to include/exclude specific rows, and optionally keep only the first row for each unique combination of selected columns. the table's created date is taken from the source file's creation time.
  • search <value> [targets...]: search for a value across one or more tables and columns.
  • rows <table_name>: show a page of rows with optional search, column selection, sorting, and pagination.
    • --limit <n> / --page <n>: page size and page number.
    • --search <text> / --column <name>: search text in specific columns.
    • --sort <column> / --desc: sort the rows.
  • replace <table_name> <search> <replacement>: replace every case-insensitive match in the selected columns.
    • --column <name>: limit replacement to a column; repeat for multiple columns. omitted means all columns.
    • --yes: skip confirmation.
  • export [table_names...]: export one or more tables to csv files.
    • if one table is specified, runs a full interactive wizard.
    • if multiple tables are specified (or none, for all tables), runs a bulk export. you can choose to configure filters for specific tables.
  • delete <table_names...>: delete one or more tables from the database.
  • sql "<query>": execute a raw sql query on the database.
  • purge: delete all tables from the database.

Command Groups

these commands group related functionality.

tables

manage and view tables.

  • tables list: list all tables in the database.
    • --description <text>: filter by text in the description.
    • --rows <min_count>: filter by minimum row count.
    • --date <yyyy-mm-dd>: filter by tables created on or after a certain date.
    • --sort <name|rows|date>: sort the output.
  • tables edit [table_name]: interactively edit a table's metadata (name, description, or date). if table_name is omitted, a selector will be shown.

settings

manage application settings. running csvcatalog settings will show current settings.

  • settings dbfile <path>: set a custom path for the database file.
  • settings encryption <true|false>: enable or disable database encryption.

filters

manage saved reusable regex filters for extract and export. running csvcatalog filters will list all saved filters.

  • filters add <name> <regex>: create a new named filter.
  • filters remove [name]: remove a filter by name, or run interactively if no name is provided.

the mighty search command

the search command lets you specify exactly where to look for your data. a "target" can be a table, a specific column in a table, or a column across all tables.

search for a value in all tables (default behavior):

# looks for 'jane' everywhere
csvcatalog search "jane"

search for a value in specific tables:

# looks for 'jane' in the 'users' and 'customers' tables
csvcatalog search "jane" users customers

search for a value in a specific column of a specific table:

# looks for the email in the 'email' column of the 'users' table
csvcatalog search "jane.doe@example.com" users.email

search for a value in a specific column across all tables:

# finds any entry with a 'status' of 'active' in any table
csvcatalog search "active" "*.status"

combine any of these targets in one command:

# a totally valid and powerful query
csvcatalog search "jane" users.name products

inspecting rows

the rows command shows one page of a table and supports the same search and sorting options as the interactive table view:

# rows 51-100, searching only name and email, newest first
csvcatalog rows customers --limit 50 --page 2 --search "jane" --column name --column email --sort created --desc

replace

replace works like find-and-replace in an editor. matching is case-insensitive and happens only in the selected columns:

# replace every "Tokyo" with "Osaka" in the city column
csvcatalog replace customers "Tokyo" "Osaka" --column city

# skip the confirmation prompt
csvcatalog replace customers "Tokyo" "Osaka" --column city --yes

contributing are welcome 🤝

Metadata

Release files for csvcatalog 3.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for csvcatalog 3.1.0
File Size Uploaded Provenance Actions
csvcatalog-3.1.0.tar.gz 61.3 kB Without provenance Details for csvcatalog-3.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for csvcatalog 3.1.0
File Interpreter ABI Platform Actions
csvcatalog-3.1.0-py3-none-any.whl Python 3 none any Details for csvcatalog-3.1.0-py3-none-any.whl

Total release size: 131.5 kB

Release files / csvcatalog-3.1.0.tar.gz

Download URL csvcatalog-3.1.0.tar.gz
Size 61.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8b4a44a688e62f077f99d99c47cbfb8440be7577eb721d644db93bdd5fd17916
BLAKE2b-256 checksum
How to use checksums
24237aaec273be6a5d422d7d6062ccf4e749a375c8948c2fda47adc025ed311b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / csvcatalog-3.1.0-py3-none-any.whl

Download URL csvcatalog-3.1.0-py3-none-any.whl
Size 70.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b3415bd45b1be67c1433195b2f077ff3f647208afb0a1e9cc9048d550e8f0c60
BLAKE2b-256 checksum
How to use checksums
57202e71f1dc09a3a61acdb24b40ed4b3d7a1a9de38a7693ecb9378773b091cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for csvcatalog 3.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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page