csv-stringify
A Python package for converting data to CSV text format.
Installation
pip install csv-stringify
Usage
Basic Usage
from csv_stringify import stringify
output = stringify([
["1", "2", "3", "4"],
["a", "b", "c", "d"],
], header=False)
print(output) # "1,2,3,4\na,b,c,d\n"
More Examples
from csv_stringify import stringify
# Basic usage
data = [["1", "2", "3"], ["a", "b", "c"]]
csv_string = stringify(data, header=False)
print(csv_string) # "1,2,3\na,b,c\n"
# With headers
csv_string = stringify(data, columns=["A", "B", "C"])
print(csv_string) # "A,B,C\n1,2,3\na,b,c\n"
# From dictionaries
data = [{"name": "John", "age": 25}]
csv_string = stringify(data)
print(csv_string) # "name,age\nJohn,25\n"
API
stringify(data, **options)
Convert data to CSV string.
Parameters:
data: List of lists or list of dictionariescolumns: List of column names (optional)header: Include header row (default: True)delimiter: Field delimiter (default: ',')quote_char: Quote character (default: '"')quote_mode: Quoting mode (default: 'minimal')
Returns: CSV string
Requirements
- Python 3.7+
- No external dependencies
License
MIT
Release files for csv-stringify 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| csv_stringify-1.0.0.tar.gz | 4.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| csv_stringify-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size:10.0 kB
Release files / csv_stringify-1.0.0.tar.gz
| Download URL | csv_stringify-1.0.0.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
055d8530b41ddcd5c705553f50915ec5d8cce61a4a7487a6c21152bbe54db47d
|
|
BLAKE2b-256 checksum How to use checksums |
973ee3b1e9059e1cb8e249313e05b2bed52f9771bea84d27a1698e55fd39d2e3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.0
|
Release files / csv_stringify-1.0.0-py3-none-any.whl
| Download URL | csv_stringify-1.0.0-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
96d5d2d803aafd53d62305471f1447324c9aac29aa22a8dcd8fe0d7e3693e57d
|
|
BLAKE2b-256 checksum How to use checksums |
763c55e4180f5828447506d4d403ba4e3a63446556858406d886eaa75204b759
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.0
|