Skip to content

rwanyoike/csvblend-python-library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

csvblend: Python CSV Merge Library

Travis (.org) Codecov GitHub PyPI Code Style: black

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:

python -c 'import sqlite3; print(sqlite3.sqlite_version)'

Basic merge usage:

>>> 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 | Installation | Usage | Contributing | License

Features

  • SQLite (RDBMS) under the hood.
  • Affected row count (created or updated) -- show changes between CSVs.
  • No external dependencies.

csvblend officially supports Python 3.6+.

Installation

To install csvblend, simply run:

$ pip install -U csvblend
✨🖇✨

Usage

For documentation, see ./docs/README.md.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

This project is licensed under the MIT License.