A Python database interface for eXist-db
Project description
delb-existdb is a Python database interface for eXist-db, it was initially named snakesist until its 0.3 release. It supports basic CRUD operations and uses delb’s models to represent documents and nodes. It’s available at the Python Package Index as delb-existdb package.
delb-existdb allows you to access individual documents from the database using a delb.Document object, either by simply passing a URL:
>>> from delb import Document
>>> manifest = Document(
... "existdb://admin:@localhost:8080/exist/db/manifestos/dada_manifest.xml"
... )
>>> [header.full_text for header in manifest.xpath("//head")]
["Hugo Ball", "Das erste dadaistische Manifest"]
or by passing a relative path to the document along with a database client that is bound to an eXist documents collection which you can subsequently reuse:
>>> from delb_existdb import ExistClient
>>> exist_client = ExistClient(
... host="localhost",
... port=8080,
... user="admin",
... password="",
... collection="/db/manifestos"
... )
>>> dada_manifest = Document("dada_manifest.xml", existdb_client=exist_client)
>>> [header.full_text for header in dada_manifest.xpath("//head")]
["Hugo Ball", "Das erste dadaistische Manifest"]
>>> communist_manifest = Document(
... "communist_manifest.xml", existdb_client=exist_client
... )
>>> communist_manifest.xpath("//head").first.full_text
"Manifest der Kommunistischen Partei"
and not only for accessing individual documents, but also for querying nodes across multiple documents:
>>> [header.node.full_text for header in exist_client.xpath("//*:head")]
["Hugo Ball", "Das erste dadaistische Manifest", "Manifest der Kommunistischen Partei", "I. Bourgeois und Proletarier.", "II. Proletarier und Kommunisten", "III. Sozialistische und kommunistische Literatur", "IV. Stellung der Kommunisten zu den verschiedenen oppositionellen Parteien"]
You can of course also modify and store documents back into the database or create new ones and store them.
Your eXist-db instance
delb-existdb leverages eXist’s RESTful API for database operations. This means that allowing database queries using POST requests on the RESTful API is a requirement in the used eXist-db instance. eXist allows this by default, so if you haven’t configured your instance otherwise, don’t worry about it.
We aim to directly support all most recent releases from each major branch. Yet, there’s no guarantee that releases older than two years will be kept as a target for tests. Pleaser refer to the values tool.hatch.envs.tests.matrix.existdb_version in the pyproject.toml for what’s currently considered.
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
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 delb_existdb-0.4rc1.tar.gz.
File metadata
- Download URL: delb_existdb-0.4rc1.tar.gz
- Upload date:
- Size: 46.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cda09b0faa8cda7582161ae3984f37e748eab9501669e1c189bb7d70caba9b04
|
|
| MD5 |
010552eb36f8952908b1aed872bf6d24
|
|
| BLAKE2b-256 |
0e21e137e6bb52c8bc3a830d161b9f8cc191eb1cc941bb9117356e2d2b6ba9db
|
Provenance
The following attestation bundles were made for delb_existdb-0.4rc1.tar.gz:
Publisher:
publish.yml on delb-xml/delb-existdb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
delb_existdb-0.4rc1.tar.gz -
Subject digest:
cda09b0faa8cda7582161ae3984f37e748eab9501669e1c189bb7d70caba9b04 - Sigstore transparency entry: 953511764
- Sigstore integration time:
-
Permalink:
delb-xml/delb-existdb@c49302a6fa5ec5a2f27abf95d1dcee8ec8e1ac51 -
Branch / Tag:
refs/tags/0.4-rc1 - Owner: https://github.com/delb-xml
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c49302a6fa5ec5a2f27abf95d1dcee8ec8e1ac51 -
Trigger Event:
push
-
Statement type:
File details
Details for the file delb_existdb-0.4rc1-py3-none-any.whl.
File metadata
- Download URL: delb_existdb-0.4rc1-py3-none-any.whl
- Upload date:
- Size: 13.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7e46e48c470d4c5a2c480bb3bd99ff271a6c43b2145fa5fc8fbea30bef399cb
|
|
| MD5 |
ce41698e7785267df376592e9ba18529
|
|
| BLAKE2b-256 |
807e5b97fcbed6b79f2e8712e35234fd51c46e5aa440a22fb85c38756dfa9e4f
|
Provenance
The following attestation bundles were made for delb_existdb-0.4rc1-py3-none-any.whl:
Publisher:
publish.yml on delb-xml/delb-existdb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
delb_existdb-0.4rc1-py3-none-any.whl -
Subject digest:
e7e46e48c470d4c5a2c480bb3bd99ff271a6c43b2145fa5fc8fbea30bef399cb - Sigstore transparency entry: 953511768
- Sigstore integration time:
-
Permalink:
delb-xml/delb-existdb@c49302a6fa5ec5a2f27abf95d1dcee8ec8e1ac51 -
Branch / Tag:
refs/tags/0.4-rc1 - Owner: https://github.com/delb-xml
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c49302a6fa5ec5a2f27abf95d1dcee8ec8e1ac51 -
Trigger Event:
push
-
Statement type: