一个用于wwln的简单python api
aiowwlln的Python项目详细描述
aiowwlln:wwln的简单python3包装器
aiowwlln
是一个简单的asyncio
驱动的python库,用于检索
闪电从
the World Wide Lightning Location Network (WWLLNN)。
注意:此库是在非官方api上构建的;因此,它可能停止在 任何时候。
安装
pipinstallaiowwlln
python版本
aiowwlln
当前在上受支持:
- Python3.5
- python 3.6
- Python3.7
但是,运行测试套件当前需要Python3.6或更高版本;测试 在Python3.5上运行将失败。
用法
aiowwlln
从
aiohttpClientSession
:
importasynciofromaiohttpimportClientSessionfromaiowwllnimportClientasyncdefmain()->None:"""Create the aiohttp session and run the example."""asyncwithClientSession()aswebsession:# YOUR CODE HEREasyncio.get_event_loop().run_until_complete(main())
创建一个客户机,初始化它,然后到达它:
importasynciofromdatetimeimportdatetimefromaiohttpimportClientSessionfromaiowwllnimportClientasyncdefmain()->None:"""Create the aiohttp session and run the example."""asyncwithClientSession()aswebsession:client=aiowwlln.Client(websession)# Create a client and get all strike data – by default, data is cached for# 60 seconds (be a responsible data citizen!):client=Client(websession)awaitclient.dump()# If you want to increase the cache to 24 hours, go for it:client=Client(websession,cache_seconds=60*60*24)awaitclient.dump()# Get strike data within a 50 km radius around a set of coordinates (note that# the cache still applies):awaitclient.within_radius(56.1621538,92.2333561,50,unit="metric")# Get strike data within a 10 mile radius around a set of coordinates (note that# the cache still applies):awaitclient.within_radius(56.1621538,92.2333561,10,unit="imperial")# Get strike data within a 50 km radius around a set of coordinates _and_# within the last 10 minutes:awaitclient.within_radius(56.1621538,92.2333561,50,unit="metric",window=timedelta(minutes=10))asyncio.get_event_loop().run_until_complete(main())
贡献
- Check for open features/bugs 或者initiate a discussion on one。
- Fork the repository。
- 安装开发环境:
make init
。 - 进入虚拟环境:
pipenv shell
- 编写新功能或错误修复代码。
- 编写一个涵盖新功能的测试。
- 运行测试并确保100%的代码覆盖率:
make coverage
- 加入
AUTHORS.md
。 - 提交拉取请求!