Skip to main content

Ondotori WebStorage API クライアント

Project description

ondotori-client

CI PyPI version License

概要

Ondotori WebStorage API(RTR500B/その他機種)を Python から簡単に操作するクライアントライブラリです。

インストール

pip install ondotori-client
# 開発用依存も入れるなら
pip install .[dev]

Quickstart

DataFrame 出力を使う場合

pip install ondotori-client[dataframe]

典型的な使い方

from ondotori_client.client import OndotoriClient, parse_current, parse_data
import pandas as pd

# — 設定ファイルを使う場合 —
client = OndotoriClient(config="config.example.json", device_type="rtr500", verbose=True)

# — 1. 現在値取得 —
data_cur = client.get_current("CrZnS1")
ts, temp, hum = parse_current(data_cur)
print(f"現在値: {ts}{temp}℃ / {hum}%")

# — 2. 過去指定期間のログ取得 —
res = client.get_data("CrZnS1", dt_from="2025-05-01T00:00:00", dt_to="2025-05-02T00:00:00")
times, temps, hums = parse_data(res)
df = pd.DataFrame({"time": times, "temp": temps, "hum": hums})
print(df.head())

# — 3. 直近300件ログ(または hours=1)を DataFrame で —
df_latest = client.get_data("CrZnS1", hours=1, as_df=True)
print(df_latest.tail())

# — 4. アラートログ取得 —
alerts = client.get_alerts("CrZnS1")
print(alerts)

License

MIT © Hiroki Tsusaka

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

ondotori_client-0.2.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

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

ondotori_client-0.2.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file ondotori_client-0.2.0.tar.gz.

File metadata

  • Download URL: ondotori_client-0.2.0.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for ondotori_client-0.2.0.tar.gz
Algorithm Hash digest
SHA256 da3edcf176ab1e0919c48608ed63b2cc498f45c4dbbfbc2d0494486c348967f9
MD5 916b3dafefbfa6a169565c5df057d13d
BLAKE2b-256 438dffea86731107bf59ebd62bab4cda091c85659b5e89553751a137d250a832

See more details on using hashes here.

File details

Details for the file ondotori_client-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ondotori_client-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 38c8f3ddc2721296d0591d3f28977c22fb495e40bf639f8bea69605da20091c2
MD5 ffe2ebf86b39fa2c1283f530b94122be
BLAKE2b-256 1f740b59282b7a5eb5c6b4578771f7f129ffdbad29f8d17a4c6a1a9058cea00c

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