# MamaDuck
**MamaDuck** is a command-line tool designed to facilitate the migration and synchronization of data between DuckDB and other databases like PostgreSQL, SQLite, and CSV. It provides an efficient way to load, export, and transfer data.
---
![Demo](demo.svg)
**Update:** The command is `kwak` instead of `--kwak`.
---
## Installation
To install **MamaDuck**, use the following `pip` command:
```bash
pip install mamaduck
```
This command will install the latest version of the tool and its dependencies.
---
## Interactive Mode
**MamaDuck** provides an interactive mode to work with migrations directly from the command line. This mode can be triggered by adding the `--cli` flag to any migration tool command.
For example, to run the `load_csv` command in interactive mode, use:
```bash
mamaduck kwak load_csv --cli
```
In interactive mode, you can interact with the database and execute migration tasks more interactively.
---
## Usage
**MamaDuck** follows this general syntax:
```bash
mamaduck kwak <tool> [options]
```
Where `<tool>` is one of the following migration tools:
- `load_csv`: Load data from a CSV file into DuckDB.
- `load_psql`: Load data from PostgreSQL into DuckDB.
- `load_sqlite`: Load data from an SQLite database into DuckDB.
- `to_csv`: Export DuckDB tables to CSV.
- `to_psql`: Transfer data from DuckDB to PostgreSQL.
- `to_sqlite`: Transfer data from DuckDB to SQLite.
---
## Available Commands and Arguments
Each command (tool) has its own set of arguments. Below are the arguments for each command.
### 1. `load_csv`: Load Data from CSV into DuckDB
```bash
mamaduck kwak load_csv --csv <CSV_FILE_PATH> --db <DUCKDB_DB_PATH> --table <TABLE_NAME>
```
Arguments:
- `--db`: Path to DuckDB DB file (leave blank for in-memory).
- `--csv`: Path to the CSV file to load into DuckDB.
- `--table`: DuckDB table name to create.
- `--schema`: Schema name (optional).
- `--cli`: Launch interactive shell mode.
---
### 2. `load_psql`: Load Data from PostgreSQL into DuckDB
```bash
mamaduck kwak load_psql --psql_conn_string <PSQL_CONNECTION_STRING> --db <DUCKDB_DB_PATH> --schema <SCHEMA_NAME>
```
Arguments:
- `--db`: Path to DuckDB DB file (leave blank for in-memory).
- `--psql_conn_string`: PostgreSQL connection string.
- `--schema`: Schema name to use for migration (optional).
- `--tables`: Comma-separated list of table names to migrate (default: all tables).
- `--cli`: Launch interactive shell mode.
---
### 3. `load_sqlite`: Load Data from SQLite into DuckDB
```bash
mamaduck kwak load_sqlite --sqlite <SQLITE_DB_PATH> --db <DUCKDB_DB_PATH> --tables <TABLE_NAMES>
```
Arguments:
- `--db`: Path to DuckDB DB file (leave blank for in-memory).
- `--sqlite`: Path to the SQLite database file.
- `--schema`: Schema name to use for migration (optional).
- `--tables`: Comma-separated list of table names to migrate (default: all tables).
- `--cli`: Launch interactive shell mode.
---
### 4. `to_csv`: Export Data from DuckDB to CSV
```bash
mamaduck kwak to_csv --db <DUCKDB_DB_PATH> --table <TABLE_NAME> --output <CSV_FILE_PATH>
```
Arguments:
- `--db`: Path to DuckDB DB file (leave blank for in-memory).
- `--table`: Table name to export.
- `--schema`: Optional schema for the table.
- `--output`: Output CSV file path.
- `--cli`: Run in interactive mode.
---
### 5. `to_psql`: Transfer Data from DuckDB to PostgreSQL
```bash
mamaduck kwak to_psql --db <DUCKDB_DB_PATH> --psql <PSQL_CONNECTION_STRING> --table <TABLE_NAME>
```
Arguments:
- `--cli`: Launch interactive mode.
- `--db`: Path to DuckDB DB file (leave blank for in-memory).
- `--psql`: PostgreSQL connection string.
- `--table`: Name of the source table in DuckDB.
- `--output`: Name of the target table in PostgreSQL.
---
### 6. `to_sqlite`: Transfer Data from DuckDB to SQLite
```bash
mamaduck kwak to_sqlite --db <DUCKDB_DB_PATH> --sqlite <SQLITE_DB_PATH> --table <TABLE_NAME> --newtable <NEW_TABLE_NAME>
```
Arguments:
- `--cli`: Start interactive mode.
- `--db`: Path to DuckDB DB file (leave blank for in-memory).
- `--sqlite`: SQLite database path.
- `--table`: Source table in DuckDB.
- `--newtable`: New table in SQLite.
---
## License
This project is licensed under the MIT License. See the LICENSE file for more information.
Raw data
{
"_id": null,
"home_page": "https://github.com/thelaycon/mamaduck",
"name": "mamaduck",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": null,
"keywords": "data warehouse, ETL, DuckDB, SQLite, CSV, Postgresql",
"author": "balogun",
"author_email": "tobitobitobiwhy@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/d4/79/8d5f8826f7615b405e7e448066e3d0a1732272092bd733cc5f023c19b26a/mamaduck-1.0.2.tar.gz",
"platform": null,
"description": "# MamaDuck\n\n**MamaDuck** is a command-line tool designed to facilitate the migration and synchronization of data between DuckDB and other databases like PostgreSQL, SQLite, and CSV. It provides an efficient way to load, export, and transfer data.\n\n---\n![Demo](demo.svg)\n\n**Update:** The command is `kwak` instead of `--kwak`.\n---\n## Installation\n\nTo install **MamaDuck**, use the following `pip` command:\n\n```bash\npip install mamaduck\n```\n\nThis command will install the latest version of the tool and its dependencies.\n\n---\n\n## Interactive Mode\n\n**MamaDuck** provides an interactive mode to work with migrations directly from the command line. This mode can be triggered by adding the `--cli` flag to any migration tool command.\n\nFor example, to run the `load_csv` command in interactive mode, use:\n\n```bash\nmamaduck kwak load_csv --cli\n```\n\nIn interactive mode, you can interact with the database and execute migration tasks more interactively.\n\n---\n\n## Usage\n\n**MamaDuck** follows this general syntax:\n\n```bash\nmamaduck kwak <tool> [options]\n```\n\nWhere `<tool>` is one of the following migration tools:\n\n- `load_csv`: Load data from a CSV file into DuckDB.\n- `load_psql`: Load data from PostgreSQL into DuckDB.\n- `load_sqlite`: Load data from an SQLite database into DuckDB.\n- `to_csv`: Export DuckDB tables to CSV.\n- `to_psql`: Transfer data from DuckDB to PostgreSQL.\n- `to_sqlite`: Transfer data from DuckDB to SQLite.\n\n---\n\n## Available Commands and Arguments\n\nEach command (tool) has its own set of arguments. Below are the arguments for each command.\n\n### 1. `load_csv`: Load Data from CSV into DuckDB\n\n```bash\nmamaduck kwak load_csv --csv <CSV_FILE_PATH> --db <DUCKDB_DB_PATH> --table <TABLE_NAME>\n```\n\nArguments:\n- `--db`: Path to DuckDB DB file (leave blank for in-memory).\n- `--csv`: Path to the CSV file to load into DuckDB.\n- `--table`: DuckDB table name to create.\n- `--schema`: Schema name (optional).\n- `--cli`: Launch interactive shell mode.\n\n---\n\n### 2. `load_psql`: Load Data from PostgreSQL into DuckDB\n\n```bash\nmamaduck kwak load_psql --psql_conn_string <PSQL_CONNECTION_STRING> --db <DUCKDB_DB_PATH> --schema <SCHEMA_NAME>\n```\n\nArguments:\n- `--db`: Path to DuckDB DB file (leave blank for in-memory).\n- `--psql_conn_string`: PostgreSQL connection string.\n- `--schema`: Schema name to use for migration (optional).\n- `--tables`: Comma-separated list of table names to migrate (default: all tables).\n- `--cli`: Launch interactive shell mode.\n\n---\n\n### 3. `load_sqlite`: Load Data from SQLite into DuckDB\n\n```bash\nmamaduck kwak load_sqlite --sqlite <SQLITE_DB_PATH> --db <DUCKDB_DB_PATH> --tables <TABLE_NAMES>\n```\n\nArguments:\n- `--db`: Path to DuckDB DB file (leave blank for in-memory).\n- `--sqlite`: Path to the SQLite database file.\n- `--schema`: Schema name to use for migration (optional).\n- `--tables`: Comma-separated list of table names to migrate (default: all tables).\n- `--cli`: Launch interactive shell mode.\n\n---\n\n### 4. `to_csv`: Export Data from DuckDB to CSV\n\n```bash\nmamaduck kwak to_csv --db <DUCKDB_DB_PATH> --table <TABLE_NAME> --output <CSV_FILE_PATH>\n```\n\nArguments:\n- `--db`: Path to DuckDB DB file (leave blank for in-memory).\n- `--table`: Table name to export.\n- `--schema`: Optional schema for the table.\n- `--output`: Output CSV file path.\n- `--cli`: Run in interactive mode.\n\n---\n\n### 5. `to_psql`: Transfer Data from DuckDB to PostgreSQL\n\n```bash\nmamaduck kwak to_psql --db <DUCKDB_DB_PATH> --psql <PSQL_CONNECTION_STRING> --table <TABLE_NAME>\n```\n\nArguments:\n- `--cli`: Launch interactive mode.\n- `--db`: Path to DuckDB DB file (leave blank for in-memory).\n- `--psql`: PostgreSQL connection string.\n- `--table`: Name of the source table in DuckDB.\n- `--output`: Name of the target table in PostgreSQL.\n\n---\n\n### 6. `to_sqlite`: Transfer Data from DuckDB to SQLite\n\n```bash\nmamaduck kwak to_sqlite --db <DUCKDB_DB_PATH> --sqlite <SQLITE_DB_PATH> --table <TABLE_NAME> --newtable <NEW_TABLE_NAME>\n```\n\nArguments:\n- `--cli`: Start interactive mode.\n- `--db`: Path to DuckDB DB file (leave blank for in-memory).\n- `--sqlite`: SQLite database path.\n- `--table`: Source table in DuckDB.\n- `--newtable`: New table in SQLite.\n\n---\n\n## License\n\nThis project is licensed under the MIT License. See the LICENSE file for more information.",
"bugtrack_url": null,
"license": "MIT",
"summary": "A local data warehouse utility for managing and migrating data across DuckDB, Postgresql, SQLite, and CSV.",
"version": "1.0.2",
"project_urls": {
"Homepage": "https://github.com/thelaycon/mamaduck",
"Repository": "https://github.com/thelaycon/mamaduck"
},
"split_keywords": [
"data warehouse",
" etl",
" duckdb",
" sqlite",
" csv",
" postgresql"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5da1d1ff5985c2aace1f72c13e58a90f97c1937b73dc51c9f0659f37ba4793fe",
"md5": "74a3335d199093a43d528f7ff5adcc23",
"sha256": "7cb5f728f95b543326046b3424179fcb86b011b0a0bf5220744d278ef6491ed6"
},
"downloads": -1,
"filename": "mamaduck-1.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "74a3335d199093a43d528f7ff5adcc23",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 16631,
"upload_time": "2024-12-15T02:57:59",
"upload_time_iso_8601": "2024-12-15T02:57:59.210168Z",
"url": "https://files.pythonhosted.org/packages/5d/a1/d1ff5985c2aace1f72c13e58a90f97c1937b73dc51c9f0659f37ba4793fe/mamaduck-1.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d4798d5f8826f7615b405e7e448066e3d0a1732272092bd733cc5f023c19b26a",
"md5": "be7b540cbb94791097972db7e035e8d1",
"sha256": "03e18fd081cd753145a5f8111a7407176452dea515243e37d663f63831e7a772"
},
"downloads": -1,
"filename": "mamaduck-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "be7b540cbb94791097972db7e035e8d1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 22857,
"upload_time": "2024-12-15T02:58:02",
"upload_time_iso_8601": "2024-12-15T02:58:02.669948Z",
"url": "https://files.pythonhosted.org/packages/d4/79/8d5f8826f7615b405e7e448066e3d0a1732272092bd733cc5f023c19b26a/mamaduck-1.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-15 02:58:02",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "thelaycon",
"github_project": "mamaduck",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "mamaduck"
}