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
Mason
====

.. image:: https://travis-ci.org/vail130/mason.svg?branch=master

Mason is a nice, light-weight, SQL query builder. It lets you use objects instead of SQL strings without
having an ORM take over your database model.

Example
-------
.. code-block:: python

# Annoying :/
query = """
SELECT purchases.id,
purchases.product_name,
(purchases.product_price)::NUMERIC(10, 2),
(purchases.datetime_purchased)::DATE
FROM purchases
INNER JOIN users ON purchases.purchaser_id = users.user_id
WHERE purchases.datetime_purchased BETWEEN %(start)s AND %(end)s
AND (purchases.purchaser_id = %(user_id)s OR purchases.purchaser_id IS NULL)
ORDER BY purchases.datetime_purchased ASC
LIMIT 10
OFFSET 10
"""

# Convenient :)
from mason import Table, Param, SELECT, AND, OR, DATE, NUMERIC

purchases = Table('purchases')
users = Table('users')
user_id = Param('user_id')
start = Param('start')
end = Param('end')

query = str(
SELECT(purchases.id, purchases.product_name,
NUMERIC(purchases.product_price, 10, 2),
DATE(purchases.datetime_purchased))
.FROM(purchases)
.INNER_JOIN(users.ON(purchases.purchaser_id == users.user_id))
.WHERE(AND(purchases.datetime_purchased.BETWEEN(start).AND(end),
OR(purchases.purchaser_id == user_id,
purchases.purchaser_id.IS_NULL)))
.ORDER_BY(purchases.datetime_purchased.ASC)
.LIMIT(10)
.OFFSET(10)
)

Install
-------
.. code-block:: sh

pip install mason

Develop
-------
.. code-block:: sh

cd path/to/repos
git clone git@github.com:vail130/mason.git
cd mason
mkvirtualenv mason
pip install -r requirements.txt
make test
Release History

Release History

0.1.0

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

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
mason-0.1.0.tar.gz (7.0 kB) Copy SHA256 Checksum SHA256 Source Feb 8, 2016

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