Skip to main content

sakepedia: Sakepedia API

Project description

Sakepedia

SakepediaのAPIをプログラムから利用しやすくするためのPythonSDK

Sakepediaはみんなでつくる日本酒オープンデータです。 Nuxt.js版が以下で稼働しています。

https://sakepedia.code4sake.org/

このサイトのAPIにPythonからアクセスするパッケージです。

機能

  • 酒蔵データの取得
  • 銘柄データの取得
  • 日本酒データの取得、更新、登録

更新および登録には、Sakepediaへのユーザー登録とJWTの発行が必要です。 JWTの有効期限にご注意ください。

使用方法

日本酒データの登録、既にあれば更新

JWT = "JWT issued with your own Sakepedia account"
api = sakepedia.SakepediaAPI(JWT)

sake = sakepedia.SakeData()
sake.brewery = "test brewery"
sake.brand =  "test brand"
sake.url = "https://testbrewery.co.jp/testbrand/sake"
sake.name = "test sake bottle"
sake.description = "test description"

res = api.saveSakeData(sake)

パッケージのビルドとアップロード

# pip install twine
# pip install wheel
# rm -rf dist/*
# python setup.py sdist
# python setup.py bdist_wheel
# twine upload --repository testpypi dist/*
# twine upload --repository pypi dist/*

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

sakepedia-0.1.1.tar.gz (4.1 kB view hashes)

Uploaded Source

Built Distribution

sakepedia-0.1.1-py3-none-any.whl (4.5 kB view hashes)

Uploaded Python 3

Supported by

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