diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f59a476..53bc159 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,8 +1,8 @@ -# Contributing to Ozon3 +# Contributing to Ozone :tada::+1: First off, thanks for taking the time to contribute! :tada::+1: -The following is a set of guidelines for contributing to [Ozon3](https://github.com/Milind220/Ozone). These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request. +The following is a set of guidelines for contributing to [Ozone](https://github.com/Milind220/Ozone). These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request. > **Note:** One very important thing is to make sure you only make PR's to the `dev` branch and not the `main` branch. The main branch is stable and should not be modified unless there's a new release. @@ -30,7 +30,7 @@ The following is a set of guidelines for contributing to [Ozon3](https://github. ## What should I know before I get started? ### File Structure -Ozon3 is currently an extremely simple package. +Ozone is currently an extremely simple package. * The package itself is in the ```src/ozone``` directory. * [ozone.py](https://github.com/Milind220/Ozone/tree/main/src/ozone/ozone.py) contains the Ozone class that does most of the fetching of the data. * [urls.py](https://github.com/Milind220/Ozone/tree/main/src/ozone/urls.py) contains a URLs class with the API endpoints and base urls. @@ -61,7 +61,7 @@ Consider providing additional context by answering these questions: * **Did the problem start happening recently** (e.g. after updating to a new version of Ozon3) or was this always a problem? * **Can you reliably reproduce the issue?** If not, provide details about how often the problem happens and under which conditions it normally happens. -* **Which version of Ozon3 are you using?** +* **Which version of Ozon3 are youeusing?** ### Suggesting Enhancements or Features diff --git a/setup.cfg b/setup.cfg index 880abae..4c15d78 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = ozon3 -version = 1.2.1 +version = 1.2.2 author = Milind Sharma author_email = milindsharma8@gmail.com description = A package to get air quality data using the WAQI API diff --git a/setup.py b/setup.py index 5eddf5f..6522293 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ description="A package to get air quality data using the WAQI API", license="GPLv3+", url="https://github.com/Milind220/Ozone", - version="1.2.1", + version="1.2.2", download_url="https://github.com/Milind220/Ozone/archive/refs/tags/v1.1.0.tar.gz", packages=setuptools.find_packages(), install_requires=[ diff --git a/src/ozone/ozone.py b/src/ozone/ozone.py index dd67c80..b6782a9 100644 --- a/src/ozone/ozone.py +++ b/src/ozone/ozone.py @@ -1,3 +1,16 @@ +"""Ozone module for the Ozone package. + +This module contains the main Ozone class, which is used for all live-data +collection done by the Ozone package. + +This module should be used only as a part of the Ozone package, and should not +be run directly. + +Attributes (module level): + CALLS (int=1000): The number of calls per second allowed by the WAQI API is 1000. + RATE_LIMIT (int=1): The time period in seconds for the max number of calls is 1 second. +""" + import pandas import numpy import requests @@ -8,11 +21,20 @@ from typing import Any, Dict, List, Union, Tuple # 1000 calls per second is the limit allowed by API -CALLS = 1000 -RATE_LIMIT = 1 +CALLS: int = 1000 +RATE_LIMIT: int = 1 class Ozone: + """Primary class for Ozone API + + This class contains all the methods used for live data collection. + This class should be instantiated, and methods should be called from the + instance. + + Attributes: + token (str): The private API token for the WAQI API service. + """ _search_aqi_url: str = URLs.search_aqi_url _find_stations_url: str = URLs.find_stations_url _default_params: List[str] = [ @@ -32,6 +54,11 @@ class Ozone: ] def __init__(self, token: str = ""): + """Initialises the class instance and sets the API token value + + Args: + token (str): The users private API token for the WAQI API. + """ self.token: str = token self._check_token_validity() diff --git a/src/ozone/urls.py b/src/ozone/urls.py index 93052be..ed8da8b 100644 --- a/src/ozone/urls.py +++ b/src/ozone/urls.py @@ -1,3 +1,10 @@ +"""urls module for the Ozone package. + +This module contains the URLs dataclass for the package. + +It should only be used with the Ozone package and not run directly. +""" + from dataclasses import dataclass @@ -6,7 +13,15 @@ # endpoint urls stored here. @dataclass(frozen=True) class URLs: - + """Class that contains the endpoint urls for the WAQI API + + This class should not be instantiated. It only contains class level attributes, + and no methods at all. It is a static dataclass. + + Attributes: + search_aqi_url (str): The endpoint used for retrieving air quality data. + find_stations_url (str): The endpoint used for retrieving a collection of air quality measuring stations. + """ # Base API endpoint. _base_url: str = "https://api.waqi.info/"