Metadata-Version: 2.1
Name: finally-data-logger
Version: 0.1.2
Summary: A simple data logging server and client.
Home-page: https://github.com/arbasli2/FinallyDataLogger
Author: arbasli
Author-email: arbasli2@gmail.com
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Description-Content-Type: text/markdown
Requires-Dist: flask
Requires-Dist: requests
Requires-Dist: tinydb
Requires-Dist: numpy

# 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

```bash
pip install FinallyDataLogger
```

## Quick Start

### Starting the server

From the command line:

```bash
finally_data_logger_server --port 5000 --dir /path/to/storage/directory
```

### Using the client

In your Python script:

```python
from finally_data_logger import DataLogger

logger = DataLogger(port=5000)

# Log some data
data = {
    "name": "test1",
    "duration": 0.3,
    "image": your_numpy_image
}
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](CONTRIBUTING.md) guide for more information.

## License

[MIT License](LICENSE)

