Skip to main content

A Python database interface for eXist-db

Project description

https://badge.fury.io/py/snakesist.svg Documentation Status https://travis-ci.org/03b8/snakesist.svg?branch=master

snakesist is a Python database interface for eXist-db. It supports creating, retrieving, updating and deleting and uses delb for representing the yielded resources.

pip install snakesist

Usage example

from snakesist import ExistClient

db = ExistClient(
    host='my.existdbinstance.org',  # defaults to 'localhost'
    port='80',  # defaults to 8080
    user='foo_bar',  # defaults to 'admin'
    passwordw='f0ob4r'  # defaults to ''
)

db.root_collection = '/db/foo/bar'
# the client will only query from this point downwards

names = db.retrieve_resources('//*:persName')
# note the namespace wildcard in the XPath expression

# append 'Python' to all names which are 'Monty' and delete the rest
for name in names:
    if name.node.full_text == 'Monty':
        name.node.append_child(' Python')
        name.update_push()
    else:
        name.delete()

Your eXist instance

snakesist leverages the eXist RESTful API for database queries. This means that allowing database queries using the _query parameter of the RESTful API is a requirement in the used eXist-db backend. eXist allows this by default, so if you haven’t configured your instance otherwise, don’t worry about it.

snakesist is tested with eXist 4.7.1 and is not compatible yet with eXist 5.0.0.

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

snakesist-0.1.0.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

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

snakesist-0.1.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file snakesist-0.1.0.tar.gz.

File metadata

  • Download URL: snakesist-0.1.0.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.16 CPython/3.6.8 Linux/4.9.0-11-amd64

File hashes

Hashes for snakesist-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b5583a0eb5c083781030008efede2425e3a19b2e0ce59d2924835f45859499c3
MD5 4e3102b6790dc4e1ff417c125458e213
BLAKE2b-256 024c22959b1428f615800529c3e95ef1d24f3e690b798ca6f7f811986382e6d9

See more details on using hashes here.

File details

Details for the file snakesist-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: snakesist-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.16 CPython/3.6.8 Linux/4.9.0-11-amd64

File hashes

Hashes for snakesist-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 361222e71f7bc8623d9b10a905fbc894fc43871e819762d14209a8f5f53d26f3
MD5 4a1f73bb12b009f32a70ffe6408ef583
BLAKE2b-256 4d90232a9998022d9354ab8030d8c489b09be8e48f4585156fd770608d27d3fc

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