Skip to main content

A simple Python client of Hotpepper API

Project description

hotpepper-gourmet-tddschn

PyPI version workflow badge workflow badge

About

Fork of hotpepper-gourmet package on pypi (https://github.com/paperlefthand/hotpepper-gourmet) that uses https instead of http.

ホットペッパーグルメAPIのシンプルなクライアントライブラリです

How To Use

keyidの取得

ホットペッパーグルメAPIに登録し, token(keyid)を取得

サンプルコード

同期版

>>> from pygourmet import Api, Option
>>> api = Api(keyid=YOUR_KEYID)
>>> option = Option(lat=35.170915, lng=136.8793482, keyword="ラーメン", range=4, count=3)
>>> shops = api.search(option)
>>> len(shops)
3
>>> shops[0].name
'shop name'

非同期版

async def call_search_async():
    shops = await api.search_async(option=option)
    print(len(shops))

loop = asyncio.get_event_loop()
loop.run_until_complete(call_search_async())

開発者向けガイド

このリポジトリは uv によるパッケージ管理を採用しています. Python バージョンは 3.12, 3.13, 3.14 をサポート対象としています.

セットアップ

# 依存関係のインストール(開発環境構築)
uv sync

よく使うコマンド

原則として uv run を介して実行します.

# テスト実行
uv run pytest -v

# 統合テスト実行(要 HOTPEPPER_KEYID 環境変数)
# ローカル環境でのみ実行し、APIキーを利用して実際にリクエストを送ります
uv run pytest --run-integration

# 静的型チェック
uv run ty check

# Lint チェック
uv run ruff check .

# コードフォーマット適用
uv run ruff format .

# コミット前チェック(Lint/Format/TypeCheck 等を一括実行)
uv run prek

# API ドキュメント生成
uv run pdoc src/pygourmet

# 特定バージョンの動作確認(tox)
uv run tox -e py314

コーディング規約

  • Style: Ruff 準拠 (4スペースインデント, ダブルクォート, スネークケース). クラス名は PascalCase.
  • Docstring: Google Style.
  • Type: Pydantic v2 を活用し, Any を排除した厳格な型注釈を行う.

テストガイドライン

  • 基本: pytest + pytest-httpx (モック).
  • 統合テスト: @pytest.mark.integration を付与. uv run pytest --run-integration でのみ実行される.
  • 非同期: pytest-asyncio を使用.

コミット・PRガイドライン

  • コミットメッセージは Conventional Commits 形式.
  • コミット前に必ず uv run prek をパスさせること.
  • PR には変更の目的, テスト結果, ドキュメント更新の有無を記載.

CI/CD

  • CI: GitHub Actions + tox-uv (Python 3.12, 3.13, 3.14).
  • TestPyPI: dev ブランチへの push で自動デプロイ.
  • PyPI / Docs: v* タグ (例: v1.0.0) の push で本番リリースおよび GitHub Pages 更新.

セキュリティ

  • API Key (HOTPEPPER_KEYID) は絶対コミットしない.
  • ローカル開発では .env を利用する (python-dotenv 対応).

Powered by ホットペッパー Webサービス

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

hotpepper_gourmet_tddschn-0.0.7.tar.gz (69.5 kB view details)

Uploaded Source

Built Distribution

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

hotpepper_gourmet_tddschn-0.0.7-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file hotpepper_gourmet_tddschn-0.0.7.tar.gz.

File metadata

  • Download URL: hotpepper_gourmet_tddschn-0.0.7.tar.gz
  • Upload date:
  • Size: 69.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for hotpepper_gourmet_tddschn-0.0.7.tar.gz
Algorithm Hash digest
SHA256 ecca6350f2dd82991fa50be85448cb346b9a14a215e8da0a1204d27fac12a99b
MD5 6b7c30a7d960812c9d36b54135283850
BLAKE2b-256 3a2e80600e65ba76b631bcd178bcc3d94c6b1b21199338f392e98f293d695647

See more details on using hashes here.

File details

Details for the file hotpepper_gourmet_tddschn-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: hotpepper_gourmet_tddschn-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for hotpepper_gourmet_tddschn-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 332450d62d31b0ee97afb8c3b993406dd0cb6237414ea23fdab61e506adf938c
MD5 b4c9ea2b3a66ae30cf169ba354ee5f11
BLAKE2b-256 71a71516f1fc82159e3f17a0ea744f54894c805067d3528d9bec7a7a0bcda262

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