A client library for IoT projects in the RCER initiative
Project description
SAVIIA Library
Sistema de Administración y Visualización de Información para la Investigación y Análisis
Installation
This library is designed for use with the SAVIIA Home Assistant Integration. It provides an API to retrieve files from a THIES Data Logger via an FTP server and upload them to a Microsoft SharePoint folder using the SharePoint REST API.
pip install saviialib
Usage
Initialize the EPii API Client
To start using the library, you need to create an EpiiAPI client instance with its configuration class:
from saviialib import EpiiAPI, EpiiAPIConfig
config = EpiiAPIConfig(
ftp_port=FTP_PORT,
ftp_host=FTP_HOST,
ftp_user=FTP_USER,
ftp_password=FTP_PASSWORD,
sharepoint_client_id=SHAREPOINT_CLIENT_ID,
sharepoint_client_secret=SHAREPOINT_CLIENT_SECRET,
sharepoint_tenant_id=SHAREPOINT_TENANT_ID,
sharepoint_tenant_name=SHAREPOINT_TENANT_NAME,
sharepoint_site_name=SHAREPOINT_SITE_NAME
)
api_client = EpiiAPI(config)
Notes:
- Store sensitive data like
FTP_PASSWORD,FTP_USER, and SharePoint credentials securely. Use environment variables or a secrets management tool to avoid hardcoding sensitive information in your codebase.
Update THIES Data Logger Files
The library provides a method to synchronize THIES Data Logger files with the RCER SharePoint client. This method updates the folder containing binary files with meteorological data:
from saviialib import EpiiUpdateThiesConfig
import asyncio
async def main():
# Before calling this method, you must have initialised the api class ...
response = await api_client.update_thies_data()
return response
asyncio.run(main())
Development
This project includes a Makefile to simplify common tasks. Below are the available commands:
Install Basic Dependencies
To install the basic dependencies required for the project, run the following command:
make install-deps
This will ensure that all necessary libraries and tools are installed for the project to function properly.
Install Development Requirements
For setting up a development environment with additional tools and libraries, execute:
make dev
This command installs all the dependencies needed for development, including testing and linting tools.
Run Tests
To verify that the code is functioning as expected, you can run the test suite using:
make test
This will execute all the tests in the project and provide a summary of the results.
Lint the Code
To ensure that the code adheres to the project's style guidelines and is free of common errors, run:
make lint
This command checks the codebase for linting issues and outputs any problems that need to be addressed.
Contributing
If you're interested in contributing to this project, please follow the contributing guidelines. By contributing to this project, you agree to abide by its terms. Contributions are welcome and appreciated!
License
saviialib was created by Pedro Pablo Zavala Tejos. It is licensed under the terms of the MIT license.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file saviialib-0.10.2.tar.gz.
File metadata
- Download URL: saviialib-0.10.2.tar.gz
- Upload date:
- Size: 16.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ec2b6b333e3506cef6949595c03c42c86cb18d40d3f665758f2ac25922e5e50
|
|
| MD5 |
645781720efc9e3b92e63a3c8d4b993a
|
|
| BLAKE2b-256 |
8a5777ae2327a1e2a5f985a1a7a85d08db00572fc4e0f9728ffb2877f0c078e9
|
File details
Details for the file saviialib-0.10.2-py3-none-any.whl.
File metadata
- Download URL: saviialib-0.10.2-py3-none-any.whl
- Upload date:
- Size: 32.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f58d18a396d3997b477329739c83efb1fabd8b4ee774432ea37833cfd7937b9
|
|
| MD5 |
e09bbd518b3cee1f54bd816976a5fff1
|
|
| BLAKE2b-256 |
d4e078baa0c4c908da7b6973224b49016734b15651d8c6a02fbb260f6a7adffd
|