A simple data logging server and client.
Project description
FinallyDataLogger
FinallyDataLogger is a simple, lightweight data logging server and client package. Log, modify, and fetch data with ease!
Features
- Log data from any Python script easily.
- Store scalar, textual, and binary blob data (currently numpy arrays).
- Fetch and modify data based on criteria.
- Local server setup for easy data storage and retrieval.
Installation
pip install FinallyDataLogger
Quick Start
Starting the server
From the command line:
finallydatalogger --port 5000 --dir /path/to/storage/directory
# to make it visible on the network
finallydatalogger --host 0.0.0.0 --port 5000 --dir /path/to/storage/directory
Using the client
In your Python script:
import numpy as np
from finally_data_logger import DataLogger
logger = DataLogger(port=5000) # DataLogger(server_url="http://192.168.x.x", port=5000)
# Log some data
img = np.random.rand(10,10)
# a packet of data is stored in the form of a dictionary
data = {
"name": "test1",
"duration": 0.3,
"image": img
}
response = logger.log_data(data)
print(response)
# Fetch data
criteria = {'name': 'test*'}
results = logger.get_data(criteria, fetch_blob=True)
print(results)
#To delete specific data based on criteria:
criteria = {'name': 'test*'}
response = logger.delete_data(criteria)
print(response)
#To reset the entire database and remove all logged data:
logger.reset_database()
API
Server Endpoints
POST /log_data
: Log data to the server.PUT /modify_data/<entry_id>
: Modify a data entry by its ID.POST /get_data
: Fetch data based on criteria.POST /delete_data
: Delete data from the server based on given criteria.POST /reset_database
: Reset the entire database and remove all blobs.
Client Methods
log_data(data)
: Log data to the server.modify_data(entry_id, modifications)
: Modify a data entry by its ID.get_data(criteria)
: Fetch data based on criteria.delete_data(criteria)
: Delete data from the server based on given criteria.reset_database()
: Reset the entire database and remove all blobs on the server.
Contributing
Contributions are welcome! Please read the CONTRIBUTING guide for more information.
License
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
Built Distribution
Close
Hashes for finally_data_logger-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba9a94c6facd190d042c0306c8f717b1bdd72aba0d8c74a87b7566fd5108b740 |
|
MD5 | a7c311d54d1a935f1fd7b295caa1f1f2 |
|
BLAKE2b-256 | b7dc0d5077287477008f4602ed04f8058503bced74e050e0d577e839723b4637 |
Close
Hashes for finally_data_logger-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5817a6021ae56bdc8312fbca448075c902e4460e0d03bd5537cdfe29806289f9 |
|
MD5 | 1db32e9481f5fa84423e25eae806404e |
|
BLAKE2b-256 | 97158d5a2f71212c38400eb1adbaaa8b1f22eb943967f5eff344694397da0b59 |