Skip to main content

Клиент для API rating.chgk.info

Project description

chgk_rating_client

Клиент для API сайта рейтинга спортивного ЧГК с кэшем в Redis или локальных файлах.

Сохраняет почти все неточности и странности API (например, числа остаются строками).

Установка:

pip3 install chgk_rating_client

Использование:

from chgk_rating_client import Rating

client = Rating()

Использование с кэшированием в редисе:

client = Rating(redis_host='localhost')

Использование с кэшированием в локальных файлах:

client = Rating(file_cache=True)

Можно включить и оба одновременно, это же ваши диск и редис.

Теперь можно делать запросы:

rosters = client.tournament_rosters(5773)
player = client.player(40393)

Умной очистки кэша пока нет, поэтому можно удалить либо все записи:

client.clear_cache()

Либо по маске:

client.clear_cache("*rosters*")
client.clear_cache("*40393")

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

chgk_rating_client-1.0.2.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

chgk_rating_client-1.0.2-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file chgk_rating_client-1.0.2.tar.gz.

File metadata

  • Download URL: chgk_rating_client-1.0.2.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.8.0

File hashes

Hashes for chgk_rating_client-1.0.2.tar.gz
Algorithm Hash digest
SHA256 9aaa8a7757f4d1e8dcf2bfe2f2691f504144aa244406f1028740b819c171903a
MD5 5d71c6ae5586426276402e34d004d478
BLAKE2b-256 623db7b2eac1ba46473f4f003f24de8dbf3ccf3578190f95d634724494830e91

See more details on using hashes here.

File details

Details for the file chgk_rating_client-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: chgk_rating_client-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.8.0

File hashes

Hashes for chgk_rating_client-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e09871c95861294d9eabbfe58d8dbda339b1aca7f12b3f4515455d543011ec91
MD5 eebb338880e91f50968e2a321fb9e6df
BLAKE2b-256 0c1afe8931325377f5fe6d5058ec59a9d3cce30c97ff6faa8a3dd86adf89dbe6

See more details on using hashes here.

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