Code Monkey home page Code Monkey logo

qualr.py's Introduction

qualR.py

This is qualR package python flavored. It will help you to bring CETESB QUALAR data to your python session.

Installation

You can install qualRpy by cloning this repository and install it via pip:

git clone https://github.com/quishqa/qualR.py.git
pip install .

Or you can install it directly from this repository by doing:

pip install git+https://github.com/quishqa/qualR.py.git

Example of use

Downloading ozone information from Pinheiros air quality station, from January first to january 7th, 2021.

import qualRpy.qualR as qr

user_name = "[email protected]"
my_password = "a_mistery_password"

start_date = "01/01/2021"
end_date = "07/01/2021"

o3_code = 63 # you can check it by qr.cetesb_param()
pin_code = 99 # you can check it by qr.ceteb_aqs()

o3_pin = qr.cetesb_retrieve(
  user_name,
  my_password,
  start_date,
  end_date,
  o3_code,
  pin_code
  )

If you want to download a parameter for multiples station you can use dictionary comprehension. Let says that you want to download all O3 information from all the station, you can do the following:

import qualRpy.qualR as qr

user_name = "[email protected]"
my_password = "a_mistery_password"

start_date = "01/01/2021"
end_date = "07/01/2021"

o3_code = 63 # you can check it by qr.cetesb_param()
aqs = qr.cetesb_aqs() # Loading all the aqs

o3_aqs = {aqs_name: qr.cetesb_retrieve(user_name, my_password,
                                    start_date, end_date,
                                    o3_code, aqs_code)
          for aqs_name, aqs_code in zip(aqs.name, aqs.code)}

Also, you can use pickle to save the data:

import pickle
with open("o3_aqs_data.pickle", "wb") as my_pickle:
  pickle.dump(o3_aqs, my_pickle)

Acknowledgments

Very thankful to CETESB for make this data available and to the awesome LAPAT-IAG team.

qualr.py's People

Contributors

lokamigauti avatar quishqa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

lokamigauti

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.