A simple interface for interacting with NexusDB.
Project description
nexus-python
Official Python wrapper for NexusDB API
install the package:
pip install nexusdb-python
Then, you can use the package to interact with the Nexus API:
Hint: make sure to replace "your_api_key" with your actual API key, which is found in the Nexus dashboard.
from nexus_python.nexusdb import NexusDB
nexus_db = NexusDB(api_key="your_api_key")
# Step 1: Create a new relation
relation_name = "example_relation"
columns = [
{"name": "id", "type": "Int", "is_primary": True},
{"name": "name", "type": "String"},
]
create_response = nexus_db.create(relation_name, columns)
print("Create relation response:", create_response)
# Step 2: Insert data into the relation
fields = ["id", "name"]
values = [[1, "Item 1"], [2, "Item 2"]]
insert_response = nexus_db.insert(relation_name, fields, values)
print("Insert data response:", insert_response)
# Step 3: Delete one line of data based on a primary key
primary_keys = {"id": 1}
delete_response = nexus_db.delete(relation_name, primary_keys)
print("Delete data response:", delete_response)
# Optional: Lookup to verify deletion
lookup_response = nexus_db.lookup(relation_name, tabulate=True)
print("Lookup after deletion:\n", lookup_response)
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 Distribution
nexus_python-0.3.1.tar.gz
(5.7 kB
view details)
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 nexus_python-0.3.1.tar.gz.
File metadata
- Download URL: nexus_python-0.3.1.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.2 Darwin/23.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
425ab1afdbbcdd67cbad67e0fa73b9275c4a289ea62b2a36e2eafee182a80c88
|
|
| MD5 |
eb2f3fae76a8066d8ae55eb1d6fedb57
|
|
| BLAKE2b-256 |
ce6a2bee8ee2b9fd69c9c4518b12dc19c693589559791119d36e9ac6193bc496
|
File details
Details for the file nexus_python-0.3.1-py3-none-any.whl.
File metadata
- Download URL: nexus_python-0.3.1-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.2 Darwin/23.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62f333387598bf353c5b82107b1b0adabe2d1dfb51592eac2d7fa36751655b3c
|
|
| MD5 |
2239b44d99a5ffba0ecc994bdd3cad07
|
|
| BLAKE2b-256 |
ccd8a6dffec311d9eab92a1561faacb373e754a659e8785d2a41d5b957ee7adb
|