Coder Social home page Coder Social logo

pm25's Introduction

pm25

  • 通过 BeautifulSoup 解析pm2.5网站上的数据
  • 只支持Python2

安装

$ sudo pip install pm25

依赖

BeautifulSoup

支持城市列表

  • 所有城市
  • 注意:宿州请输入suzhoushi,苏州请输入suzhou

使用方法

>>> import pm25
>>> print pm25.get('beijing')['time']
更新:03-10 10:00 
>>> print pm25.get('beijing')['AQI']
[u'114', u'102', u'102', u'93', u'89', u'97', u'99', u'104', u'95', u'74', u'67', u'77', u'97']
>>> print pm25.get('beijing')[u'监测点'][0]
美国大使馆

返回值结构

  • time —— 字符串;数据发布时间
  • 监测点 —— 字符串列表;所有监测点,注意获取数据时候要加u,比如pm25.get('beijing')[u'监测点']
  • AQI —— 字符串列表;所有监测点对应的AQI
  • 质量状况 —— 字符串列表;所有监测点对应的质量状况
  • PM2.5浓度 —— 字符串列表;所有监测点对应的PM2.5浓度
  • now —— 字符串;当前空气质量

协议

基于WTFPL协议开源。

pm25's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.