MPESA Crane API的一个瘦异步包装器。

aiompesa的Python项目详细描述


aiompesa

用于从asyncio访问MPESA Daraja API的包。

用法

importasynciofromaiompesaimportMpesaCONSUMER_KEY="nF4OwB2XiuYZwmdMz3bovnzw2qMls1b7"CONSUMER_SECRET="biIImmaAX9dYD4Pw"loop=asyncio.get_event_loop()mpesa=Mpesa(True,CONSUMER_KEY,CONSUMER_SECRET)token_response=loop.run_until_complete(mpesa.generate_token())access_token=token_response.get("access_token",None)expires_in=token_response.get("expires_in",None)ifaccess_tokenisNone:print("Error: Wrong credentials used to get the access_token")else:print(f"access_token = {access_token}, expires_in = {expires_in} secs")

要求

  • Python3.6+

安装

$ pip install aiompesa

动机

贡献

contribution guidelines

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
使用Java将JSON转换为哈希映射   java如何通过使用MapStruct从源对象复制值来填充目标对象内部的映射?   注入泛型类型为@InjectGuice的类时发生java错误   字符串如何在JavaIDE中导入基本符号   在Java中将JSON转换为List<List<String>>   java Java9 HttpClient SSLHandshakeException   java jOOQ代码生成器   java如何调整图标(图像按钮),使其不会放大?   java我可以在使用Eclipse时安装2个或更多Android SDK吗   sqlite Java实现DAO   如何解决此错误?“java.lang.NoSuchFieldError:org.apache.http.conn.ssl.SSLConnectionSocketFactory上的实例。<clinit>。”   java Maven:将基于OSP的zip文件解压缩到WEBINF/lib   java如何在每次调用函数时获取当前gps位置?