Skip to main content

Felicien is you companion to retrieve timeseries from a TSDB, to transform it in various format and to push it to a TSDB.

Project description

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

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

felicien-0.7.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

felicien-0.7.0-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file felicien-0.7.0.tar.gz.

File metadata

  • Download URL: felicien-0.7.0.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.9 Linux/5.15.154+

File hashes

Hashes for felicien-0.7.0.tar.gz
Algorithm Hash digest
SHA256 f2b0f0d02bbe6929b152a15c8685d46b69114feacc896590e61a0daf0cdfaea6
MD5 0d90d92e316692bc0ee17410f1a6a3d5
BLAKE2b-256 9fd725e76319490bf571f0ed790edcc57055799e371cee78c506abea67359d82

See more details on using hashes here.

File details

Details for the file felicien-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: felicien-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.9 Linux/5.15.154+

File hashes

Hashes for felicien-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eec47189c31b46d25efcc5007126f64daad446b76d55c8ae35fa1ea26fafa5cf
MD5 1c1b749cf929f6f6e28fe5fb1cf4f4f0
BLAKE2b-256 1cc9e604e1930783ba033eafa78d9334f397f3fceebbb7b338465b25d33f1240

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page