Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
64a52b4
Initial plan
Copilot Sep 23, 2025
1f9cc33
Create comprehensive Sphinx documentation for cpcbfetch package
Copilot Sep 23, 2025
496eca9
Complete Sphinx documentation setup with improved .gitignore and fina…
Copilot Sep 23, 2025
00bc02f
Add Jupyter notebooks with comprehensive examples for cpcbfetch
Copilot Sep 30, 2025
35f08ce
[Chore] updated notebook
kumar-09 Oct 1, 2025
6cc77b6
[Update] Notebook examples updated
kumar-09 Oct 2, 2025
e957b26
[Chore] conflict resolved
kumar-09 Oct 2, 2025
2c9b301
[Update] Notebooks updated, TODO: Update example section of documenta…
kumar-09 Oct 2, 2025
8e738ad
[Chore] examples.rst updated
kumar-09 Oct 8, 2025
85f3875
[Update] Docs include notbooks and their output
kumar-09 Oct 8, 2025
e351904
[Chore] Doc dependencies added
kumar-09 Oct 8, 2025
13bba91
Update pyproject.toml for dependencies, authors
saketkc Oct 8, 2025
5eb816b
[Update] Changed dummy example with real Indian region data analysis …
kumar-09 Oct 9, 2025
04db702
Style improvements
saketkc Oct 11, 2025
7d62600
Add CI
saketkc Oct 11, 2025
4407345
isort
saketkc Oct 11, 2025
4eeda50
Update requirements
saketkc Oct 11, 2025
24f5588
Add logo
saketkc Oct 11, 2025
fab9079
Support multiversion
saketkc Oct 11, 2025
91b00b2
Update requirements
saketkc Oct 11, 2025
c3d5534
Decrease version
saketkc Oct 11, 2025
df46076
Decrease version
saketkc Oct 11, 2025
7ecd69c
Decrease version
saketkc Oct 11, 2025
e6addc9
Require python 3.9
saketkc Oct 11, 2025
4110f64
Formatting
saketkc Oct 11, 2025
cb28cf0
Decrease version
saketkc Oct 11, 2025
bda2b19
Remove py3.14
saketkc Oct 11, 2025
cee3868
Formatting
saketkc Oct 11, 2025
1d7a296
Add main for cli
saketkc Oct 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: CI

on:
push:
branches: [ master, main ]
pull_request:
branches: [ master, main ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- python-version: "3.9"
- python-version: "3.10"
- python-version: "3.11"
- python-version: "3.12"
- python-version: "3.13"

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prerelease: ${{ matrix.allow-prerelease || false }}

- name: Cache pip dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"

- name: Lint with flake8
run: |
flake8 vayuayan/ --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 vayuayan/ --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics

- name: Type check with mypy
run: |
mypy vayuayan/

- name: Test with pytest
run: |
python -m pytest tests/ -v --tb=short
continue-on-error: true # Allow tests to fail until test suite is implemented

- name: Test CLI functionality
run: |
python -m vayuayan --help
python -c "import vayuayan; print('Package imports successfully')"

security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install bandit
run: |
python -m pip install --upgrade pip
pip install bandit[toml]

- name: Run security scan
run: |
bandit -r vayuayan/ -f json -o bandit-report.json || true
bandit -r vayuayan/ --severity-level medium

- name: Upload security scan results
uses: actions/upload-artifact@v4
if: always()
with:
name: bandit-report
path: bandit-report.json
68 changes: 68 additions & 0 deletions .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Code Formatting

on:
push:
branches: [ master, main ]
pull_request:
branches: [ master, main ]

jobs:
format-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install black
run: |
python -m pip install --upgrade pip
pip install black

- name: Check black formatting
run: |
black --check --diff vayuayan/

auto-format:
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
needs: format-check
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install black
run: |
python -m pip install --upgrade pip
pip install black

- name: Format code with black
run: |
black vayuayan/

- name: Check for changes
id: verify-changed-files
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "changed=true" >> $GITHUB_OUTPUT
else
echo "changed=false" >> $GITHUB_OUTPUT
fi

- name: Commit changes
if: steps.verify-changed-files.outputs.changed == 'true'
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add .
git commit -m "🤖 Auto-format code with black" -m "Automated formatting applied by GitHub Actions"
git push
35 changes: 27 additions & 8 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
name: Deploy Docs to GitHub Pages
permissions:
contents: write

on:
push:
branches:
- main # or 'master', depending on your default branch
- master
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: true

jobs:
build-and-deploy:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -28,8 +37,18 @@ jobs:
cd docs
make html

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/build/html
path: docs/_build/html

deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
22 changes: 10 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ instance/

# Sphinx documentation
docs/_build/
docs/.buildinfo
docs/.buildinfo.bak

# PyBuilder
target/
Expand Down Expand Up @@ -134,18 +136,14 @@ dmypy.json
*.swp
*.swo

# macOS
# OS
.DS_Store

# Windows
Thumbs.db
ehthumbs.db
Desktop.ini

examples/india_state.geojson
examples/usa_states.geojson
examples/usa_whole.geojson
examples/V6GL01.0p10.CNNPM25.Global.201902-201902.nc
examples/V6GL01.0p10.CNNPM25.Global.201801-201812.nc

docs/build
# Project specific
*.csv
*.json
*.xlsx
*.nc
*.geojson
examples/V6GL01*
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: help install install-dev test test-cov lint format clean build upload docs
.PHONY: help install install-dev test test-cov lint format clean build upload docs docs-multiversion

help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
Expand All @@ -21,7 +21,6 @@ lint: ## Run linting

format: ## Format code
black vayuayan/
isort vayuayan/

clean: ## Clean build artifacts
rm -rf build/
Expand All @@ -45,8 +44,11 @@ upload-test: ## Upload to Test PyPI
docs: ## Build documentation
cd docs && make html

docs-multiversion: ## Build documentation for all versions
cd docs && make multiversion

docs-serve: ## Serve documentation locally
cd docs/build/html && python -m http.server 8000
cd docs/_build/html && python -m http.server 8000

example-basic: ## Run basic usage example
python examples/basic_usage.py
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
**Vayuayan** is a comprehensive Python package for fetching and analysing air quality data from multiple sources worldwide:

- **WUSTL ACAG**: [Washington University satellite PM2.5 data](https://sites.wustl.edu/acag/datasets/surface-pm2-5/) (Global)
- **CPCB India**: pCentral Pollution Control Board](https://cpcb.nic.in/) monitoring network (India only)
- **CPCB India**: Central Pollution Control Board](https://cpcb.nic.in/) monitoring network (India only)

## Installation

Expand Down
23 changes: 23 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help multiversion Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

multiversion:
sphinx-multiversion "$(SOURCEDIR)" "$(BUILDDIR)/html"
58 changes: 58 additions & 0 deletions docs/api/vayuayan.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
vayuayan package
=================

.. automodule:: vayuayan
:members:
:undoc-members:
:show-inheritance:

Submodules
----------

vayuayan.air_quality_client module
------------------------------------

.. automodule:: vayuayan.air_quality_client
:members:
:undoc-members:
:show-inheritance:

vayuayan.cli module
--------------------

.. automodule:: vayuayan.cli
:members:
:undoc-members:
:show-inheritance:

vayuayan.client module
-----------------------

.. automodule:: vayuayan.client
:members:
:undoc-members:
:show-inheritance:

vayuayan.constants module
--------------------------

.. automodule:: vayuayan.constants
:members:
:undoc-members:
:show-inheritance:

vayuayan.exceptions module
---------------------------

.. automodule:: vayuayan.exceptions
:members:
:undoc-members:
:show-inheritance:

vayuayan.utils module
----------------------

.. automodule:: vayuayan.utils
:members:
:undoc-members:
:show-inheritance:
Loading
Loading