Skip to main content

Firebird RDBMS bindings for python.

Project description

https://img.shields.io/pypi/v/firebirdsql.png https://img.shields.io/pypi/l/firebirdsql.png

firebirdsql package is a set of Firebird RDBMS (https://firebirdsql.org/) bindings for Python (Written in pure Python : no C compiler needed or fbclient library)

Sorry, it support Firebird 2.5+.

It works on Python 2.7 and 3.9+. But Python 2.7 is not suported following features.

  • TimeZone feature in Firebird 4.0+

  • asyncio API

Example

Python Database API Specification v2.0

https://peps.python.org/pep-0249/

import firebirdsql
conn = firebirdsql.connect(
    host='localhost',
    database='/foo/bar.fdb',
    port=3050,
    user='alice',
    password='secret'
)
cur = conn.cursor()
cur.execute("select * from baz")
for c in cur.fetchall():
    print(c)
conn.close()

asyncio

import asyncio
import firebirdsql

async def conn_example():
    conn = await firebirdsql.aio.connect(
        host='localhost',
        database='/foo/bar.fdb',
        port=3050,
        user='alice',
        password='secret'
    )
    cur = conn.cursor()
    await cur.execute("select * from baz")
    print(await cur.fetchall())
asyncio.run(conn_example())

Use pool

import asyncio
import firebirdsql

async def pool_example(loop):
    pool = await firebirdsql.aio.create_pool(
        host='localhost',
        database='/foo/bar.fdb',
        port=3050,
        user='alice',
        password='secret'
        loop=loop,
    )
    async with pool.acquire() as conn:
        async with conn.cursor() as cur:
            await cur.execute("select * from baz")
            print(await cur.fetchall())
    pool.close()
    await pool.wait_closed()

loop = asyncio.get_event_loop()
loop.run_until_complete(pool_example(loop))
loop.close()

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

firebirdsql-1.4.0.tar.gz (82.8 kB view details)

Uploaded Source

File details

Details for the file firebirdsql-1.4.0.tar.gz.

File metadata

  • Download URL: firebirdsql-1.4.0.tar.gz
  • Upload date:
  • Size: 82.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for firebirdsql-1.4.0.tar.gz
Algorithm Hash digest
SHA256 22365ca205f51e079625ece1596b79a7cf250c5a1ae46fe1f2ff5c6991fc4e63
MD5 3e34e86028f0c9740add6cbf5c0a85d9
BLAKE2b-256 d7830c9788136d7d724450c17817ed28912415a5bd35f528fd272602cb04579a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page