Skip to main content

orm for csv

Project description

csvorm - ORM for CSV

This allows to use the CSV as ORM.

https://circleci.com/gh/TakesxiSximada/csvorm.svg?style=svg

INSTALL

pip install csvorm

HOW TO USE IT

layout define:

from csvorm import (
    Model,
    Column,
    Integer,
    Unicode,
    DateTime,
    )

class TestCSV(Model):
    _encoding_ = 'cp932'
    id_ = Column(Integer)
    name = Column(Unicode)
    modified_at = Column(DateTime())

creating csv:

test_csv = TestCSV()

record = test_csv.create()
record.id_ = 1
record.name = u'first'
record.modified_at = datetime.datetime.now()

record = test_csv.create()
record.id_ = 2
record.name = u'second'
record.modified_at = datetime.datetime.now()

test_csv.dump('test.csv')

parse csv:

test_csv = TestCSV()
test_csv.load('test.csv')

export data:

id_,name,modified_at
1,first,2014-03-26-15-05-50
2,second,2014-03-26-15-05-50

Thanks for contributors

  • TakesxiSximada
  • kitsunde

Project details


Release history Release notifications

This version
History Node

0.1.5

History Node

0.1.4

History Node

0.1.3dev

History Node

0.1.2dev

History Node

0.1.1dev

History Node

0.1.0dev

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
csvorm-0.1.5-py3-none-any.whl (6.7 kB) Copy SHA256 hash SHA256 Wheel 3.4 Sep 13, 2015
csvorm-0.1.5.tar.gz (5.4 kB) Copy SHA256 hash SHA256 Source None Sep 13, 2015

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page