Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

object-oriented data validation and entity encapsulation

Project Description

Tundras is a simple Python library that does object-oriented data validation and entity encapsulation. In its current state, its main focus is on tabular data.

EXAMPLE

You can try this with the airports.dat CSV file from openflights.com.

from __future__ import print_function
from tundras import Field, TableEntity, csv
from tundras.pycompat import text_type

class Airport(TableEntity):
  id = Field(int)
  name = Field(text_type)
  city = Field(text_type)
  country = Field(text_type)
  iata_ffa = Field(text_type)
  icao = Field(text_type)
  latitude = Field(float)
  longitude = Field(float)
  altitude = Field(float)
  timezone = Field(float)
  dst = Field(text_type)
  tz_olson = Field(text_type)

with open('airports.dat', 'rb') as fp:
  for row in csv.reader(fp, encoding='latin1'):
    airport = Airport(*row)
    print(airport.id)

REQUIREMENTS

Tundras is a vanilla Python library without any additional dependencies. It is developed with CPython 2.7 and 3.4 and will most likely run fine with other versions as well.

For installing tundras from the GitHub repository however, you will need pandoc installed to generate the README.rst.

CHANGELOG

v0.1.5

  • add Field.check_type(), Field(adapter) parameter
  • update Field.__repr__()
  • remove Field(**type_parameters) parameter
  • add TableEntity.__setitem__() and ~.__setattr__()
  • fix bug in TableEntity.__getitem__()
  • convert TableEntity.__metainit__() to TableEntity.__metanew__()
  • fix InlineMetaclass.__metanew__()

COPYRIGHT

Niklas Rosenstein 2016 – Licensed under the MIT license

Release History

Release History

This version
History Node

0.1.5

History Node

0.1.4

History Node

0.1.3

History Node

0.1.2

History Node

0.1.1

History Node

0.1.0

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
tundras-0.1.5.zip (16.9 kB) Copy SHA256 Checksum SHA256 Source May 5, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting