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


Download files

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

Source Distribution

csvorm-0.1.5.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

csvorm-0.1.5-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: csvorm-0.1.5.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for csvorm-0.1.5.tar.gz
Algorithm Hash digest
SHA256 13c5cbb416f0f8356c10c9a2227d62b5bc37769ae7d8347bdb0a7cb53e2b05ec
MD5 25e9828e64d784c39cc2ae5014a71e0c
BLAKE2b-256 8ee7d304e96bf0004e67aeaf29fa6bfae0df4bdbc6160fa0a034c39488e34617

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csvorm-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 31d36be2ec31c493dc77220768a6ec4949a641298be5f1da031258bf19c753ac
MD5 f1f36c44c8ad44a4984fb3075f97c909
BLAKE2b-256 2c6c7606d8a37db703dfc4ee5fc63d284c59838277e26559f98be4c63bdef36d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page