一个用于wwln的简单python api

aiowwlln的Python项目详细描述


aiowwlln:wwln的简单python3包装器

Travis CIPyPiVersionLicensecodecovMaintainabilitySay Thanks

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上运行将失败。

用法

aiowwllnaiohttpClientSession

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())

贡献

  1. Check for open features/bugs 或者initiate a discussion on one
  2. Fork the repository
  3. 安装开发环境:make init
  4. 进入虚拟环境:pipenv shell
  5. 编写新功能或错误修复代码。
  6. 编写一个涵盖新功能的测试。
  7. 运行测试并确保100%的代码覆盖率:make coverage
  8. 加入AUTHORS.md
  9. 提交拉取请求!

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

推荐PyPI第三方库


热门话题
java如何在springboot mongodata中使用$in运算符   多线程从等待线程Java释放资源   选择的java DropdownChoice与模型值不同,在ajax更新时更改   java在缓存spring中存储值   java在包资源管理器中突出显示文件   java将double[]转换为不可变列表的成本更低的方法   java Joda DateTimeFormat根据默认语言环境切换“MM”和“dd”的位置   ElasticSearch中的java嵌套搜索不起作用?   java SpringBoot@Scheduled Cron表达式在两个任务之间产生轻微延迟?   Spring应用程序中Tomcat mysql连接池的java动态选择目录   未为modal中的前两个字段发送java密钥   java如何在处理过程中使用循环排列打印的数字?i、 从10秒到100秒的e.x和y轴   java如何使用@ManyToMany审核@JoinTable   java如何防止JSESSIONID显示在URL中   JavaSpringSecurity5Always302