blanketdb module

A simple HTTP accessible database for IoT projects.

class blanketdb.BlanketDB(connection_string: str, now: Callable[[], datetime.datetime] = <built-in method now of type object>)[source]

Bases: object

A simple HTTP accessible database for IoT projects

delete(bucket: str = None, since_id: Optional[int] = None, since: Union[str, datetime.datetime, datetime.date, None] = None, before_id: Optional[int] = None, before: Union[str, datetime.datetime, datetime.date, None] = None) → Any[source]

Delete entries from this BlanketDB instance using various filters. since and since_id are inclusive, before and before are exclusive regarding the specified value.

query(bucket: str = None, since_id: Optional[int] = None, since: Union[str, datetime.datetime, datetime.date, None] = None, before_id: Optional[int] = None, before: Union[str, datetime.datetime, datetime.date, None] = None, limit: int = -1, newest_first: bool = True) → Iterable[Dict[str, Any]][source]

Query this BlanketDB instance using various optional filters. since and since_id are inclusive, before and before are exclusive regarding the specified value.

store(data: Any, bucket: str = 'default') → Dict[str, Any][source]

Serialize data to json and store it under bucket.

store_dict(bucket: str = 'default', **kwargs) → Dict[str, Any][source]

Serialize key word args to json and store under bucket.

blanketdb.cli() → None[source]