Skip to main content

Python SDK to interact with next-gen-db

Project description

NextGenDB SDK

Usage Example

from next_gen_db_sdk import NextGenDBClient, NextGenDBError, NotFoundError

# Initialize the client with the base URL of the next-gen-db server
client = NextGenDBClient(base_url="http://localhost:8047")

# --- Document operations ---
try:
    # Create a document
    client.create_document("user_1", {"name": "John Doe", "age": 30})
    
    # Retrieve the document
    document = client.get_document("user_1")
    print("Document retrieved:", document)

    # Update the document
    client.update_document("user_1", {"name": "John Doe", "age": 31})
    
    # Delete the document
    client.delete_document("user_1")

except NotFoundError as e:
    print(f"Error: {e}")
except NextGenDBError as e:
    print(f"General error: {e}")

# --- Graph operations ---
try:
    # Add a node
    client.add_node("person_1", {"name": "Alice", "age": 25})
    
    # Add an edge (relationship)
    client.add_edge("person_1", "person_2", "friends")
    
    # Retrieve the node
    node = client.get_node("person_1")
    print("Node retrieved:", node)
    
    # Retrieve the edge
    edge = client.get_edge("person_1", "person_2")
    print("Edge retrieved:", edge)

except NextGenDBError as e:
    print(f"Graph error: {e}")

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

next_gen_db_sdk-0.1.1.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

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

next_gen_db_sdk-0.1.1-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file next_gen_db_sdk-0.1.1.tar.gz.

File metadata

  • Download URL: next_gen_db_sdk-0.1.1.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for next_gen_db_sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 55e22c64d9d34027d275d05efb6827e8389eb0d366ab4b99d51139181fc1bcfd
MD5 657c668ec726007b3e93a062b0935360
BLAKE2b-256 531925209456407dab707e24c3ec8d2e61211776ad4c1b57ac860bb3573b4f28

See more details on using hashes here.

File details

Details for the file next_gen_db_sdk-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for next_gen_db_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c294f52a7025b8c7f3010d0052861c322f729b5dd3a0b5cfab7c6a04fae8870b
MD5 abe86aa8879fd2aef6b95131ba895973
BLAKE2b-256 457f36265eef856bb74459dd4872188952df718c39a4cb1a6e1b448e0b4d8a4a

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