Motion Lake Client, a client for the Motion Lake API (a Mobility Data Lake)
Project description
MotionLake Client
MotionLake Client is a Python client library for interacting with a storage server designed for a new mobility data lake solution. It provides functionalities to create collections, store data, query data, and retrieve collections.
Installation
You can install the library via pip:
pip install motion-lake-client
Usage
Here's a brief overview of how to use the library:
from motion_lake_client import BaseClient
# Initialize the client with the base URL of the storage server
client = BaseClient(lake_url='http://localhost:8000')
# Create a new collection
client.create_collection('my_collection')
# Store data in a collection
data = b'example_data'
timestamp = int(datetime.now().timestamp())
client.store('my_collection', data, timestamp)
# Query data from a collection
results = client.query('my_collection', min_timestamp=0, max_timestamp=timestamp, ascending=True)
# Retrieve last item from a collection
last_item = client.get_last_item('my_collection')
# Retrieve first item from a collection
first_item = client.get_first_item('my_collection')
# Get items between two timestamps
items_between = client.get_items_between('my_collection', min_timestamp=0, max_timestamp=timestamp)
# Get items before a timestamp
items_before = client.get_items_before('my_collection', timestamp, limit=10)
# Get items after a timestamp
items_after = client.get_items_after('my_collection', timestamp, limit=10)
# Get all collections
collections = client.get_collections()
Documentation
For detailed documentation and examples, please refer to the official documentation.
Contributing
Contributions are welcome! Please feel free to submit a pull request or open an issue for any bugs or feature requests.
License
All rights reserved.
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
Built Distribution
File details
Details for the file motion_lake_client-0.0.5.tar.gz
.
File metadata
- Download URL: motion_lake_client-0.0.5.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06937dc799425f446bd65e42bad33c5cc8d8920089fdca49333197752727b81b |
|
MD5 | d8ebb6499cb02a4964bfbc6638c89f2f |
|
BLAKE2b-256 | b54d5a4702ff3192d9e725a8b675bc2d11e1ec81c3739e7089ff9b31a7bd2350 |
File details
Details for the file motion_lake_client-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: motion_lake_client-0.0.5-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3df9a80205909e187d3e77f6260f9cb2c61f002f8decfccd326e558755eb3a11 |
|
MD5 | 65a5ceb1bd7603951768fed9a4464358 |
|
BLAKE2b-256 | 8a401d17e86244390be4b23cad8d0b33b99f623965f395a8dcf693b0fbe4acae |