Skip to main content

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


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)

Uploaded Source

Built Distribution

sightingdb-0.0.6-py3-none-any.whl (6.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page