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
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
Built Distribution
File details
Details for the file educelab_hercdb-0.1.0.tar.gz
.
File metadata
- Download URL: educelab_hercdb-0.1.0.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1abeaa67ad7603d0f4da688248f0d4b197e0a64353c70d6d559e9d9bc554f50d |
|
MD5 | f9eb255949c7cfd7a40870f70ecb07ba |
|
BLAKE2b-256 | d6ce09ea78ae0deab1a714dd75ea0db5d52354564bb2e2bda934833c931f8677 |
File details
Details for the file educelab_hercdb-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: educelab_hercdb-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2fc822f8a418e4e0601053ccd01aad4b4e3438605ac34d89eb1265798a10ef9e |
|
MD5 | 7098868b0d8b6d970271219e6e117542 |
|
BLAKE2b-256 | 1a9cb8991f372ea1a86728d8afe087073243539725f39549fe76ae3ee80d437c |