ReagentX / purple_air_api

Python package to get and transform PurpleAir data
https://pypi.org/project/purpleair/
GNU General Public License v3.0
50 stars 19 forks source link

Custom Time Range for get_historical #71

Closed thomastu closed 3 years ago

thomastu commented 3 years ago

Motivation

Currently, get_historical collects some number of weeks of data relative to "today". There could be special events which would motivate collecting data from specific sensors on/around specific dates. The following would support this use case:

Thank you for all your work on this wrapper, it has saved a lot of time.

ReagentX commented 3 years ago

It should be fairly trivial to parametrize the start date, so the user can provide an optional start date as well as the number of weeks to go back.

https://github.com/ReagentX/purple_air_api/blob/df0d7cdb109aea9c2e0b71e798cef3e52d8d6b50/purpleair/channel.py#L176-L179