昆士兰丛林火灾警报feed的georss客户端库。

georss-qld-bushfire-alert-client的Python项目详细描述


python georss qld bushfire警报客户端

Build StatusCoverage StatusPyPiVersion

这个库提供了对Queensland Bushfire Alert Feed的方便访问。

安装

pip install georss-qld-bushfire-alert-client

用法

有关如何使用此库的示例,请参见下文。实例化后 feed类并提供所需的参数,您可以调用update 检索提要数据。返回值将是状态代码的元组,并且 以特定提要条目列表形式显示的实际数据。

状态代码

  • update_ok:更新进行得很顺利,并检索到数据。库可能仍然返回空数据,例如,因为没有符合筛选条件的条目。
  • update_ok_no_data:更新正常,但未检索到数据,例如,服务器指示自上次请求以来没有更新。
  • update_error:更新过程中出错

支持的筛选器

FilterDescription
Radius^{}Radius in kilometers around the home coordinates in which events from the feed are included.
Categories^{}Array of category names. Only events with a category matching any of these are included.

示例

fromgeorss_qld_bushfire_alert_clientimportQldBushfireAlertFeed# Home Coordinates: Latitude: -27.5, Longitude: 153.0# Filter radius: 50 km# Filter categories: 'Advice'feed=QldBushfireAlertFeed((-27.5,153.0),filter_radius=50,filter_categories=['Advice'])status,entries=feed.update()

馈送条目属性

每个feed条目都填充了以下属性- 乔治斯订阅源中的可用性:

NameDescription
geometryAll geometry details of this entry.
coordinatesBest coordinates (latitude, longitude) of this entry.
external_idExternal id of this entry.
titleTitle of this entry with textual description of location.
categoryCategory of this entry.
attributionAttribution from feed.
distance_to_homeDistance in km of this entry to the home coordinates.
descriptionFull content of this entry.
publishedPublished date of this entry.
updatedUpdated date of this entry.
statusStatus of alert, e.g. "Patrolled", "Going", "Contained"

饲料管理器

feed管理器通过通知 feed的使用者关于新的feed条目、更新和删除的条目 与上次源更新相比。

  • 如果当前的feed更新是第一个,那么所有feed条目都将是 报告为新的。提要管理器将跟踪所有提要条目' 已成功处理的外部ID。
  • 如果当前的feed更新不是第一次更新,那么feed管理器将 生产三套:
    • 不在上一个提要更新中但在 当前源更新将报告为新的。
    • 在上一个提要更新中仍在 当前源更新将报告为待更新。
    • 在上一个提要更新中但不在 当前源更新将被报告为已删除。
  • 如果当前更新失败,则前一个更新中处理的所有feed条目 将报告要删除源更新。

从feed成功更新后,feed管理器将提供两个 不同日期:

  • last_update将是 喂。如果此库的用户希望 以不同的方式处理源更新中的间歇性错误。
  • last_timestamp将是从feed数据中提取的最新时间戳。 这要求底层的feed数据实际上包含一个合适的 日期。如果此库的用户希望 如果feed条目没有实际更新,则处理方式会有所不同。

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

推荐PyPI第三方库


热门话题
java使用servlet的正确方法是什么?   java Android ListView选中所有复选框(自定义ResourceCursorAdapter)   java如何在一个活动中正确处理多个片段交互侦听器?   java jUnit和忽略继承的测试   具有多个权限的java ActivityResultLauncher   Java:我可以通过应用程序将客户端重定向到loadbalancer后面的同一个会话/节点吗?   java如何使用Hibernate保存具有一对一关系的两个类?   java JEditorPane字体大小设置不准确   java为什么JUnit4导入不被识别,即使JUnit4在我的有效pom中。xml?   多次使用流后的java空映射   JavaSwing中AccessibleContext的用途是什么?   java指定使用T的类   java查找twitter4j转发速率限制   枚举的Java数组(类)   java通过Maven build排除了一些类