Metadata-Version: 2.4
Name: serp-csv
Version: 0.2.0
Summary: Serpentine CSV reader/writer with RFC 4180 quoting, written in the Serpentine subset
Author: Serpentine contributors
License: MIT
Project-URL: Homepage, https://github.com/avijitbhuin21/Serpentine
Keywords: serpentine,csv
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: serpentine-shim

# serp-csv

CSV reader/writer written in the Serpentine subset, following RFC 4180.

## API

- `parse(text) -> list[list[str]]` — handles quoted fields, embedded commas,
  doubled-quote escapes, newlines inside quotes, LF / CRLF records; raises
  `ValueError` on an unterminated quote.
- `parse_line(line) -> list[str]` — first record only.
- `format_field(s)` / `needs_quoting(s)` — QUOTE_MINIMAL-style quoting.
- `format_row(list[str]) -> str` — one record, no terminator.
- `format_rows(list[list[str]]) -> str` — CRLF-terminated records (matches
  CPython csv's default lineterminator).

## Install

```
serp add serp-csv
pip install serp-csv
```
