Skip to main content

Simple, light and little pip package to read, write and manage CSV files ('.csv') in Python.

Project description

littlecsv

PyPi Version License: MIT

littlecsv is a simple, lightweight pip package for reading, writing, and managing CSV (.csv) files in Python.

  • Entries are simply represented as dictionaries: {header_property → entry_value}
  • Provides only basic manipulation methods (add_col, remove_col, …) with fully explicit behaviors
  • Never assumes a column or cell type unless explicitly specified (all cells are str by default)
  • Strict on format: no redundant columns in the header, and each line must have the same number of elements

Why ?

I know it’s generally considered bad practice to avoid standard tools like pandas, however … The package could just as well be called nopandas.

Everyone uses pandas, yet few truly understand what it’s doing under the hood. This encourages a “just push the magic button” R-style workflow that I personally dislike (or maybe I just don’t like reading the docs…).

In contrast, here’s a pip package that almost no one uses (except me, sometimes) — but that anyone could understand. It’s a small, simple, and lightweight CSV/DataFrame manager that does no wild, hidden tricks — only clear, explicit manipulations.

Of course, it’s less optimized than pandas code, but in my experience, the memory or computational bottleneck rarely lies in basic data manipulation.

Installation and Usage

Install with pip:

pip install littlecsv

You can now preview a CSV file with the command line:

littlecsv_show ./data_sample.csv

Here is a very brief usage example. For more, have a look to ./usage_example.py.

from littlecsv import CSV
dataset = CSV.read("./data_sample.csv")
dataset.rename_col("sec_str", "secondary structure")
dataset.write("./data_sample_renamed.csv")

Requirements

  • Python 3.9 or later
  • Python packages numpy

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

littlecsv-1.0.1.tar.gz (9.7 kB view details)

Uploaded Source

File details

Details for the file littlecsv-1.0.1.tar.gz.

File metadata

  • Download URL: littlecsv-1.0.1.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.1

File hashes

Hashes for littlecsv-1.0.1.tar.gz
Algorithm Hash digest
SHA256 c0e5a922133a67f0a4524dcf49df1e0c871bd8ccb6b7cf867ce53ca185adabae
MD5 05d8d2c2343c7d857b53fbf932ec4f67
BLAKE2b-256 da8f0f1ea8854e7deb1eacfee7b8e4afc27ef51d69ae99d57a567f07ccd0ce6c

See more details on using hashes here.

Supported by

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