Skip to main content

Convenience wrappers for the standard library csv module.

Project description

csvy

Basic context wrappers for stardard library csv.read and csv.write methods.

Writer Example

B

The writer returns a straight up csv.writer object:

import csvy

with csvy.writer('csvpath.csv') as csvfile:
    csvfile.writerow([1, 2, 3, 4])
Reader Example

The reader returns a proxy object that behaves a bit differently. You must call the iter method that yield an enumerator:

import csvy

with csvy.reader('csvpath.csv') as csvfile:
    for index, row in csvfile.iter():
        print(f"{index}: {row}")

If a header row is detected, the row object will be a namedtuple based on the values of the header line:

"""
src.csv:

A,B,C,column D
1,2,3,4
5,6,7,8

"""
import csvy

with csvy.reader('src.csv') as csvfile:
    for index, row in csvfile.iter():
        print(row.a)
        print(row.column_d)

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

csvy-0.1.5.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

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

csvy-0.1.5-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

Details for the file csvy-0.1.5.tar.gz.

File metadata

  • Download URL: csvy-0.1.5.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.2 CPython/3.7.5 Linux/4.15.0-88-generic

File hashes

Hashes for csvy-0.1.5.tar.gz
Algorithm Hash digest
SHA256 34c2cd1e87dbc2ffd343c5b0d61376af1cd6578efbc87f74d37bbe1f5800fb58
MD5 1edec84c409a4738f9741e1e3e5d4eb9
BLAKE2b-256 aa493d8c1ffef76527f41536097c3611875045416df281769bfe4eb6ba660d83

See more details on using hashes here.

File details

Details for the file csvy-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: csvy-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 2.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.2 CPython/3.7.5 Linux/4.15.0-88-generic

File hashes

Hashes for csvy-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7d297fd3c49ade4c3dff49c4506edab8d08a5b216a020b0b015604f74887ce09
MD5 dc1113cf19f9b67560b3f5e796959869
BLAKE2b-256 6fe9cd33a669b1d85067c4db8c91c7dfe64480fd85897ba9b34cb261ea559eb5

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