Skip to main content

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


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.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nexus_python-0.3.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file nexus_python-0.3.0.tar.gz.

File metadata

  • Download URL: nexus_python-0.3.0.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

Hashes for nexus_python-0.3.0.tar.gz
Algorithm Hash digest
SHA256 009e97e0c9785a10e550bd26f542f33da83e593b4abcbe69fead15a137314ae9
MD5 6a37955a74f9366b5736656d561197ed
BLAKE2b-256 e62f36885af4282ce1487651019c873091aa5228e6a3761880c917fa534843c8

See more details on using hashes here.

File details

Details for the file nexus_python-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: nexus_python-0.3.0-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

Hashes for nexus_python-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9d57f1b0c6ef45cefe214ea4ef82fa79f6c0075dfe29295a70e05b40c89b4138
MD5 997ffca4ea6b74946abce6ebcf5b8867
BLAKE2b-256 c9c03188a5cd2c4e1d6e0fa8b5d56b277b12385b5431bd3e8ea28024fd395df8

See more details on using hashes here.

Supported by

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