Библиотека для работы с "api" сервиса bestchange.ru
Project description
BestChange API
Эта библиотека для работы с "api" сервиса bestchange.ru предоставит Вам возможность получить:
- курсы со всех направления;
- валюты;
- обменные пункты;
- города;
- а так же кеширование всех этих данных.
Установка:
pip install bestchange-api
Пример использования:
from bestchange_api import BestChange
api = BestChange()
exchangers = api.exchangers().get()
dir_from = 93
dir_to = 42
rows = api.rates().filter(dir_from, dir_to)
title = 'Exchange rates in the direction (https://www.bestchange.ru/index.php?from={}&to={}) {} : {}'
print(title.format(dir_from, dir_to, api.currencies().get_by_id(dir_from), api.currencies().get_by_id(dir_to)))
for val in rows[:3]:
print('{} {}'.format(exchangers[val['exchange_id']]['name'], val))
Все методы, реализованные на данный момент:
from bestchange_api import BestChange
api = BestChange(cache=True, cache_seconds=300, cache_path='/home/user/tmp/')
api.currencies().get() # Получить список всех валют
api.currencies().get_by_id(1) # Получить название или словарь определенной валюты
api.currencies().search_by_name('text') # Поиск валют по подстроке
api.exchangers().get() # Получить список всех обменных пунктов
api.exchangers().get_by_id(1) # Получить название или словарь обменного пункта
api.exchangers().search_by_name('text') # Поиск обменных пунктов по подстроке
api.cities().get() # Получить список всех городов
api.cities().get_by_id(1) # Получить название или словарь города
api.cities().search_by_name('text') # Поиск городов по подстроке
api.rates().filter(1, 2) # Возвращает курсы, отфильтрованный и отсортированных по направлению
Спасибо за внимание.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bestchange_api-1.0.0.3.tar.gz.
File metadata
- Download URL: bestchange_api-1.0.0.3.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9b864adf25b10ff78eab2f7cf2d4940ac63f98991b877206e287bc73faa70cb
|
|
| MD5 |
74d85b76cb40e25803e24e807725d41d
|
|
| BLAKE2b-256 |
2823cd949543e74672f33349c5706ad5077970f7bf0354abd490f1f6ad25782a
|
File details
Details for the file bestchange_api-1.0.0.3-py3-none-any.whl.
File metadata
- Download URL: bestchange_api-1.0.0.3-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
282a7c8f3de2257787f5c16275aa88e90fee583c964d134cc0ebbacbcbbe45ee
|
|
| MD5 |
5daddc23327db8589b14fcade677767b
|
|
| BLAKE2b-256 |
419fe618c4f874b94365033ab7420855d40bcabff7fa26dce823e98e567a4714
|