Skip to main content

Graph database API for Herculaneum data

Project description

EduceLab Herculaneum Graph Database API

This API is considered a work in progress and can change at any moment.

Installation

The latest release is available on PyPI:

python3 -m pip install educelab-hercdb

Connect to a server

from educelab import hercdb

uri = "neo4j://localhost:7687"
user = "foo"
password = "bar"
db = hercdb.connect(uri, user, password)
if db.verify_connection():
  print("Connected!")

Server configuration

If not provided when calling hercdb.connect(), this package will attempt to read the URI, username, and password from the configuration file at ~/.hercdb. This file is expected to be in the TOML format:

[database]
uri = "neo4j://localhost:7687"
username = "foo"
password = "bar"

The section header is optional, and only the information from the first section will be read. In the future, sections may be used to differentiate multiple database servers. Note: In Python 3.10, the configuration file is loaded using configparser, which does not support the full TOML syntax.

Alternatively, the server information can be provided by exporting the following environment variables:

export EDUCEDB_URI='neo4j://localhost:7687'
export EDUCEDB_USER=foo
export EDUCEDB_PASSWORD=bar

Environment variables take priority over the configuration file.

As a convenience, this package provides the hercdb.config.request_required() method, which will check for configuration values in the environment and the configuration file and prompt for any which have not been provided:

>>> hercdb.config.request_required()

Enter URI: neo4j://localhost:7687
Enter username: foo
Enter password: 

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

educelab_hercdb-0.1.1.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

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

educelab_hercdb-0.1.1-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: educelab_hercdb-0.1.1.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for educelab_hercdb-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4b65370d1d2b49bb16ce283ed3af90802f1cc5ae56fbda66764337855626abc4
MD5 db97f86faedb47733d5d9260e0d06310
BLAKE2b-256 bdba0d13ec977697c9cb4ec32bcc41c5b5dcc54905c5c3a785b9f52359b520f5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for educelab_hercdb-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 be111a416bc07c4e266fb5327f51b56002a81db35ba747b0e74367e8545f78b8
MD5 aa1f9f1b4a3f078152c7f946ffcaffc1
BLAKE2b-256 99ea08b235a82832911a0aa94297919244a819bec04c3f772edda4b95649937d

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