This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

# Binder - A Python SQL Mapper.

Binder is a lightweight SQL mapper for Python that lets you perform SQL operations using native Python data types and methods:

>>> conn.select(Trades, AND(Trades.q.symbol=='RHAT', Trades.q.trans=='BUY'))
[{'date': datetime.date(2006, 1, 5), 'symbol': u'RHAT', 'trans': u'BUY', 'price'
: 35.0, 'qty': 100}]

A database row is mapped to a Python dictionary containing native Python data types. Binder gives you control of what SQL query is executed, while taking care of query generation, parameter passing and data conversion.

Currently, Binder supports the SQLite (via Python’s built-in sqlite3 module), PostgreSQL (via psycopg2) and MySQL (via the MySQLdb python module).

See manual.txt for full documentation.

## Installing

Install using pip:

pip install binder

Install from source:

python setup.py install

## Quick Tour

Define the schema for a table:

>>> from binder import *
>>> Trades = Table("trades",
...     DateCol("date"), UnicodeCol("trans", 4), UnicodeCol("symbol", 4),
...     IntCol("qty"), FloatCol("price")
... )

Creating a new database using SQLite and create the table we defined above:

>>> conn = SqliteConnection("readme.db3")
>>> conn.create_table(Trades)

Insert a row using a regular Python dictionary:

>>> from datetime import date
>>> row = {
...     "date":date(2006, 1, 5), "trans":"BUY", "symbol":"RHAT",
...     "qty":100, "price":35
... }
>>> conn.insert(Trades, row)
>>> conn.commit()

Finally, retrieve the data:

>>> conn.select(Trades)
[{'date': datetime.date(2006, 1, 5), 'symbol': u'RHAT', 'trans': u'BUY', 'price'
: 35.0, 'qty': 100}]
Release History

Release History

0.6

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.5

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
binder-0.6.tar.gz (8.3 kB) Copy SHA256 Checksum SHA256 Source Jan 22, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development 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