Skip to main content

MonkDB

MonkDB Python Client Driver

Python Stable Version Last Updated

Introduction

This package is a MonkDB's Python SDK client library. It is compliant with PEP0249 to interact with database engines using Python's established goto practices.


Installation

One can use the regular pip to install monkdb client driver. It installs the latest package.

pip install monkdb

Or if you want to install a specific version using pip, please run the below command.

pip install monkdb==1.0.5

One can also use other python package managers. For example, below is the command to install with poetry. It installs the latest package

poetry add monkdb

Or if you want to add specific version of MonkDB using poetry, please run the below command.

poetry add monkdb@1.0.0

Usage Instructions

Connect to MonkDB

The first step in working with MonkDB is to establish a connection using the client instance. This is a prerequisite for performing downstream operations such as executing SQL statements, interacting with tables, and more.

from monkdb import client

try:
    connection = client.connect(
        f"http://{DB_USER}:{DB_PASSWORD}@{DB_HOST}:{DB_PORT}", username=DB_USER
    )
    cursor = connection.cursor()
    print("✅ Database connection established successfully!")
except Exception as e:
    print(f"⚠️ Error connecting to the database: {e}")
    exit(1)

Sample Downstream Usage

Use the cursor that is connected to MonkDB in the previous step to execute SQL statements, close the connection, and perform other database operations.

In the example below, we are dropping the table if it exists:

# Drop table if exists
cursor.execute(f"DROP TABLE IF EXISTS {DB_SCHEMA}.{TABLE_NAME}")
print(f"Dropped {DB_SCHEMA}.{TABLE_NAME} table")

Closing the connection

If the connection is not needed anymore, please close the connection to MonkDB.

# Close connection
cursor.close()
connection.close()

Support

For enterprise support, please write to us at devs@monkdb.com.

Metadata

Release files for monkdb 1.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for monkdb 1.0.5
File Interpreter ABI Platform
monkdb-1.0.5-py3-none-any.whl Python 3 none any Details

Release files / monkdb-1.0.5-py3-none-any.whl

Download URL monkdb-1.0.5-py3-none-any.whl
Size 36.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f6b5ac7a2120d6b45d3b1ee3ca0bc29c8b9233b5892d28060d477daba2072abb
BLAKE2b-256 checksum
How to use checksums
ede4e32bba5d84b91b21fd1803fd21caefa71b9c6f64e6fa83e1276d339f0b20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.1 CPython/3.13.2 Darwin/24.3.0

Release history Release notifications | RSS feed

This release

1.0.5 This release

1 release file

1.0.4

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page