Skip to main content

Python implementation of the NSV (Newline-Separated Values) format

Project description

NSV Python

Python implementation of the NSV (Newline-Separated Values) format.

Installation

From PyPI

pip install nsv

From Source

git clone https://github.com/namingbe/nsv-python.git
cd nsv-python
pip install -e .

Usage

Basic Reading and Writing

import nsv

# Reading NSV data
with open('input.nsv', 'r') as f:
    reader = nsv.load(f)
    for row in reader:
        print(row)

# Writing NSV data
with open('output.nsv', 'w') as f:
    writer = nsv.Writer(f)
    writer.write_row(['row1cell1', 'row1cell2', 'row1cell3'])
    writer.write_row(['row2cell1', 'row2cell2', 'row2cell3'])

Development

Running Tests

Important: Always run tests from the project root to test local code changes (not the installed package):

python -m unittest discover -s tests -p 'test*.py' -v

Alternatively, install in editable mode:

pip install -e .

Must cover

  • loads(s) vs load(StringIO(s)) parity
  • dumps(data) vs dump(data, StringIO()).getvalue() parity

Features

  • Core parsing
  • table

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

nsv-0.2.1.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

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

nsv-0.2.1-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file nsv-0.2.1.tar.gz.

File metadata

  • Download URL: nsv-0.2.1.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for nsv-0.2.1.tar.gz
Algorithm Hash digest
SHA256 c7ed8063650147fd9dce2d6b2918c49dcababa43599973b2f702f5a769b3b5ab
MD5 27d42b4089d842e7e29b42c3580d0a0a
BLAKE2b-256 a6e7432c14225228862d4ad1d1ba1a202a5e84ffddf3aaf89a251e18656e250d

See more details on using hashes here.

File details

Details for the file nsv-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: nsv-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for nsv-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b509284754a700a5fbc57c608ee3dd5378d597cb8b0469a8b387322feab1891d
MD5 96f192bd1c88a802771303208b149210
BLAKE2b-256 aa33aa3f6e94fe2766e32a9537528aa9abca581c2c331f0d6bf494eedf8d6683

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