跳转到主要内容

使用aiohttp从openexchangerates获取汇率。

项目描述

aioopenexchangerates

CI Status Documentation Status Test coverage percentage

Poetry Ruff pre-commit

PyPI Version Supported Python versions License


文档: https://aioopenexchangerates.readthedocs.io

源代码: https://github.com/MartinHjelmare/aioopenexchangerates


使用aiohttp从openexchangerates获取汇率。

安装

通过pip(或您喜欢的包管理器)安装此软件

pip安装aioopenexchangerates

用法

import asyncio

from aioopenexchangerates import Client, OpenExchangeRatesError


async def main() -> None:
    """Run main."""
    async with Client("your_api_key") as client:
        try:
            result = await client.get_latest()
        except OpenExchangeRatesError as err:
            print(err)
        else:
            print(result)


if __name__ == "__main__":
    asyncio.run(main())

致谢

此软件包是用Copierbrowniebroke/pypackage-template项目模板创建的。

项目详情


下载文件

下载适用于您平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。

源分发

aioopenexchangerates-0.6.6.tar.gz (8.6 kB 查看哈希值)

上传时间

构建分发

aioopenexchangerates-0.6.6-py3-none-any.whl (9.4 kB 查看哈希值)

上传时间 Python 3

支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面