PyFina
PyFina is a subclass of numpy np.ndarray to import emoncms PHPFINA feeds as numpy arrays
The pip installer will install any missing requirements (numpy, matplotlib)
PyFina brings the power of numpy to the PHPFINA timeseries, including basic operations and more : addition, soustraction, multiplication, division, min, max, mean, sum, slicing with the bracket operator
Note : any operation on a PyFina object results to a standard numpy nd.array object. The signature of the PyFina object is lost.
It does not prevent to add two PyFina objects of the same size but sampled with different intervals
Installation
python3 -m pip install PyFina
or, for python on Windows
py -m pip install PyFina
Post installation testing
copy the content of test.py, paste it in a blank file on your local machine and save it using the same name.
py test.py
Getting Started
To retrieve metadatas for feed number 1 :
from PyFina import getMeta, PyFina
import matplotlib.pyplot as plt
# classic emoncms feed storage on linux
dir = "/var/opt/emoncms/phpfina"
meta = getMeta(1,dir)
print(meta)
To import the first 8 days of datas, with a sampling interval of 3600 s :
step = 3600
start = meta["start_time"]
window = 8*24*3600
length = meta["npoints"] * meta["interval"]
if window > length:
window = length
nbpts = window // step
Text = PyFina(1,dir,start,step,nbpts)
To catch the signature of the created PyFina object :
# time start as a unixtimestamp expressed in seconds
print(Text.start)
# step/interval in seconds
print(Text.step)
To plot:
import datetime
import time
localstart = datetime.datetime.fromtimestamp(start)
utcstart = datetime.datetime.utcfromtimestamp(start)
title = "starting on :\nUTC {}\n{} {}".format(utcstart,time.tzname[0],localstart)
plt.subplot(111)
plt.title(title)
plt.ylabel("outdoor Temp °C")
plt.xlabel("time in hours")
plt.plot(Text)
plt.show()
With the above code, the xrange will be expressed in hour, so 192 points will be displayed
To express the xrange in seconds :
xrange = Text.timescale()
plt.subplot(111)
plt.plot(xrange,Text)
plt.show()
Metadata
Release files for PyFina 0.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyfina-0.0.7.tar.gz | 6.2 kB | Without provenance | Details for pyfina-0.0.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| PyFina-0.0.7-py3-none-any.whl | Python 3 | none | any | Details for PyFina-0.0.7-py3-none-any.whl |
Total release size: 11.9 kB
Release files / pyfina-0.0.7.tar.gz
| Download URL | pyfina-0.0.7.tar.gz |
|---|---|
| Size | 6.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
811152c017bec65aa2c73568ae53d9c734a68b22c80689253f045135c94f5551
|
|
BLAKE2b-256 checksum How to use checksums |
55679264b9010c6e4e1dbfb439c759807a3a1a85d240f07e6ce005a2233b4c95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.9.21
|
Release files / PyFina-0.0.7-py3-none-any.whl
| Download URL | PyFina-0.0.7-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cef778cbed2c7763d69914009ced43355f824cc6ee2fa0a0720ac0b3cf35a057
|
|
BLAKE2b-256 checksum How to use checksums |
d64a6776ec4dcfeb039ef306c2ced44db963bf578106d4d77f63b068861e06de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.9.21
|
Security for PyFina 0.0.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.