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

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)

(以降、get_dataget_latest_dataget_alerts の例も載せましょう)

Contributing

PR・Issue は大歓迎です!詳細は CONTRIBUTING.md をご覧ください。

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.1.1.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.1.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ondotori_client-0.1.1.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.1.1.tar.gz
Algorithm Hash digest
SHA256 2feac3563823fbf0491607e45f351fcad2b436ca9b179365c27e624eb8f8887b
MD5 c30c789f440d11b6c47ffa288a1d7749
BLAKE2b-256 ade64995d760ca804945fff89fc8c2da3bcdf11a164dfca9ed02aa19942c566e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ondotori_client-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c15813fc474756bb12960d509e47df239ad5ea449152fd32ec874bee94254886
MD5 d8a57eea1944f698cc51f04effcc1e2a
BLAKE2b-256 04bca01920c9923cbbd006d82df07eff32ef79d407081b0bf6b2b8835bc24c34

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