Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rwanyoike/csvblend-python-library
🖇 Join or merge multiple CSVs on a list of columns efficiently
https://github.com/rwanyoike/csvblend-python-library
csv python python-library sqlite3
Last synced: 11 days ago
JSON representation
🖇 Join or merge multiple CSVs on a list of columns efficiently
- Host: GitHub
- URL: https://github.com/rwanyoike/csvblend-python-library
- Owner: rwanyoike
- License: mit
- Created: 2020-01-19T19:17:12.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-10-07T18:54:33.000Z (3 months ago)
- Last Synced: 2024-12-11T15:43:49.237Z (about 1 month ago)
- Topics: csv, python, python-library, sqlite3
- Language: Python
- Homepage:
- Size: 28.3 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
- License: LICENSE
Awesome Lists containing this project
README
# csvblend: Python CSV Merge Library
[![GitHub Actions](https://img.shields.io/github/actions/workflow/status/rwanyoike/csvblend-python-library/python-package.yml?branch=main)
](https://github.com/rwanyoike/csvblend-python-library/actions/workflows/python-package.yml?query=branch%3Amain)
[![GitHub License](https://img.shields.io/github/license/rwanyoike/csvblend-python-library)
](LICENSE.txt)
[![PyPI - Version](https://img.shields.io/pypi/v/csvblend)
](https://pypi.org/project/csvblend)> Join or merge multiple CSVs.
csvblend is a Python library to merge multiple CSVs based on a list of columns efficiently.
NOTE: csvblend requires SQLite version 3.24.0 (2018-06-04) or better:
```shell
python -c 'import sqlite3; print(sqlite3.sqlite_version)'
```Basic merge usage:
```python
>>> from csvblend import MergeFiles
>>> columns = ["field1", "field2", "field3"]
>>> indexes = ["field1"]
>>> with MergeFiles(columns, indexes) as mf:
... with open("csvfile1") as fp:
... mf.merge(fp)
... with open("csvfile2") as fp:
... mf.merge(fp)
... with open("csvfile3") as fp:
... mf.merge(fp)
... for row in mf.rows():
... print(row)
```[Features](#features) | [Installation](#installation) | [Usage](#usage) | [Contributing](#contributing) | [License](#license)
## Features
- [SQLite](https://www.sqlite.org) (RDBMS) under the hood.
- Affected row count (created or updated) -- show changes between CSVs.
- No external dependencies.csvblend officially supports Python 3.8+.
## Installation
To install csvblend, simply run:
```shell
$ pip install -U csvblend
✨🖇✨
```## Usage
For documentation, see [`./docs/README.md`](./docs/README.md).