CCWrapper (v 1.0.0)
CCWrapper - это python модуль для упрощённой работы с CatCoin API
- Сам модуль (python3)
Установка модуля
- Через pip из Pypi
pip install ccwrapper
- Через pip из GitHub
pip install https://github.com/Duzive/ccwrapper/archive/master.zip --upgrade
Работа с модулем
Быстрый старт
Для начала создадим экземпляр основного класса
from ccwrapper import CatCoinWrapper
Wrapper = CatCoinWrapper(user_id = 12345678, token = "your_token")
user_id- Ваш ID Вконтактеtoken- Ключ CatCoin Api(получаем здесь)
Использование
--> make_transfer
Выполнить перевод CatCoin с вашего кошелька на другой
Python
Wrapper.make_transfer(toid = 12345678, amount = 2, mark = 1)
toid- id получателяamount- сумма переводаmark- отображать название магазина в переводе(по умолчанию: 0)
--> get_users_score
Вывод баланса пользователя
Python
Wrapper.get_users_score(user_ids = [12345678])
user_ids- id пользователей, баланс которых нужно получить(обязательно массив)
--> get_transfer_history
Получить историю переводов
Python
Wrapper.get_transfer_history(tx = 2)
tx- парамент вывода истории переводов(по умолчанию: 1)
--> set_shop_name
Установить новое название магазина
Python
Wrapper.set_shop_name(new_name = 'RadMate Shop')
new_name- новое название
--> set_callback
Установить новый callback-сервер Учтите, ваш сервер должен вернуть 'YES'
Wrapper.set_callback(callback_url = "https:/radmate.ru/server")
callback_url- адрес нового сервера
--> get_lost_transfer
Получить пропущенные переводы по callback
Wrapper.get_lost_transfer()
- аргументы не требуются
--> LongPolling
модуль также нативно поддерживает простой LongPolling Для этого используется отдельный класс "CCPoll" с передачей экземпляра класса "CatCoinWrapper"
from ccwrapper import CCPoll
for payment in CCPoll(Wrapper).listen(sleep = 5):
user_id = payment["id"]
amount = payment["amount"]
payload = payment["payload"]
print(f'Получен платёж на сумму: {amount}, от @id{user_id}, payload: {payload}')
sleep- период проверки платежей(по умолчанию: 3)
Дополнительно
- Разработчик
- Официальная документация
- Буду рад ❤️
Metadata
Release files for ccwrapper 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ccwrapper-1.0.0.tar.gz | 4.0 kB | Without provenance | Details for ccwrapper-1.0.0.tar.gz |
Release files / ccwrapper-1.0.0.tar.gz
| Download URL | ccwrapper-1.0.0.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9fc1386fa2ecfc9008d716995adc31d4922860a2e68e50a1e5bbed1fff1120e2
|
|
BLAKE2b-256 checksum How to use checksums |
4f5be6d0f5c62ecde91e7de94662445ba96925b561b1747d6287a69eadc0b3a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.6.2
|
Security for ccwrapper 1.0.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.