Skip to main content

iaeon

iAEON アプリの認証・電子レシート取得・食料在庫管理を行う Python ツールキット。

インストール

pip install iaeon

# レシート画像レンダリングが必要な場合
pip install iaeon[image]

日本語フォント (NotoSansCJK) がシステムにインストールされていると、レシート画像が正しくレンダリングされる。

# Debian/Ubuntu
sudo apt install fonts-noto-cjk

セットアップ

1. ログイン

iaeon-login で iAEON アカウントにログインし、アクセストークンを .env に保存する。

# 対話式
iaeon-login

# 引数で指定
iaeon-login --phone 09012345678 --password yourpassword

認証フロー:

  1. 電話番号 + パスワードでログイン
  2. SMS認証コードの送信・検証 (新デバイス時)
  3. アクセストークン取得 → .env に保存

2. .env ファイル

ACCESS_TOKEN="..."
DEVICE_ID="bf533bf5-..."
RECEIPT_ACCOUNT_ID="..."
GOOGLE_API_KEY=""
GOOGLE_SEARCH_ENGINE_ID=""
  • RECEIPT_ACCOUNT_ID は電子レシート機能に必要。iAEON アプリの通信から取得する。
  • GOOGLE_API_KEY / GOOGLE_SEARCH_ENGINE_ID は商品情報検索用 (任意)。未設定でもローカルキーワードマッチで動作する。

電子レシート

from iaeon.receipt import IAEONReceiptClient

client = IAEONReceiptClient(
    access_token="...",
    receipt_account_id="...",
)

# レシート一覧取得 (デフォルト: 今月)
receipts = client.list_receipts()

for r in receipts:
    print(f"{r.datetime}  {r.store_name}  ¥{r.total}")

    # レシート詳細取得
    detail = client.get_receipt_detail(r.receipt_id)

    # 画像として保存
    path = client.save_receipt_image(detail, output_dir="receipts")
    print(f"保存: {path}")

日付範囲を指定

receipts = client.list_receipts(from_date="20260101", to_date="20260131")

レンダリングオプション

img = IAEONReceiptClient.render_receipt_image(
    detail,
    font_size=18,
    width=580,
    padding=20,
    bg_color="white",
    text_color="black",
)
img.save("receipt.png")

食料在庫管理

レシートから購入した食品を自動パースし、SQLite DB に登録して在庫管理する。

CLI

# レシートから食料をインポート (デフォルト: 今月)
iaeon-inventory import

# 日付範囲を指定
iaeon-inventory import --from-date 20260201 --to-date 20260213

# 在庫一覧
iaeon-inventory stock

# 期限切れ間近の在庫 (デフォルト: 3日以内)
iaeon-inventory expiring
iaeon-inventory expiring --days 7

Python API

from iaeon.inventory import FoodInventoryDB

db = FoodInventoryDB()

# 在庫一覧
items = db.get_in_stock_items()
for item in items:
    print(f"{item['name']} x{item['total_quantity']} [{item['category']}]")

# 期限切れ間近
expiring = db.get_expiring_soon(days=3)

# 消費済みにマーク
db.mark_consumed("明治おいしい牛乳", count=1)

db.close()

商品分類

2段階で商品を自動分類する:

  1. ローカルキーワードマッチ — 商品名から即座に分類 (API不要)
  2. Google Custom Search API — ローカルで判定できない場合に Web 検索 (要API設定)

API リファレンス

IAEONAuth

メソッド 説明
full_login(phone, password) 完全なログインフロー (対話式、SMS入力あり)
login(phone, password) ログイン。SMS認証が必要な場合 code 10021/10008 を返す
request_sms() SMS認証コード送信リクエスト
verify_sms_code(auth_code) SMS認証コード検証
login_token() Bearer トークン取得
get_access_token(client_id?) サービス用アクセストークン取得

IAEONReceiptClient

メソッド 説明
list_receipts(from_date?, to_date?) レシート一覧を ReceiptSummary のリストで返す
get_receipt_detail(receipt_id) レシート詳細を ReceiptDetail で返す
get_store_info(store_code) 店舗情報の dict を返す
render_receipt_image(detail, ...) レシートを PIL.Image にレンダリング (staticmethod)
save_receipt_image(detail, output_dir, ...) レシート画像を PNG で保存
save_embedded_images(detail, output_dir) 埋め込み画像を個別保存

FoodInventoryDB

メソッド 説明
import_receipt(receipt, product_infos?) レシート全体を DB にインポート
get_in_stock_items() 在庫一覧を返す
get_expiring_soon(days=3) 期限切れ間近の在庫を返す
mark_consumed(product_name, count=1) 在庫を消費済みにマーク

ライセンス

MIT

Metadata

Release files for iaeon 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for iaeon 0.1.0
File Size Uploaded Provenance
iaeon-0.1.0.tar.gz 23.7 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for iaeon 0.1.0
File Interpreter ABI Platform
iaeon-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 51.9 kB

Release files / iaeon-0.1.0.tar.gz

Download URL iaeon-0.1.0.tar.gz
Size 23.7 kB
Tags Source
SHA-256 checksum
How to use checksums
7ef6e2c2bff5c9140ad1cfa22f9f91ab6d0ff8ea4369b4a56a2ad1ae12e87262
BLAKE2b-256 checksum
How to use checksums
6585fbb9123875a84a384dedd6763974866f3f75ecedf2393fbe1ce2aa9f7052
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 12, 2026.

Transparency log

Release files / iaeon-0.1.0-py3-none-any.whl

Download URL iaeon-0.1.0-py3-none-any.whl
Size 28.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e7d73231f196537b77b8343c5a75f86bd8a9d6081c35c6e66e584572746e0797
BLAKE2b-256 checksum
How to use checksums
72c4b220ed7d2e59bb55ad486eb1567e06321ccf7ee20b36a19fe995b75dc2c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 12, 2026.

Transparency log

Security for iaeon 0.1.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for iaeon-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 12, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page