一个用于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如何将外部库(LIB)集成到grails项目中?   java 安卓:progressTintMode、安卓:secondaryProgressTintMode和安卓:progressDrawable做什么?   java获得了启动播放器的精确方向   java如何在布局/样式XML中设置状态栏着色颜色?   Java中的图形游戏未显示   java如何在WebSphere8.5.5中的我的JAAS自定义登录模块中使用SAML令牌属性值   使用jackson spring API解析嵌套json   java如何从用户请求中获取用户代理?   Netbeans 6.8中的java UI控件定位   java显示listgrid中两个表中的数据   java Google Cloud Bigtable客户端连接池   Vert中的java更改日志级别。通过添加一个配置文件   java调用构造函数是否意味着创建实例?   java getFrom()[0])中[0]用于获取邮件发件人地址的用法是什么   “继续”标志的java Gradle属性?   jakarta ee如何在java ee中创建GUID   java不兼容类型:无法将int转换为整数   java需要借助DefaultHandler的characters函数将XML数据读入安卓应用程序   java mapstruct将方法应用于列表中的所有对象