Create, Read, Update, Delete, and Move Rows in a CSV File
Project description
csvplus
Create, Read, Update, Delete, and Move Rows in a CSV File
install
pip install csvplus
usage
import csvplus
filepath = "./folder/cars.csv"
# create csv with the given column names
csvplus.create(filepath, ["make","model","year"])
# append a new row to the end of the csv file
csvplus.add(filepath, { "make": "Kia", "model": "Soul", "year": 2023 })
# delete all rows matching the where conditions
csvplus.delete(filepath, where={ "make": "Tesla" })
# find all rows matching the where conditions
csvplus.read("countries.csv", where={ "year": 1776 })
[{ "name": "United States of Ameriac", "abbreviation": "USA", "year": 1776 }]
# move rows
move(filepath, from_row, to_row, debug_level=0, quoting=csv.QUOTE_ALL):
csvplus.move("example.csv", 0, 20) # move the first row to the 20th line
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
csvplus-0.0.2.tar.gz
(6.6 kB
view details)
File details
Details for the file csvplus-0.0.2.tar.gz.
File metadata
- Download URL: csvplus-0.0.2.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dedbfa4e7534ca492ba5fa51c90563dbd8509a842200a1176e5e99ed67ee3ed4
|
|
| MD5 |
6cd47cb10a89e38837275f4c155daaba
|
|
| BLAKE2b-256 |
8f007d72308c15d238b9d2f02d00041487b97c905bce649075f8c24561214450
|