InterBase RDBMS bindings for Python.
Project description
InterBase Driver for Python
A powerful, PEP-249-compliant Python driver for InterBase, supporting both 32-bit and 64-bit.
The InterBase Driver for Python is based on the FDB driver and provides access to the InterBase RDBMS using a robust and flexible Python interface. This package supports the Python Database API 2.0 standard (PEP-249) while offering extended access to the native InterBase API.
📚 InterBase Documentation
🔗 GitHub Source Code
✨ Features
- PEP-249 compliance
- Full Unicode and character set support
- Native API access
- Multiple independent transactions per connection
- Distributed transaction support
- Automatic conversion of textual data
- Prepared statement support
📦 Installation
Requires Python 3.x (32-bit or 64-bit version to match InterBase client).
Install via PyPI:
pip install interbase
Or install from the GitHub repository:
pip install git+https://github.com/Embarcadero/InterBasePython.git
# or via SSH:
pip install git+ssh://git@github.com/Embarcadero/InterBasePython.git
🧪 Setting Up a Test Database
cd test/files
isql -i create-test-db.sql
🔌 Sample Usage
Basic Connection
import interbase
con = interbase.connect(
host=IBTEST_HOST, # Hostname or IP address of the InterBase server
database=IBTEST_DB_PATH, # Path to the database file on the server
user=IBTEST_USER, # Username for authentication
password=IBTEST_PASSWORD, # Password for authentication
sql_dialect=IBTEST_SQL_DIALECT, # SQL dialect to use (usually 1 or 3)
ssl=IBTEST_SERVER_PUBLIC_FILE is not None, # Enable SSL if a public server key is provided
server_public_file=IBTEST_SERVER_PUBLIC_FILE # Path to the server's public SSL key file (if SSL is enabled)
)
Executing a Query
cur = con.cursor()
cur.execute("SELECT * FROM employees")
for row in cur:
print(row)
Using Parameters
cur.execute("INSERT INTO employees(name, age) VALUES (?, ?)", ("John Doe", 34))
con.commit()
Handling Transactions
Manual Transaction Control
transaction = con.main_transaction
transaction.begin()
cursor = transaction.cursor()
cursor.execute("INSERT INTO t (c1) VALUES (1)")
transaction.commit()
Using a Context Manager
import interbase
with interbase.TransactionContext(con) as tr:
cursor = tr.cursor()
cursor.execute("INSERT INTO t (c1) VALUES (1)")
# The transaction is automatically committed when the block ends.
🧰 More Examples
Explore the test folder in the GitHub Repository for full coverage of features, including:
- Working with BLOBs
- Using metadata APIs
- Working with stored procedures
- SSL support
- Error handling
🤝 Contributing
Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.
📜 License
This project is licensed under the Embarcadero license terms.
🔗 Stay up to date with the latest changes and enhancements to InterBase by following the official Embarcadero Blog.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file interbase-1.0.1-py3-none-any.whl.
File metadata
- Download URL: interbase-1.0.1-py3-none-any.whl
- Upload date:
- Size: 212.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c45a39903aa8327cfa5d900744b34211b1bbdad90f4c9d435067debd69d47f05
|
|
| MD5 |
c2ebc4033d5b215f10bb89c1c6e3ca40
|
|
| BLAKE2b-256 |
45fd265a76b64e61a506af407049f21e8177502f8358802230a3a254a95d023c
|
Provenance
The following attestation bundles were made for interbase-1.0.1-py3-none-any.whl:
Publisher:
pypi.yml on Embarcadero/InterBasePython
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
interbase-1.0.1-py3-none-any.whl -
Subject digest:
c45a39903aa8327cfa5d900744b34211b1bbdad90f4c9d435067debd69d47f05 - Sigstore transparency entry: 195730492
- Sigstore integration time:
-
Permalink:
Embarcadero/InterBasePython@f2dcefccd1a3fcf0f06d72849a615aba4214106c -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/Embarcadero
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@f2dcefccd1a3fcf0f06d72849a615aba4214106c -
Trigger Event:
push
-
Statement type: