Skip to content

nsv-format/nsv-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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'])

Running Tests

cd tests
python -m unittest

Must cover

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

Features

  • Core parsing
  • table

About

NSV, Python implementation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages