""" To see all streams available in this namespace, use `get_streams`. """ for stream in kc.get_streams(): print 'Found stream', stream # Deleting data """ Sometimes, we make an oopsie and need to delete some events. The `delete` function takes similar arguments for the start and end timestamps to delete. Note: The most common Kronos use cases are for write-mostly systems with high-throughput reads. As such, you can imagine that most backends will not be delete-optimized. There's nothing in the Kronos API that inherently makes deletes not performant, but we imagine some backends will make tradeoffs to optimize their write and read paths at the expense of fast deletes. TODO(marcua): document `start_id` logic once we nail down the semantics. """ kc.delete('yourproduct.website.clicks', start + timedelta(seconds=5), start + timedelta(minutes=10)) events = kc.get('yourproduct.website.clicks', start, start + timedelta(minutes=10)) for event in events: print 'Received event', event
You can retrieve a schema for a stream. The schema is inferred from the structure of the individual events. The schema protocol is based on JSON Schema v4. """ response = kc.infer_schema('yourproduct.website.clicks') print response['schema'] """ ## Deleting Events Sometimes, we make an oopsie and need to delete some events. The `delete` function takes similar arguments for the start and end timestamps to delete. Note: The most common Kronos use cases are for write-mostly systems with high-throughput reads. As such, you can imagine that most backends will not be delete-optimized. There's nothing in the Kronos API that inherently makes deletes not performant, but we imagine some backends will make tradeoffs to optimize their write and read paths at the expense of fast deletes. """ kc.delete('yourproduct.website.clicks', start + timedelta(seconds=5), start + timedelta(minutes=10)) events = kc.get('yourproduct.website.clicks', start, start + timedelta(minutes=10)) for event in events: print 'Received event', event