Skip to main content

Easy SQL in Python

Project description

A Python library for using SQL

Warning: very alpha

Inspired by the excellent [Yesql][1] library by Kris Jenkins. In my mother tongue, ano means yes.

Installation

` $ pip install anosql `

Usage

Given a queries.sql file:

`sql -- name: get-all-greetings -- Get all the greetings in the database SELECT * FROM greetings; `

We can issue SQL queries, like so:

`python import anosql conn = psycopg2.connect('...') queries = anosql.load_queries('queries.sql') queries = queries.get_all_greetings(conn) # => [(1, 'Hi')] `

License

BSD, short and sweet

[1]: https://github.com/krisajenkins/yesql/

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

anosql-0.0.1.tar.gz (1.9 kB view hashes)

Uploaded Source

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