The bit.io Developer Hub

Welcome to the bit.io developer hub. You'll find comprehensive guides and documentation to help you start working with bit.io as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Connecting via SQLAlchemy

bit.io works with https://www.sqlalchemy.org/ since it speaks standard postgres. To get started, install sqlalchemy and the associated postgres DBAPI package.

If you have postgres already installed locally, you can run the following:

pip install sqlalchemy, psycopg2

If you do not have postgresql installed locally, install psycopg2-binary instead so that you have the necessary dependencies to work with postgres.

pip install sqlalchemy, psycopg2-binary

If necessary, see https://docs.sqlalchemy.org/en/14/intro.html#installation-guide for more details on how to install sqlalchemy.

Once you have sqlalchemy installed, you can connect it to bit.io as though it is standard postgres. Because bit.io does not yet support transactions, you must use the AUTOCOMMIT transaction mode. For example,

from sqlalchemy import create_engine

## MAKE THIS IMPORTANT CHANGE TO USE AUTOCOMMIT TRANSACTIONS WITH BIT.IO
eng=create_engine('YOUR_POSTRES_CONNECT_STRING', isolation_level="AUTOCOMMIT")

# Work with sqlalchemy as you normally would
with eng.connect() as conn:
  result = conn.execute("SELECT 1")
  for row in result:
    print(result)

Updated 3 months ago


Connecting via SQLAlchemy


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.