seriesly Package

class seriesly.core.Database(dbname, connection)

Bases: object

Datastore

append(data, timestamp=None)

Store a JSON document with a system-generated or user-specified timestamps. Return a response body as string.

Parameters:
  • data – arbitrary data dictionary
  • timestamp – user-specified timestamp in one of supported format
get_all(frmt='dict')

Retrieve all documents from database. Return a response body as string or dictionary.

Parameters:frmt – format of response, ‘text’ or ‘dict’
get_one(timestamp, frmt='dict')

Retrieve individual document from database. Return a response body as string or dictionary.

Parameters:
  • timestamp – timestamp of document.
  • frmt – format of response, ‘text’ or ‘dict’
query(params, frmt='dict')

Querying data in seriesly database. Return a response body as string or dictionary.

Parameters:
  • params – dictionary with query parameters (only ‘to’, ‘from’, ‘group’, ‘ptr’ and ‘reducer’ are supported so far). The dictionary values can be lists for representing multivalued query parameters.
  • frmt – format of query response, ‘text’ or ‘dict’
class seriesly.core.HttpClient(host='127.0.0.1', port=3133)

Bases: object

HTTP client with base URL

class seriesly.core.Seriesly(host='127.0.0.1', port=3133)

Bases: seriesly.core.HttpClient

seriesly connection and database manager

create_db(dbname)

Create the ‘dbname’ database.

Parameters:dbname – database name
drop_db(dbname)

Delete the ‘dbname’ database.

Parameters:dbname – database name
list_dbs()

Return a list of all known database names on the server

exception seriesly.exceptions.BadRequest(err_message)

Bases: exceptions.Exception

exception seriesly.exceptions.BadResponse(err_message)

Bases: exceptions.Exception

exception seriesly.exceptions.ConnectionError(base_url)

Bases: exceptions.Exception

exception seriesly.exceptions.ExistingDatabase(dbname)

Bases: exceptions.Exception

exception seriesly.exceptions.NotExistingDatabase(dbname)

Bases: exceptions.Exception

Project Versions

This Page