Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

countable/pyxtdb

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pyxtdb

This is a minimal wrapper for the XTDB REST API for Python.

It includes some convenience functions for common DB operations.

To use this example, first spin up xtdb with docker run -p 3000:3000 juxt/xtdb-in-memory:1.20.0

Clone this repo and pip install -r requirements.txt

python

>>> import pyxtdb

>>> node = pyxtdb.Node('http://localhost:3000') # the rest API endpoint.

>>> node.put({"xt/id": "billy", "name": "Billy", "last-name": "Idol"})

>>> print(
    node.query(
        r'{:find [?e], :where [[?e :xt/id]]}'
    )
)

[['billy']]

"Fluent API"

node.put(x).put(y).evict(z).submit()

"bulk api"

node.put([x1 x2 x3]).submit()

Tests

To run the tests, xtdb must be running as above, and you should install pytest

pytest tests.py

About

A python client for XTDB

Resources

License

Stars

4 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Morty Proxy This is a proxified and sanitized view of the page, visit original site.