diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 99b07a5..53ffc73 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,6 +1,6 @@ --- name: Bug report -about: 'Create a report to help Ozone improve. Treat this template more as a guide +about: 'Create a report to help Ozon3 improve. Treat this template more as a guide to filing a good issue, rather than something you have to fill completely every time.' title: "[BUG]" labels: bug @@ -27,7 +27,7 @@ If applicable, add screenshots to help explain your problem. **Environment** - OS: [e.g. MacOS] - Python version [e.g. 3.9.12] - - Ozone Version [e.g. 1.7.1] + - Ozon3 Version [e.g. 1.7.1] - Execution Environment [e.g. Jupyter Notebook] **Additional context** diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 2d0116e..5f3ccd0 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,6 +1,6 @@ --- name: Feature request -about: Suggest an idea for a feature/enhancement for Ozone. +about: Suggest an idea for a feature/enhancement for Ozon3. title: '[FEAT]' labels: 'enhancement' assignees: '' diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml index 885b38f..396225d 100644 --- a/.github/workflows/greetings.yml +++ b/.github/workflows/greetings.yml @@ -12,5 +12,5 @@ jobs: - uses: actions/first-interaction@v1 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - issue-message: 'Hey! Thanks for creating your first issue on Ozone!' - pr-message: 'Awesome work with your first PR for Ozone! We will review your PR soon :)' + issue-message: 'Hey! Thanks for creating your first issue on Ozon3!' + pr-message: 'Awesome work with your first PR for Ozon3! We will review your PR soon :)' diff --git a/.github/workflows/package-publish.yml b/.github/workflows/package-publish.yml index 9e7c8d7..92a6b43 100644 --- a/.github/workflows/package-publish.yml +++ b/.github/workflows/package-publish.yml @@ -1,6 +1,6 @@ # This is a basic workflow to help you get started with Actions -name: Workflow to publish Ozone on PyPI and TestPyPI +name: Workflow to publish Ozon3 on PyPI and TestPyPI # Controls when the workflow will run on: diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 3c80c60..87c9990 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,11 +1,11 @@ # Code Of Conduct -All members of the Ozone community should try to follow this **Code of Conduct**: +All members of the Ozon3 community should try to follow this **Code of Conduct**: * Encourage constructive discourse and new contributors. -* Encourage the discussion of new ideas about features and enhancements as long as they don't go against the goal of Ozone +* Encourage the discussion of new ideas about features and enhancements as long as they don't go against the goal of Ozon3 to be the most effective package for fetching air quality data. * Have a fun time. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7cf4129..1cba992 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,10 +1,10 @@ -# Contributing to Ozone +# Contributing to Ozon3 :tada::+1: First off, thanks for taking the time to contribute! :tada::+1: It might not be obvious but we appreciate all forms of contribution. -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. Feel free to propose changes to this document in a pull request. +The following is a set of guidelines for contributing to [Ozon3](https://github.com/Ozon3Org/Ozon3). These are mostly guidelines, not rules. Use your best judgment. Feel free to propose changes to this document in a pull request. > **Important note:** Make sure you make PRs to `dev` branch, not `main`. See [below](#making-a-pull-request) for more information. @@ -36,7 +36,7 @@ The following is a set of guidelines for contributing to [Ozone](https://github. ### Reporting bugs -1. Before submitting a bug report, make sure to do a cursory search on [issues](https://github.com/Milind220/Ozone/issues) to see if it's already reported. If it's already reported, add a comment under the issue thread instead of opening a new one. +1. Before submitting a bug report, make sure to do a cursory search on [issues](https://github.com/Ozon3Org/Ozon3/issues) to see if it's already reported. If it's already reported, add a comment under the issue thread instead of opening a new one. 2. Use clear and descriptive title. @@ -45,7 +45,7 @@ The following is a set of guidelines for contributing to [Ozone](https://github. - **Expected behavior**: What do you expect should happen? - **Actual behavior**: What actually happened and why it's a problem? - **Steps to reproduce the problem**. Be very specific. Give example code block. Other contributors want to run it in their device to make sure they see what you saw. Having detailed steps and examples can make it easier to demonstrate and track down a problem. - - **Version information**: What version of Python you're using? What version of Ozone? Do you install through `pip` or by cloning the Github repository? What is your OS and what version? + - **Version information**: What version of Python you're using? What version of Ozon3? Do you install through `pip` or by cloning the Github repository? What is your OS and what version? You can include screenshots/GIFs, if relevant. @@ -53,20 +53,20 @@ Additionally, you can also confirm other people's bug report by running their pr ### Suggesting enhancements/features -1. Before submitting a feature suggestion, make sure to do a cursory search in [issues](https://github.com/Milind220/Ozone/issues) to see if it's already suggested. +1. Before submitting a feature suggestion, make sure to do a cursory search in [issues](https://github.com/Ozon3Org/Ozon3/issues) to see if it's already suggested. 2. Use clear and descriptive title. 3. Lay out the details of your suggestion in the body issue. Make sure to also: - Describe the current behavior and explain what would you like to see instead. - - Explain why your suggestion would be useful for Ozone users. + - Explain why your suggestion would be useful for Ozon3 users. ### Making a pull request You can also make a pull request to fix an existing bug or add a feature. -Unsure where to begin contributing to Ozone? You can start by looking through these `first-contribution`, `beginner`, `help-wanted` issues: +Unsure where to begin contributing to Ozon3? You can start by looking through these `first-contribution`, `beginner`, `help-wanted` issues: * `first-contribution` issues should only require a few lines of code or are improvements on the documentation. * `beginner` issues are a step up, and may involve a couple of methods/tests. @@ -99,7 +99,7 @@ Hold my beer, I got this 4. Set original repository as `upstream` remote. ```sh - git remote add upstream https://github.com/Milind220/Ozone.git + git remote add upstream https://github.com/Ozon3Org/Ozon3.git ``` 5. Pull from original repository to make sure you're synced up. @@ -145,13 +145,13 @@ Hold my beer, I got this > It's normal for pre-commit to take some time. - > When Black reformats a staged file, the pre-commit will fail. It is normal and expected. See [this discussion](https://github.com/Milind220/Ozone/discussions/85). Just stage the file and commit again, it should pass the second time. + > When Black reformats a staged file, the pre-commit will fail. It is normal and expected. See [this discussion](https://github.com/Ozon3Org/Ozon3/discussions/85). Just stage the file and commit again, it should pass the second time. 4. Your local development environment is ready to use. Feel free to code away. Make sure to only commit logical changes that are already tested. Don't commit things you just try out and haven't tested. 5. When you're done coding, again, **test out the changes that you've made to the package.** Proceed if all is good. - > See [next section](#test-suite) for instructions about Ozone's test suite. + > See [next section](#test-suite) for instructions about Ozon3's test suite. ### Pushing changes and opening a pull request @@ -163,7 +163,7 @@ Hold my beer, I got this ## Test Suite -Ozone has a test suite that lives in `tests/` directory, which has the following structure within: +Ozon3 has a test suite that lives in `tests/` directory, which has the following structure within: Directories: @@ -172,7 +172,7 @@ Directories: Files: 1. `conftest.py`: Location of pytest global and configuration fixtures. -2. `utils.py`: Location of global Python helper objects (i.e. constants and `Ozone` instance) to use in tests. +2. `utils.py`: Location of global Python helper objects (i.e. constants and `Ozon3` instance) to use in tests. 3. `test_*.py`: Test files, each file is testing one public method. ### Setting up and running tests @@ -199,16 +199,16 @@ If any of your tests fail because of a VCR error such as `vcr.errors.CannotOverW ### Updating tests -Generally, tests should correspond to the necessary specification/expectation of Ozone users. Tests will help us identify if our code is still in line with such expectations. +Generally, tests should correspond to the necessary specification/expectation of Ozon3 users. Tests will help us identify if our code is still in line with such expectations. Tests should be updated when e.g.: -- There is new expectation on how should Ozone behave. In this case, the tests need to be updated accordingly. +- There is new expectation on how should Ozon3 behave. In this case, the tests need to be updated accordingly. - There is a new functionality. In this case, add necessary tests accordingly. - There is a new bug or previously unencountered or undocumented behavior. Add them to the existing tests when fixing it, to make sure the same bug will never slip past again in the future. ### About the cassettes and pytest-recording -This test suite is testing Ozone's functionality, therefore interaction with outside sources are mocked. Ozone uses pytest-recording plugin that uses vcrpy under the hood to record request-response pairs. +This test suite is testing Ozon3's functionality, therefore interaction with outside sources are mocked. Ozon3 uses pytest-recording plugin that uses vcrpy under the hood to record request-response pairs. These request-response pairs are stored as `.yaml` files in `tests/cassettes` directory. When an outbound request is made, pytest-recording will look for that request's response in the tests' `.yaml` file instead of actually letting the request go through to WAQI. @@ -260,7 +260,7 @@ After making changes to the cassettes, don't forget to save the cassettes into v git commit tests/cassettes -m "test: Re-record cassettes for passing test XXX XXX XXX" ``` -Note that doing a live request to WAQI requires a token to be supplied. The test suite loads the token from an environment variable. To set this environment variable, you can make a file named `.env` in Ozone root directory with the following content: +Note that doing a live request to WAQI requires a token to be supplied. The test suite loads the token from an environment variable. To set this environment variable, you can make a file named `.env` in Ozon3 root directory with the following content: ``` WAQI_TOKEN=insert_your_token_here @@ -290,7 +290,7 @@ For more information: ## World Air Quality Index's API -Ozone uses the World Air Quality Index's API under the hood to fetch its data. We have included some links to information about the API to help during contribution. +Ozon3 uses the World Air Quality Index's API under the hood to fetch its data. We have included some links to information about the API to help during contribution. * Find information on the World Air Quality Index website [here](https://waqi.info/) * Find information on different APIs used by Air Quality Programs [here](https://aqicn.org/api/) @@ -312,11 +312,11 @@ Commmits should be made in this format: * `fix`: To show that a bug fix or patch has been made. * `feat`: To show that a new feature/enhancement has been added. -* `BREAKING CHANGE`: For changes that introduce backward-incompatible updates. Backward-incompatibility happens when code that uses Ozone's **public** API needs to be modified to account for an update. (As opposed to code using Ozone's **private** or **internal-usage** API, which is not meant for public use) +* `BREAKING CHANGE`: For changes that introduce backward-incompatible updates. Backward-incompatibility happens when code that uses Ozon3's **public** API needs to be modified to account for an update. (As opposed to code using Ozon3's **private** or **internal-usage** API, which is not meant for public use) * `refactor`: If you've rearranged/refactored existing code by splitting it into separate files/methods/functions/classes, or by using a slightly different implementation detail, reasonably without changing functionality. * `test`: Any modification of tests. * `ci/cd`: Any changes related to continuous integration/deployment tasks, such as GitHub actions. -* `chore`: For behind the scenes stuff that doesn't affect the Ozone's API. This could include things like version bumps, change in dependencies, etc. +* `chore`: For behind the scenes stuff that doesn't affect the Ozon3's API. This could include things like version bumps, change in dependencies, etc. * `docs`: For entirely documentation related changes. README, CONTRIBUTING, CODE_OF_CONDUCT, and even docstrings in methods, all come under this. * `style`: For a commit that solely has to do with things like spaces instead of tabs, or " instead of ', etc. This can be used if you've formatted code with black/flake8 and wish to make a commit. @@ -338,6 +338,6 @@ Here are a few other tips: ## Github Branching Model -Ozone branches are created using a Github branching model. In this branching model, each branch serves a purpose and offers team members a shared undestanding of the branching system. +Ozon3 branches are created using a Github branching model. In this branching model, each branch serves a purpose and offers team members a shared undestanding of the branching system. -See more information on this branching model [here](https://github.com/Milind220/Ozone/discussions/24). +See more information on this branching model [here](https://github.com/Ozon3Org/Ozon3/discussions/24). diff --git a/FILE_STRUCTURE.md b/FILE_STRUCTURE.md index 92f2b9b..10e31c9 100644 --- a/FILE_STRUCTURE.md +++ b/FILE_STRUCTURE.md @@ -1,10 +1,10 @@ # File Structure -This document is a reference primer on Ozone's files: what, where, and for what. +This document is a reference primer on Ozon3's files: what, where, and for what. - [src/](#src) - [media/](#media) - - [ozone/](#ozone) - - [ozone.py](#ozonepy) + - [ozon3/](#ozon3) + - [ozon3.py](#ozon3py) - [urls.py](#urlspy) - [historical/](#historical) - [relevant_funcs.py](#relevant_funcspy) @@ -27,19 +27,19 @@ This document is a reference primer on Ozone's files: what, where, and for what. ## src/ -This is the directory where main Ozone source code lives. +This is the directory where main Ozon3 source code lives. ### media/ -This subdirectory contains media related to Ozone's documentation (README). Included here are demo GIFs and Ozone logo. +This subdirectory contains media related to Ozon3's documentation (README). Included here are demo GIFs and Ozon3 logo. -### ozone/ +### ozon3/ -This module is where core Ozone code lives. +This module is where core Ozon3 code lives. -#### ozone.py +#### ozon3.py -Main module that contains Ozone's class definition. +Main module that contains Ozon3's class definition. #### urls.py @@ -55,7 +55,7 @@ This file contains relevant JavaScript functions wrapped as one long triple-quot ##### _reverse_engineered.py -This file contains most of code required to run the JavaScript functions and convert the result back into Python format that can be used by the rest of Ozone. +This file contains most of code required to run the JavaScript functions and convert the result back into Python format that can be used by the rest of Ozon3. ## tests/ @@ -71,7 +71,7 @@ Pytest global and configuration fixtures are defined here. ### test_*.py -These are test files. One test file is responsible for testing one of Ozone's public method. +These are test files. One test file is responsible for testing one of Ozon3's public method. ### utils.py @@ -91,11 +91,11 @@ Dependency requirement file for development. Non-developing users won't need to ## updateVersion.sh -A custom shell script to automatically increment version. This is purely a convenience script so that each time Ozone needs a new release, we won't need to alter the version numbers in multiple places by hand. +A custom shell script to automatically increment version. This is purely a convenience script so that each time Ozon3 needs a new release, we won't need to alter the version numbers in multiple places by hand. ## .github/ -This folder is related to GitHub repository and not necessarily part of Ozone package. +This folder is related to GitHub repository and not necessarily part of Ozon3 package. ### ISSUE_TEMPLATE/ diff --git a/README.md b/README.md index 49fcd63..3632306 100644 --- a/README.md +++ b/README.md @@ -4,27 +4,27 @@
-# Ozone +# Ozon3 -![SVG of ozone logo](/src/media/ozone_logo.svg) +![SVG of ozon3 logo](/src/media/ozon3_logo.svg) -[![PyPI version](https://badge.fury.io/py/ozon3.svg)](https://badge.fury.io/py/ozon3) PRs Welcome ![GitHub](https://img.shields.io/github/license/Milind220/Ozone) [![Complete Documentation](https://github.com/Milind220/Ozone/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/Milind220/Ozone/actions/workflows/pages/pages-build-deployment) [![Dependency Review](https://github.com/Milind220/Ozone/actions/workflows/dependency-review.yml/badge.svg)](https://github.com/Milind220/Ozone/actions/workflows/dependency-review.yml) [![Tests](https://github.com/Milind220/Ozone/actions/workflows/test.yml/badge.svg)](https://github.com/Milind220/Ozone/actions/workflows/test.yml) +[![PyPI version](https://badge.fury.io/py/ozon3.svg)](https://badge.fury.io/py/ozon3) PRs Welcome ![GitHub](https://img.shields.io/github/license/Ozon3Org/Ozon3) [![Complete Documentation](https://github.com/Ozon3Org/Ozon3/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/Ozon3Org/Ozon3/actions/workflows/pages/pages-build-deployment) [![Dependency Review](https://github.com/Ozon3Org/Ozon3/actions/workflows/dependency-review.yml/badge.svg)](https://github.com/Ozon3Org/Ozon3/actions/workflows/dependency-review.yml) [![Tests](https://github.com/Ozon3Org/Ozon3/actions/workflows/test.yml/badge.svg)](https://github.com/Ozon3Org/Ozon3/actions/workflows/test.yml) [![Buy Me a Coffee](https://img.shields.io/badge/buy_me_a_coffee-orange.svg?style=flat)](https://www.buymeacoffee.com/MilindSharma) ## The simplest AQI API -Getting air quality data with Python should be easy and straightforward - and that's exactly what Ozone can help you with. -With Ozone, just 4 lines of code are enough to get you the data you need. And the best part is that you can trust this data to be accurate and reliable, since the package uses the World Air Quality Index's API under the hood! โœ… ๐Ÿ“ˆ +Getting air quality data with Python should be easy and straightforward - and that's exactly what Ozon3 can help you with. +With Ozon3, just 4 lines of code are enough to get you the data you need. And the best part is that you can trust this data to be accurate and reliable, since the package uses the World Air Quality Index's API under the hood! โœ… ๐Ÿ“ˆ -Use Ozone to **get real-time air quality data, or historical data from 2014 onwards**, and fetch air quality data **for anywhere in the world** in seconds. +Use Ozon3 to **get real-time air quality data, or historical data from 2014 onwards**, and fetch air quality data **for anywhere in the world** in seconds. -_You can view our complete documentation [here](https://milind220.github.io/Ozone/)_ +_You can view our complete documentation [here](https://Ozon3Org.github.io/Ozon3/)_ -_Don't forget to star Ozone repository if you found it helpful_ +_Don't forget to star Ozon3 repository if you found it helpful_ #### Table of Contents @@ -50,11 +50,11 @@ _Don't forget to star Ozone repository if you found it helpful_ pip install ozon3 ``` -You can find more information on the PyPI page for Ozone [here](https://pypi.org/project/ozon3/) (called ozon3 on PyPI). +You can find more information on the PyPI page for Ozon3 [here](https://pypi.org/project/ozon3/) ## Getting your API token -To use Ozone, you must first request and get a your own unique API token ๐ŸŽซ. This is required to access for the underlying API to work ๐Ÿ‘ฎ๐Ÿผโ€โ™‚๏ธ. +To use Ozon3, you must first request and get a your own unique API token ๐ŸŽซ. This is required to access for the underlying API to work ๐Ÿ‘ฎ๐Ÿผโ€โ™‚๏ธ. This is very easy to do, and takes no time at all as your token is generally emailed to you instantly. @@ -64,9 +64,9 @@ Get your token [here](https://aqicn.org/data-platform/token/#/)! ### Real-time data ```python -import ozone as ooo +import ozon3 as ooo -o3 = ooo.Ozone('YOUR_PRIVATE_TOKEN') +o3 = ooo.Ozon3('YOUR_PRIVATE_TOKEN') data = o3.get_city_air('New Delhi') ``` @@ -85,19 +85,19 @@ data = o3.get_historical_data(city='Houston') # data from 2014 onwards!
### Examples In Action ๐ŸŽฌ -![Gif of Ozone.get_city_air()](/src/media/example_get_city_air.gif) +![Gif of Ozon3.get_city_air()](/src/media/example_get_city_air.gif) -![Gif of Ozone.get_multiple_city_air()](/src/media/example_get_multiple_city_air.gif) +![Gif of Ozon3.get_multiple_city_air()](/src/media/example_get_multiple_city_air.gif) -![Gif of Ozone.get_historical_data()](/src/media/example_get_historical_data.gif) +![Gif of Ozon3.get_historical_data()](/src/media/example_get_historical_data.gif) ### Air Quality Parameters -Ozone can fetch the following parameters: +Ozon3 can fetch the following parameters: * `aqi`: air quality index, a measurement of air quality that tells you how clean or polluted the air is. It is measured in micrograms per cubic meter (ยตg/m3). * `pm25`: fine particulate matter, a measure of 2.5 micrometers or smaller particles in the air. It is measured in micrograms per cubic meter (ยตg/m3). * `pm10`: respirable particulate matter, a measure of 10 micrometers or smaller particles in the air. It is measured in micrograms per cubic meter (ยตg/m3). - * `o3`: a measure of ground level ozone concentrations in the air. It is measured in parts per billion (ppb). + * `o3`: a measure of ground level ozon3 concentrations in the air. It is measured in parts per billion (ppb). * `co`: a measure of carbon monoxide concentrations in the air. It is measured in parts per billion (ppb). * `no2`: a measure of nitrogen dioxide concentrations in the air. It is measured in parts per billion (ppb). * `so2`: a measure of sulfur dioxide concentrations in the air. It is measured in parts per billion (ppb). @@ -114,17 +114,17 @@ Sample output: **We love PR's!** -Take a look at the [CONTRIBUTING.md](https://github.com/Milind220/Ozone/blob/main/CONTRIBUTING.md) file for details on how to go about this! +Take a look at the [CONTRIBUTING.md](https://github.com/Ozon3Org/Ozon3/blob/main/CONTRIBUTING.md) file for details on how to go about this! ## Semantic Versioning System -Ozone uses a semantic versioning system to increment its release version number. Using this model, changes in version numbers can help indicate the meaning of modified code for each version. +Ozon3 uses a semantic versioning system to increment its release version number. Using this model, changes in version numbers can help indicate the meaning of modified code for each version. -See more information on semantic versioning [here](https://github.com/Milind220/Ozone/discussions/26). +See more information on semantic versioning [here](https://github.com/Ozon3Org/Ozon3/discussions/26). ## World Air Quality Index and EPA attribution -This package is a wrapper around an API provided by the World Air Quality Index project. Without them as well as the US EPA, Ozone would not exist. Please consider visiting the WAQI website and contributing to their project if you have time: +This package is a wrapper around an API provided by the World Air Quality Index project. Without them as well as the US EPA, Ozon3 would not exist. Please consider visiting the WAQI website and contributing to their project if you have time: [World Air Quality Index](https://aqicn.org/contact/) @@ -132,18 +132,18 @@ This package is a wrapper around an API provided by the World Air Quality Index ## LICENSE and Terms of Services ๐Ÿ“ฐ -1. Ozone is licensed under the GNU GENERAL PUBLIC LICENSE v3.0, and so it cannot be used for closed-source software or for monetary gain. -2. The WAQI API, which Ozone uses to provide data, has it's own [Acceptable Usage Policy](https://aqicn.org/api/tos/). Please refer to it for more details. +1. Ozon3 is licensed under the GNU GENERAL PUBLIC LICENSE v3.0, and so it cannot be used for closed-source software or for monetary gain. +2. The WAQI API, which Ozon3 uses to provide data, has it's own [Acceptable Usage Policy](https://aqicn.org/api/tos/). Please refer to it for more details. ## Contributors Contributions of any kind are welcome! These are our amazing contributors :) - - + + -Enjoy using Ozone! +Enjoy using Ozon3! ๐Ÿฅณ ๐Ÿพ ๐Ÿš€ #### _Created by [Milind Sharma](https://github.com/Milind220)_ diff --git a/setup.cfg b/setup.cfg index c9ef085..25700e3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,12 +1,12 @@ [metadata] name = ozon3 -version = 3.0.0 +version = 4.0.0 author = Milind Sharma author_email = milindsharma8@gmail.com description = An open-source package to easily obtain real-time, historical, or forecasted air quality data for anywhere in the world. Reliable, accurate and simple. long_description = file: README.md long_description_content_type = text/markdown -url = https://github.com/Milind220/Ozone +url = https://github.com/Ozon3Org/Ozon3 license = GPLv3+ classifiers = Programming Language :: Python :: 3 diff --git a/setup.py b/setup.py index 2a8e68f..e8f6c12 100644 --- a/setup.py +++ b/setup.py @@ -10,9 +10,9 @@ "or forecasted air quality data for anywhere in the world. Reliable," "accurate and simple.", license="GPLv3+", - url="https://github.com/Milind220/Ozone", - version="3.0.0", - download_url="https://github.com/Milind220/Ozone/archive/refs/tags/v3.0.0.tar.gz", + url="https://github.com/Ozon3Org/Ozon3", + version="4.0.0", + download_url="https://github.com/Ozon3Org/Ozon3/archive/refs/tags/v4.0.0.tar.gz", packages=setuptools.find_packages(), install_requires=[ "numpy; python_version>='3'", diff --git a/src/media/ozone_logo.svg b/src/media/ozon3_logo.svg similarity index 100% rename from src/media/ozone_logo.svg rename to src/media/ozon3_logo.svg diff --git a/src/ozon3/__init__.py b/src/ozon3/__init__.py new file mode 100644 index 0000000..de8e410 --- /dev/null +++ b/src/ozon3/__init__.py @@ -0,0 +1,3 @@ +from ozon3.ozon3 import Ozon3 + +__all__ = ["Ozon3"] diff --git a/src/ozone/historical/__init__.py b/src/ozon3/historical/__init__.py similarity index 100% rename from src/ozone/historical/__init__.py rename to src/ozon3/historical/__init__.py diff --git a/src/ozone/historical/_reverse_engineered.py b/src/ozon3/historical/_reverse_engineered.py similarity index 100% rename from src/ozone/historical/_reverse_engineered.py rename to src/ozon3/historical/_reverse_engineered.py diff --git a/src/ozone/historical/relevant_funcs.py b/src/ozon3/historical/relevant_funcs.py similarity index 100% rename from src/ozone/historical/relevant_funcs.py rename to src/ozon3/historical/relevant_funcs.py diff --git a/src/ozone/ozone.py b/src/ozon3/ozon3.py similarity index 98% rename from src/ozone/ozone.py rename to src/ozon3/ozon3.py index 7398464..4581a42 100644 --- a/src/ozone/ozone.py +++ b/src/ozon3/ozon3.py @@ -1,9 +1,9 @@ -"""Ozone module for the Ozone package. +"""Ozon3 module for the Ozon3 package. -This module contains the main Ozone class, which is used for all live-data -collection done by the Ozone package. +This module contains the main Ozon3 class, which is used for all live-data +collection done by the Ozon3 package. -This module should be used only as a part of the Ozone package, and should not +This module should be used only as a part of the Ozon3 package, and should not be run directly. Attributes (module level): @@ -39,8 +39,8 @@ def _as_float(x: Any) -> float: return numpy.nan -class Ozone: - """Primary class for Ozone API +class Ozon3: + """Primary class for Ozon3 API This class contains all the methods used for data collection. This class should be instantiated, and methods should be called from the @@ -573,7 +573,7 @@ def get_historical_data( f'city_id was not supplied. Searching for "{city}" yields ' f'city ID {city_id} with station name "{station_name}", ' f'with country code "{country_code}". ' - "Ozone will return air quality data from that station. " + "Ozon3 will return air quality data from that station. " "If you know this is not the correct city you intended, " "you can use get_city_station_options method first to " "identify the correct city ID." diff --git a/src/ozone/urls.py b/src/ozon3/urls.py similarity index 92% rename from src/ozone/urls.py rename to src/ozon3/urls.py index 844386f..56f291c 100644 --- a/src/ozone/urls.py +++ b/src/ozon3/urls.py @@ -1,8 +1,8 @@ -"""urls module for the Ozone package. +"""urls module for the Ozon3 package. This module contains the URLs dataclass for the package. -It should only be used with the Ozone package and not run directly. +It should only be used with the Ozon3 package and not run directly. """ from dataclasses import dataclass diff --git a/src/ozone/__init__.py b/src/ozone/__init__.py deleted file mode 100644 index 2cb5115..0000000 --- a/src/ozone/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from ozone.ozone import Ozone - -__all__ = ["Ozone"] diff --git a/tests/cassettes/ozon3_init.yaml b/tests/cassettes/ozon3_init.yaml new file mode 100644 index 0000000..a74d310 --- /dev/null +++ b/tests/cassettes/ozon3_init.yaml @@ -0,0 +1,72 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate, br + Connection: + - keep-alive + User-Agent: + - python-requests/2.27.1 + method: GET + uri: https://api.waqi.info/feed//london/?token=DUMMY_TOKEN + response: + body: + string: '' + headers: + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 25 Jul 2022 09:04:09 GMT + Location: + - /feed/london/?token=DUMMY_TOKEN + Server: + - nginx + status: + code: 301 + message: Moved Permanently +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate, br + Connection: + - keep-alive + User-Agent: + - python-requests/2.27.1 + method: GET + uri: https://api.waqi.info/feed/london/?token=DUMMY_TOKEN + response: + body: + string: '{"status":"error","data":"Invalid key"}' + headers: + Access-Control-Allow-Origin: + - '*' + Connection: + - keep-alive + Content-Type: + - application/json; charset=UTF-8 + Date: + - Mon, 25 Jul 2022 09:04:09 GMT + Server: + - nginx + Transfer-Encoding: + - chunked + Vary: + - Accept-Encoding + X-Gen-Time: + - "62.381\xC2\xB5s" + X-Powered-By: + - rxstreamer-waqi/1.3 + content-length: + - '39' + status: + code: 200 + message: OK +version: 1 diff --git a/tests/cassettes/ozone_init.yaml b/tests/cassettes/ozone_init.yaml deleted file mode 100644 index a1a0622..0000000 --- a/tests/cassettes/ozone_init.yaml +++ /dev/null @@ -1,76 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - python-requests/2.27.1 - method: GET - uri: https://api.waqi.info/feed//london/?token=DUMMY_TOKEN - response: - body: - string: '' - headers: - Connection: - - keep-alive - Content-Length: - - '0' - Date: - - Thu, 21 Apr 2022 01:06:54 GMT - Location: - - /feed/london/?token=DUMMY_TOKEN - Server: - - nginx - status: - code: 301 - message: Moved Permanently -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - python-requests/2.27.1 - method: GET - uri: https://api.waqi.info/feed/london/?token=DUMMY_TOKEN - response: - body: - string: '{"status":"ok","data":{"aqi":57,"idx":5724,"attributions":[{"url":"http://uk-air.defra.gov.uk/","name":"UK-AIR, - air quality information resource - Defra, UK","logo":"UK-Department-for-environment-food-and-rural-affairs.png"},{"url":"https://londonair.org.uk/","name":"London - Air Quality Network - Environmental Research Group, King''s College London","logo":"UK-London-Kings-College.png"},{"url":"https://waqi.info/","name":"World - Air Quality Index Project"}],"city":{"geo":[51.5073509,-0.1277583],"name":"London","url":"https://aqicn.org/city/london","location":""},"dominentpol":"pm25","iaqi":{"co":{"v":2.6},"h":{"v":78},"no2":{"v":14.8},"o3":{"v":26.6},"p":{"v":1015},"pm10":{"v":26},"pm25":{"v":57},"so2":{"v":0.6},"t":{"v":8.3},"w":{"v":3.6}},"time":{"s":"2022-04-21 - 00:00:00","tz":"+01:00","v":1650499200,"iso":"2022-04-21T00:00:00+01:00"},"forecast":{"daily":{"o3":[{"avg":19,"day":"2022-04-18","max":33,"min":8},{"avg":17,"day":"2022-04-19","max":34,"min":2},{"avg":25,"day":"2022-04-20","max":39,"min":14},{"avg":27,"day":"2022-04-21","max":36,"min":14},{"avg":23,"day":"2022-04-22","max":28,"min":17},{"avg":29,"day":"2022-04-23","max":37,"min":21},{"avg":36,"day":"2022-04-24","max":36,"min":32}],"pm10":[{"avg":18,"day":"2022-04-18","max":26,"min":10},{"avg":23,"day":"2022-04-19","max":31,"min":13},{"avg":19,"day":"2022-04-20","max":36,"min":10},{"avg":19,"day":"2022-04-21","max":28,"min":11},{"avg":18,"day":"2022-04-22","max":20,"min":14},{"avg":20,"day":"2022-04-23","max":23,"min":17},{"avg":16,"day":"2022-04-24","max":17,"min":16}],"pm25":[{"avg":47,"day":"2022-04-18","max":74,"min":23},{"avg":64,"day":"2022-04-19","max":81,"min":45},{"avg":59,"day":"2022-04-20","max":94,"min":33},{"avg":58,"day":"2022-04-21","max":79,"min":37},{"avg":56,"day":"2022-04-22","max":62,"min":46},{"avg":62,"day":"2022-04-23","max":70,"min":52},{"avg":53,"day":"2022-04-24","max":53,"min":52}],"uvi":[{"avg":1,"day":"2022-04-19","max":3,"min":0},{"avg":1,"day":"2022-04-20","max":4,"min":0},{"avg":1,"day":"2022-04-21","max":4,"min":0},{"avg":1,"day":"2022-04-22","max":3,"min":0},{"avg":1,"day":"2022-04-23","max":3,"min":0},{"avg":0,"day":"2022-04-24","max":2,"min":0},{"avg":0,"day":"2022-04-25","max":1,"min":0}]}},"debug":{"sync":"2022-04-21T09:24:45+09:00"}}}' - headers: - Access-Control-Allow-Origin: - - '*' - Connection: - - keep-alive - Content-Type: - - application/json; charset=UTF-8 - Date: - - Thu, 21 Apr 2022 01:06:54 GMT - Server: - - nginx - Transfer-Encoding: - - chunked - Vary: - - Accept-Encoding - X-Gen-Time: - - "123.812\xC2\xB5s" - X-Powered-By: - - rxstreamer-waqi/1.3 - content-length: - - '2269' - status: - code: 200 - message: OK -version: 1 diff --git a/tests/test_get_coordinate_air.py b/tests/test_get_coordinate_air.py index 62e2485..676b969 100644 --- a/tests/test_get_coordinate_air.py +++ b/tests/test_get_coordinate_air.py @@ -68,7 +68,7 @@ def test_bad_coordinates(): api.get_coordinate_air(None, None) # type: ignore # Giving coordinates as string of numerics is fine, - # even though it's not in accordance with Ozone's method definition. + # even though it's not in accordance with Ozon3's method definition. api.get_coordinate_air("51.51", "-0.13") # type: ignore # Giving nonsensical coordinates is also fine diff --git a/tests/utils.py b/tests/utils.py index 5d46001..489a18e 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -2,7 +2,7 @@ from urllib.parse import urlsplit, urlunsplit, urlencode import vcr from decouple import config -from ozone import Ozone +from ozon3 import Ozon3 # Filter out token in response headers @@ -33,7 +33,7 @@ def before_record_response(response): "decode_compressed_response": True, } -# Prepare a global Ozone object +# Prepare a global Ozon3 object WAQI_TOKEN = config("WAQI_TOKEN", default="DUMMY_TOKEN") -with vcr.use_cassette("tests/cassettes/ozone_init.yaml", **vcr_kwargs): - api = Ozone(WAQI_TOKEN) +with vcr.use_cassette("tests/cassettes/ozon3_init.yaml", **vcr_kwargs): + api = Ozon3(WAQI_TOKEN) diff --git a/updateVersion.sh b/updateVersion.sh index 359d276..565ef43 100644 --- a/updateVersion.sh +++ b/updateVersion.sh @@ -58,4 +58,4 @@ echo "Updated Version: $UPDATED_VERSION" sed -i "s/version = ${VERSION}/version = ${UPDATED_VERSION}/" setup.cfg sed -i "s/^ version=\"${VERSION}\",/ version=\"${UPDATED_VERSION}\",/" setup.py -sed -i "s/^ download_url=\"https:\/\/github.com\/Milind220\/Ozone\/archive\/refs\/tags\/v${VERSION}.tar.gz\",/ download_url=\"https:\/\/github.com\/Milind220\/Ozone\/archive\/refs\/tags\/v${UPDATED_VERSION}.tar.gz\",/" setup.py +sed -i "s/^ download_url=\"https:\/\/github.com\/Ozon3Org\/Ozon3\/archive\/refs\/tags\/v${VERSION}.tar.gz\",/ download_url=\"https:\/\/github.com\/Ozon3Org\/Ozon3\/archive\/refs\/tags\/v${UPDATED_VERSION}.tar.gz\",/" setup.py