Felicien
Felicien is you companion to retrieve timeseries from a TSDB, to transform it in various format and to push it to a TSDB. Supported TSDB are Prometheus compatible (Prometheus, VictoriaMetrics, ...).
Installation
Felicien is available on PyPI:
$ python -m pip install felicien
Felicien officially supports Python 3.11+.
Usage
Felicien helps you to connect to a TSDB, and to play with timeseries.
>>> from felicien import FeliConnector
>>> tsdb = FeliConnector(url="https://my.victoriametrics.instance", tsdb="victoriametrics")
>>> tsdb
FeliConnector([victoriametrics]{https://my.victoriametrics.instance})
>>> ts_scalar = tsdb.get_timeserie(metric='vm_cache_entries{job=~"victoriametrics", instance=~"victoriametrics:8428", type="storage/hour_metric_ids"}')
>>> ts_scalar
FeliTS(vm_cache_entries{instance:"victoriametrics:8428", job:"victoriametrics", type:"storage/hour_metric_ids"}, 1 datapoints)
>>> ts_scalar.as_prometheus()
{'metric': {'__name__': 'vm_cache_entries',
'instance': 'victoriametrics:8428',
'job': 'victoriametrics',
'type': 'storage/hour_metric_ids'},
'values': [17805.0],
'timestamps': [1713606731000]}
>>> ts_vector = tsdb.get_timeserie(metric='vm_cache_entries{job=~"victoriametrics", instance=~"victoriametrics:8428", type="storage/hour_metric_ids"}[1h]')
>>> ts_vector
FeliTS(vm_cache_entries{job:"victoriametrics", type:"storage/hour_metric_ids", instance:"victoriametrics:8428"}, 60 datapoints)
>>> ts_vector.frequency
Timedelta('0 days 00:01:00')
>>> ts_vector.data.describe()
count 60.000000
mean 17768.150000
std 5.580915
min 17766.000000
25% 17766.000000
50% 17766.000000
75% 17767.000000
max 17805.000000
dtype: float64
>>> ts_vector.trim_by_size(boundary=10, keep="left")
2024-04-20 09:03:40.177000046 17766.0
2024-04-20 09:04:40.177000046 17766.0
2024-04-20 09:05:40.177000046 17766.0
2024-04-20 09:06:40.177000046 17766.0
2024-04-20 09:07:40.177000046 17766.0
2024-04-20 09:08:40.177000046 17766.0
2024-04-20 09:09:40.177000046 17766.0
2024-04-20 09:10:40.177000046 17766.0
2024-04-20 09:11:40.177000046 17766.0
2024-04-20 09:12:40.177000046 17766.0
dtype: float64
Main features
- Connect to a TSDB, and check connectivity
- Get a timeserie and store it in a Pandas Series
- Estimate frequency of a timeserie
- Trim a timeserie by date or by size
- Transform the timeserie in a pandas.DataFrame
- Delete a timeserie in a TSDB
- Import a timeserie into a TSDB
- Normalize a timeserie on its frequency
License
Metadata
Release files for felicien 0.8.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| felicien-0.8.1.tar.gz | 8.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| felicien-0.8.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.0 kB
Release files / felicien-0.8.1.tar.gz
| Download URL | felicien-0.8.1.tar.gz |
|---|---|
| Size | 8.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1360304df61b27a4d2ed14d5b29b5e326583114c3d52f8349e8a156796ec4c4c
|
|
BLAKE2b-256 checksum How to use checksums |
82b0d036662159fda6b0bfc3b8acbf3f57125e81bd4390cfffd8ec176101345b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.11.9 Linux/5.15.154+
|
Release files / felicien-0.8.1-py3-none-any.whl
| Download URL | felicien-0.8.1-py3-none-any.whl |
|---|---|
| Size | 9.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a8e2fef96400b579e5de6e7c4417f173a6c36f7b55904df7a439086d987ffc06
|
|
BLAKE2b-256 checksum How to use checksums |
e333e31c1f0b9369d22a200b4bb922ec55bef3059d84ce3863b74d86af923f28
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.11.9 Linux/5.15.154+
|