Releases: GLEF1X/glQiwiApi
Releases · GLEF1X/glQiwiApi
Production-ready release 1.0.4
I can say with confidence that this release is completely or almost completely ready for production solutions, except #9, but it will be added as extension a little bit later. 😎
Changes in current release:
- #8 has been fully fixed
- Add sync adapter for synchronous applications source code
QiwiWebHookWebView
andQiwiBillWebView
have been rewritten from scratch using template method pattern source code- All async properties are deprecated now. Instead of it use methods. For example, bill.paid -> bill.check().
- Added class-based handlers
- At all, a lot of work has been done to clean up the source code.
- Docs has been updated to understand how to work with library step by step
Stable release 1.0.3
There are couple of changes from 1.0.3b2:
- The library now fully supports the mypy linter and therefore
BaseFilter
has becomeGeneric
class and so you can use like shown below:
from glQiwiApi import BaseFilter, QiwiWrapper, types
wrapper = QiwiWrapper()
class MyBillFilter(BaseFilter[types.Notification]):
async def check(self, update: types.Notification) -> bool:
return True
async def my_bill_handler(update: types.Notification) -> None:
...
# 2 errors, connected with incorrect type of argument, which accept handler and wrong type of filter
wrapper.dp.register_transaction_handler(my_bill_handler, MyBillFilter())
wrapper.dp.register_bill_handler(my_bill_handler, MyBillFilter()) # It's ok and mypy understand it
- In 1.0.3 you can add shutdown_callback to your
async_as_sync
decorator orsync
function to gracefully shutdown all your resources
Beta release 1.0.3b2
Major changes in the library:
- Fixed bug with poling (earlier update could come 2+ times to the handler)
- Added custom filters similar to
BoundFilter
, but slightly stripped down - The source has become much cleaner, but backward compatibility was not being broken
- Added CI integration based on
github actions
, in accordance with this added support forcodecov
(so far only 80/100%) - Fixed stub files for utilities, namely
api_helper.pyi
- Added 2 glQiwiApi / ext extensions (module ssl_configurator (generation of self-written ssl) and url_builder (simple interface for creating paths for webhooks based on one object))
- The dispatcher now asynchronously processes handlers when pulling and webhooks (it was sequentially without gather)
- Well, from the old versions, small bug fixes
TelegramPollingProxy
andTelegramWebhookProxy
(for polling updates along with aiogram)
Example of use generic filters:
from glQiwiApi import BaseFilter, QiwiWrapper, types
from glQiwiApi.utils import executor
# let's imagine that payload its a dictionary with your tokens =)
wallet = QiwiWrapper(**payload)
class MyFirstFilter(BaseFilter):
async def check(self, update: types.Transaction) -> bool:
return True
class MySecondFilter(BaseFilter):
async def check(self, update: types.Transaction) -> bool:
return False
@wallet.transaction_handler(MyFirstFilter(), lambda event: event is not None, ~MySecondFilter())
async def my_handler(event: types.Transaction):
...
executor.start_polling(wallet)
Stable release 1.0.2
Update README.md
Stable release 1.0.1
Bugfix, connected with incorrect work of QiwiWrapper.commission
method
Stable release 1.0.0
Changelog:
- Builtin integration with aiogram using
TelegramPollingProxy
,TelegramWebhookProxy
- Validating parameters by passing validate_params=True to
QiwiWrapper
- Improved performance of laconic
bill.paid
HttpXParser
,Storage
were rewritten with better approach- Added poetry coverage #3
- Currency parser util was added for effortless work with the currency code
- In this version, the ability to use a proxy(
aiohttp_socks
) has become available - Added client_secret parameter for OAuth2 token verification #5
ContextInstanceMixin
, which allows getting wrappers from anywhere in the program:
from glQiwiApi import QiwiWrapper
wrapper = QiwiWrapper() # added into context
# in another module, function or class
instance = QiwiWrapper.get_current()