The Python Client Library for SightingDB
Project description
SightingDB is a fast database to perform Sightings. It allows to count how many time someone has seen something, when was the first time, when was the last time etc.
This client library is an abstraction from the REST API.
Examples
To write 3 values:
import sightingdb
con = sightingdb.connection(host="localhost", apikey="changeme")
writer = sightingdb.writer(con)
writer.add("/key/namespace1", "pypi.org")
writer.add("/key/namespace1", "pypi.org")
writer.add("/key/namespace2", "example.com")
writer.commit()
We are counting, so pypi.org will have a count of 2.
To read 2 values, it is almost like writing but writer became reader and we fetch data to iterate on:
import sightingdb
con = sightingdb.connection(host="localhost", apikey="changeme")
reader = sightingdb.reader(con)
reader.add("/key/namespace1", "pypi.org")
reader.add("/key/namespace2", "example.com")
for i in reader.fetch():
print(str(i))
And you will be all set to read all the values.
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
sightingdb-0.0.6.tar.gz
(3.7 kB
view hashes)
Built Distribution
Close
Hashes for sightingdb-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ced1e9bd34eece9861bc9361e2ca59853c5b24427b173e2a0cff4b78b487a36 |
|
MD5 | dc3c78bdc33c8e267a3ff009fcd4c217 |
|
BLAKE2b-256 | 20c99794c4dcaed7a177dabef134c72a4bc00a5f902bf55ebc09f1ffbf67fb49 |