Python asyncio bindings for foundationdb
Branch: master
Clone or download
Latest commit a13e5a9 Dec 25, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
benchmark add benchmark comparing fdb vs found Sep 20, 2018
doc doc: remove build Sep 19, 2018
found expose Versionstamp Dec 25, 2018
.coveragerc coverage++ Sep 19, 2018
.flake8 very minimal bindings May 10, 2018
.gitignore
.pre-commit-config.yaml setup: wip pypi.org release + black power Sep 19, 2018
.travis.yml travis: enable python 3.7 Nov 17, 2018
LICENSE Initial commit May 8, 2018
Makefile Makefile++ Dec 7, 2018
Pipfile upgrade to fdb v6 Nov 17, 2018
Pipfile.lock Pipfile++ Dec 25, 2018
README.rst s/510/600 Nov 19, 2018
setup.py v0.6.0 bump Dec 25, 2018
tests.py

README.rst

asyncio-foundationdb

https://api.travis-ci.com/amirouche/asyncio-foundationdb.svg?branch=master

asyncio drivers for foundationdb tested with CPython 3.5+

In [1]: import found
In [2]: import asyncio
In [3]: found.api_version(600)
In [4]: loop = asyncio.get_event_loop()
In [5]: db = loop.run_until_complete(found.open())
In [6]: tr = db._create_transaction()
In [7]: loop.run_until_complete(tr.get(b'hello'))
In [8]: tr.set(b'hello', b'world')
In [9]: loop.run_until_complete(tr.get(b'hello'))
Out[9]: b'world'

Also @transactional is also supported.

Getting started

pip install asyncio-foundationdb

Documentation

You must read the official python api documentation, it is awesome.

In general, the asyncio bindings are the same except there is async and await that must be added here and there.

Here are differences with the synchronous bindings:

  • no shorthand syntax like: foo[b'bar']
  • You can do value is None instead of value == None
  • Transaction.get_range returns a list of (key, value) pairs

If something is missing it's a bug, please fill an issue.