Skip to main content

Easy SQL in Python

Project description Documentation Status

A Python library for using SQL

Warning: very alpha

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


$ pip install anosql


Given a queries.sql file:

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

We can issue SQL queries, like so:

import anosql
import psycopg2
import sqlite3

# PostgreSQL
conn = psycopg2.connect('...')
queries = anosql.load_queries('postgres', 'queries.sql')

# Or, Sqlite3...
conn = sqlite3.connect('cool.db')
queries = anosql.load_queries('sqlite', 'queries.sql')

queries = queries.get_all_greetings(conn)
# => [(1, 'Hi')]

# => Get all the greetings in the database

# => SELECT * FROM greetings;

# => ['get_all_greetings']


$ pip install tox
$ tox


Postgresql and sqlite only at the moment


BSD, short and sweet

Project details

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
anosql-0.2.0.tar.gz (11.1 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page