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

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.show()
dataset.write("./data_sample_renamed.csv")

Why ?

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

However … Everyone uses pandas, yet few truly understand what it’s doing under the hood. Indeed, we often wonder "Did pandas just turn my integer ID columns into floats?" or "Did my empty strings just get converted to None or NaN?" or also "How does .groupby deal with missing values?". 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 IO.

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.3.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

littlecsv-1.0.3-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for littlecsv-1.0.3.tar.gz
Algorithm Hash digest
SHA256 e1e06790d8564e98735d017d9e2ef3e6656353b1698eed2e503af6d435b64c00
MD5 e974777900f86a7ff3f259157089175d
BLAKE2b-256 a4faedb9be182f8eb316738cbbd4ff3be40b3bb94837af47cd1ac4ea6d962532

See more details on using hashes here.

File details

Details for the file littlecsv-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: littlecsv-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.1

File hashes

Hashes for littlecsv-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d50c3adf80724d466274d5717a4844c84eb01e34db1518456c03a16111184011
MD5 27ec09b18b2c71346350faa2f0b59cc9
BLAKE2b-256 e84478cbaed39a6fe0b8815e1499c24ddd3cf05d0aa18b14c386ef9139a0effe

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