
# MonkDB Python Client Driver
   
## Introduction
This package is a MonkDB's Python SDK client library. It is compliant with [PEP0249](https://peps.python.org/pep-0249/) 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.
```sh
pip install monkdb
```
Or if you want to install a specific version using `pip`, please run the below command.
```sh
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
```sh
poetry add monkdb
```
Or if you want to add specific version of MonkDB using `poetry`, please run the below command.
```sh
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.
```python
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:
```python
# 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.
```python
# Close connection
cursor.close()
connection.close()
```
---
## Support
For enterprise support, please write to us at [devs@monkdb.com](mailto:devs@monkdb.com).
Raw data
{
"_id": null,
"home_page": null,
"name": "monkdb",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "monkdb, db, api, dbapi, database, sql, http, rdbms, olap",
"author": "MonkDB Development Team",
"author_email": "devs@monkdb.com",
"download_url": null,
"platform": null,
"description": "\n\n# MonkDB Python Client Driver\n\n   \n\n## Introduction\n\nThis package is a MonkDB's Python SDK client library. It is compliant with [PEP0249](https://peps.python.org/pep-0249/) to interact with database engines using Python's established goto practices.\n\n---\n\n## Installation\n\nOne can use the regular `pip` to install monkdb client driver. It installs the latest package.\n\n```sh\npip install monkdb\n```\n\nOr if you want to install a specific version using `pip`, please run the below command.\n\n```sh\npip install monkdb==1.0.5\n```\n\nOne can also use other python package managers. For example, below is the command to install with `poetry`. It installs the latest package\n\n```sh\npoetry add monkdb\n```\n\nOr if you want to add specific version of MonkDB using `poetry`, please run the below command.\n\n```sh\npoetry add monkdb@1.0.0\n```\n\n---\n\n## Usage Instructions\n\n### Connect to MonkDB\n\nThe 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. \n\n```python\nfrom monkdb import client\n\ntry:\n connection = client.connect(\n f\"http://{DB_USER}:{DB_PASSWORD}@{DB_HOST}:{DB_PORT}\", username=DB_USER\n )\n cursor = connection.cursor()\n print(\"\u2705 Database connection established successfully!\")\nexcept Exception as e:\n print(f\"\u26a0\ufe0f Error connecting to the database: {e}\")\n exit(1)\n```\n\n### Sample Downstream Usage\n\nUse the `cursor` that is connected to **MonkDB** in the previous step to execute SQL statements, close the connection, and perform other database operations.\n\nIn the example below, we are dropping the table if it exists:\n\n```python\n# Drop table if exists\ncursor.execute(f\"DROP TABLE IF EXISTS {DB_SCHEMA}.{TABLE_NAME}\")\nprint(f\"Dropped {DB_SCHEMA}.{TABLE_NAME} table\")\n```\n\n### Closing the connection\n\nIf the connection is not needed anymore, please close the connection to MonkDB.\n\n```python\n# Close connection\ncursor.close()\nconnection.close()\n```\n\n---\n\n## Support\n\nFor enterprise support, please write to us at [devs@monkdb.com](mailto:devs@monkdb.com).",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "MonkDB Python Client to interact with MonkDB's database engine",
"version": "1.0.5",
"project_urls": {
"homepage": "https://bitbucket.org/atomstatedev/monkpy"
},
"split_keywords": [
"monkdb",
" db",
" api",
" dbapi",
" database",
" sql",
" http",
" rdbms",
" olap"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ede4e32bba5d84b91b21fd1803fd21caefa71b9c6f64e6fa83e1276d339f0b20",
"md5": "0291080a5056a15d5e9e80a7e2a9f3a7",
"sha256": "f6b5ac7a2120d6b45d3b1ee3ca0bc29c8b9233b5892d28060d477daba2072abb"
},
"downloads": -1,
"filename": "monkdb-1.0.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0291080a5056a15d5e9e80a7e2a9f3a7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 36043,
"upload_time": "2025-03-19T05:36:08",
"upload_time_iso_8601": "2025-03-19T05:36:08.033371Z",
"url": "https://files.pythonhosted.org/packages/ed/e4/e32bba5d84b91b21fd1803fd21caefa71b9c6f64e6fa83e1276d339f0b20/monkdb-1.0.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-03-19 05:36:08",
"github": false,
"gitlab": false,
"bitbucket": true,
"codeberg": false,
"bitbucket_user": "atomstatedev",
"bitbucket_project": "monkpy",
"lcname": "monkdb"
}