Skip to main content

CLI tool to batch update or insert data.

Project description

Heave

Heave is a CLI tool for batch inserting or updating data into a database.

Installation

It is recommended to install heave using uv:

uv tool install heave

Usage

heave [OPTIONS] COMMAND [ARGS]...

Create a connection to a PostgreSQL database.

Defaults to the postgres database on localhost with the postgres user. Pass alternate connection parameters as options. You can save yourself some typing by setting the environment variables PGDATABASE, PGHOST, PGPORT and/or PGUSER to appropriate values. It is also convenient to have a .pgpass file to avoid regularly having to type in passwords.

Options

-h, --host TEXT (default: localhost)

  • Host name of the database.

-p, --port INTEGER (default: 5432)

  • Port number at which the database is listening.

-U, --username TEXT

  • Username to connect as.

-d, --dbname TEXT (default: postgres)

  • Name of the database to connect to.

Examples

heave --host myhost --port 5433 --username myuser --dbname mydb

heave insert

heave insert --table TEXT <file>

Insert data from a file into a table.

Options

-t, --table TEXT

  • Name of the table to insert into. Required.

-oc, --on-conflict TEXT

  • How to handle insert conflicts. [nothing|update]

Examples

heave insert --table mytable data.csv

heave read

heave read --table TEXT <file>

Read data from an SQL table and write it to a file.

Options

-t, --table TEXT

  • Name of the table to read from. Required.

Examples

heave read --table mytable data.csv

Supported Formats

Currently, Heave only supports extracting data from CSV files and loading it into a PostgreSQL database.

Sources

Supported data sources include:

  • CSV files: .csv

Databases

Supported target databases include:

  • PostgreSQL

Examples

...

Contributing

Contributions are welcome! Pick an existing issue or create a new one. Then follow the steps in CONTRIBUTING.md to make your change.`

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

heave-0.4.0.tar.gz (55.1 kB view details)

Uploaded Source

Built Distribution

heave-0.4.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file heave-0.4.0.tar.gz.

File metadata

  • Download URL: heave-0.4.0.tar.gz
  • Upload date:
  • Size: 55.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for heave-0.4.0.tar.gz
Algorithm Hash digest
SHA256 7c0e4e964e1faee6686966288566548f6ae3fd5766efe1b52a97133cd2c2fa88
MD5 ce209593e0b9abe4c40ff5826d9964fd
BLAKE2b-256 9a315deed00019a4d5d9f50bd24a8ab16d197632e5a2fc166fe37478a012c623

See more details on using hashes here.

File details

Details for the file heave-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: heave-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for heave-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4ebc238244b1aa52235d80d061f268a08e0e1c82f87461f4457685de3fbef6f7
MD5 e7157e74f855a7ce0e68c4c90ea37193
BLAKE2b-256 d7d5198f0f2543b9a5eec6e26f565b415cb0ed7786a34deba645b32a61706ce6

See more details on using hashes here.

Supported by

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