A Python PHPFINA feeds and Api Tools to interact with EmonCms.
Project description
emon_tools
emon-tools is a Python library that provides tools and APIs for interacting with EmonCMS and processing time-series data. It is designed to simplify data retrieval, analysis, and validation, making it easier to work with energy monitoring data.
Table of Contents
Installation
The emon-tools package offers flexible installation options tailored to various use cases. Depending on your requirements, you can choose to install the complete package or specific subsets of dependencies.
Best Practices for Installation
-
Environment Management: Always use a virtual environment (e.g.,
venvorconda) to isolate your dependencies and prevent conflicts with other projects. -
Upgrading Dependencies: Keep your dependencies up to date by running
pip install --upgrade emon-toolsperiodically. -
Check Requirements: Review the module's requirements in the
setup.cfgfile or on the PyPI page to ensure compatibility with your system.
Global Installation
To install the entire emon-tools package along with all dependencies, run the following command:
pip install emon-tools["all"]
Included Dependencies:
- aiohttp
- numpy
- pandas
- matplotlib
Tip: This is the best option if you plan to use all features, including data manipulation and visualization.
Module-Specific Installation
You can install specific modules and their dependencies as needed. For example:
- To enable
emon_finamodule:
pip install emon-tools["fina"]
- To enable pandas time-series output functionality:
pip install emon-tools["fina, time_series"]
- To include graph plotting capabilities:
pip install emon-tools["fina, plot"]
- To enable
emon_apimodule:
pip install emon-tools["api"]
- To enable
emon_finaandemon_apimodules:
pip install emon-tools["api, fina"]
Modules
emon_tools is modular, allowing you to install and use individual components as needed.
1. emon_fina
The emon_fina module facilitates the analysis and processing of time-series data, particularly from PhpFina file formats.
Features
- Data Reading: Efficiently read data from PhpFina file formats.
- Time-Series Analysis: Compute daily statistics such as min, max, mean, and more.
- Filtering: Validate and filter data based on custom thresholds.
- Utilities: Timestamp manipulation and interval computation tools.
Usage Example
from emon_tools.fina_time_series import FinaDataFrame
from emon_tools.fina_plot import PlotData
fdf = FinaDataFrame(
feed_id=1,
data_dir="/path/to/phpfina/files"
)
# Access metadata of the .meta file:
print("Meta: ", fdf.meta)
# get height days of data points from meta start_time
ts = fdf.get_fina_df_time_series(
start=fdf.meta.start_time,
step=10,
window=8 * 24 * 3600
)
PlotData.plot(data=ts)
2. emon_api
The emon_api module is Emoncms python api module, used to interract with an EmonCMS instance via its JSON API.
Features
- Communicate with EmonCMS using RESTful JSON APIs.
- Retrieve and manage feeds, inputs, and other data structures.
Usage Example
- Wiki: See
emon_apimodule wiki section.
Running Tests
To ensure everything is functioning correctly, run the test suite:
pytest -v
Contributing
Contributions are welcome! To contribute:
- Fork the repository.
- Create a feature branch.
- Submit a pull request with a clear description.
License
This project is licensed under the MIT License. See LICENSE for more details.
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 emon_tools-0.2.2.tar.gz.
File metadata
- Download URL: emon_tools-0.2.2.tar.gz
- Upload date:
- Size: 57.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8bcea1a0dad26dfdbb9f785d703d0ae735ff9d2ab0905852db016df1e02c2051
|
|
| MD5 |
bdeee7b19d9447eba67fb90c03565445
|
|
| BLAKE2b-256 |
282d2f9d4eedb397ce60e239bb77d669a492a4bdb0c6c9537450cf8c2eadee95
|
File details
Details for the file emon_tools-0.2.2-py3-none-any.whl.
File metadata
- Download URL: emon_tools-0.2.2-py3-none-any.whl
- Upload date:
- Size: 47.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a1a6200e77ce9d38ea5d161698f3a75951829b72372c89014645016eb89f8d6
|
|
| MD5 |
4de3da4b009d9c02571ce32ca02b33d1
|
|
| BLAKE2b-256 |
ff3fc01c2d2b178e72fd966844d3e752c769041a464efaa509001d3ed438a195
|