Skip to main content

Python library to work with SQL DB

Project description


Python facilities to easily work with SQL databases

Ok, I don't love work with SQL databases. But the world works with SQL, then...

During last years I wrote lot of function to work with MSSQL, MySQL, Oracle, SQLite...
This project represent my personal attempt to systematize experiences, code, and approaches in few useful classes.

Of course sqlalchemy is a sort of de facto standard in python/SQL approach, and my package will never be such mature... but in my opinion it is not so simple and not ever backward compatibility is guaranteed with pyodbc and other low level libraries.

At this moment master branch only implements MSSQL routines. MySQL and Oracle rootines will be added as soon as possible.


Install sqlantipathy is as easy as run pip install sqlantipathy.


A more accurate description of methods included in sqlantipathy will follow. By now, you can refers to file content:

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from sqlantipathy import MssqlAntipathy
import pandas as pd

if __name__ == '__main__':

    sql = MssqlAntipathy(


    database_list = sql.show_databases()

    mydb_tables = sql.show_tables()

    qry = """SELECT TOP 100 * FROM TABLENAME"""
    data = sql.retrieve("sql_input_db", qry)

    list_of_dict = sql.retrieve("sql_input_db", qry)
    df = pd.DataFrame(list_of_dict)


    # A lot of code after...

    sql.cursor.execute("""A SIMPLE QUERY""")
    raw_data = sql.cursor.fetchall()

Project details

Download files

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

Files for sqlantipathy, version 0.0.73
Filename, size File type Python version Upload date Hashes
Filename, size sqlantipathy-0.0.73.tar.gz (23.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page