Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 0.1.4 #19

Merged
merged 15 commits into from
Sep 28, 2024
7 changes: 4 additions & 3 deletions codecov.yml → .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
codecov:
notify:
after_n_builds: 5 # wait for the 5 Travis jobs before notifying
token: 0aa5a6c3-d2ca-46c4-8c1f-0b1646a75e04
notify:
wait_for_ci: true

coverage:
status:
Expand All @@ -12,4 +13,4 @@ coverage:
source:
paths: "world_bank_data/"
target: 90%
threshold': 1%
threshold': 1%
54 changes: 0 additions & 54 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

86 changes: 86 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: CI
on:
push:
paths-ignore:
- 'CHANGELOG.md'
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: '0 11 * * 4'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
- uses: pre-commit/action@v3.0.1

codeql:
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: python
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3

pytest:
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"]
pandas-version: [latest]
numpy-version: [latest]
include:
- python-version: 3.9
pandas-version: '<2.0'
numpy-version: '<2.0'
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4

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

- name: Install a development version
run: pip install -e .[test]

- name: Install pandas latest
if: matrix.pandas-version == 'latest'
run: pip install pandas
- name: Install pandas pre-release
if: matrix.pandas-version == 'pre'
run: pip install pandas --pre
- name: Install pandas ${{ matrix.pandas-version }}
if: matrix.pandas-version != 'pre' && matrix.pandas-version != 'latest'
run: pip install 'pandas${{ matrix.pandas-version }}'
- name: Install numpy ${{ matrix.numpy-version }}
if: matrix.numpy-version != 'latest'
run: pip install 'numpy${{ matrix.numpy-version }}'

- name: Test with pytest
run: pytest --cov=./ --cov-report=xml

- name: Upload coverage
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
verbose: true
31 changes: 31 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish to PyPI
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+rc[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+dev[0-9]+"

jobs:
publish:
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/world-bank-data
permissions:
id-token: write
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Build package
run: |
python -m pip install wheel build
python -m build
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
29 changes: 29 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Install pre-commit hooks via
# pre-commit install

repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-json
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/timothycrosley/isort
rev: 5.13.2
hooks:
- id: isort
args: ["--profile", "black", "--filter-files"]

- repo: https://github.com/psf/black
rev: 24.8.0
hooks:
- id: black

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.8
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
3 changes: 0 additions & 3 deletions .pylintrc

This file was deleted.

24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

14 changes: 8 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
0.1.3+dev
0.1.4 (2024-09-28)
------------------

**Fixed**
- We now use HTTPS as required by the world bank API ([#18](https://github.com/mwouts/world_bank_data/pulls/18)) - thanks to [John Cant](https://github.com/johncant) for fixing this!

**Added**
- `__version__` added to `world_bank_data` package
- Added `__version__`
- We use GitHub Actions for CI
- We use `pre-commit` for code formatting

**Changed**
- Added GitHub code scanning
- Configured codecov with `codecov.yml`
- Removed Python 3.4 from the CI
- Updated test `test_indicator_values` as the population estimate for 2017 was revisited
- The package can be used with Python 3.7 to 3.12


0.1.3 (2019-07-10)
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# The World Bank Data in Python

[![Build Status](https://travis-ci.com/mwouts/world_bank_data.svg?branch=master)](https://travis-ci.com/mwouts/world_bank_data)
[![codecov.io](https://codecov.io/github/mwouts/world_bank_data/coverage.svg?branch=master)](https://codecov.io/github/mwouts/world_bank_data?branch=master)
[![CI](https://github.com/mwouts/world_bank_data/actions/workflows/continuous-integration.yml/badge.svg?branch=main)](https://github.com/mwouts/world_bank_data/actions)
[![codecov.io](https://codecov.io/github/mwouts/world_bank_data/coverage.svg?branch=main)](https://codecov.io/github/mwouts/world_bank_data?branch=main)
[![Language grade: Python](https://img.shields.io/badge/lgtm-A+-brightgreen.svg)](https://lgtm.com/projects/g/mwouts/world_bank_data/context:python)
[![Pypi](https://img.shields.io/pypi/v/world_bank_data.svg)](https://pypi.python.org/pypi/world_bank_data)
[![pyversions](https://img.shields.io/pypi/pyversions/world_bank_data.svg)](https://pypi.python.org/pypi/world_bank_data)
[![Jupyter Notebook](https://img.shields.io/badge/Binder-Notebook-blue.svg)](
https://mybinder.org/v2/gh/mwouts/world_bank_data/master?filepath=examples%2FA%20sunburst%20plot%20of%20the%20world%20population.ipynb)
https://mybinder.org/v2/gh/mwouts/world_bank_data/main?filepath=examples%2FA%20sunburst%20plot%20of%20the%20world%20population.ipynb)
[![JupyterLab](https://img.shields.io/badge/Binder-JupyterLab-blue.svg)](
https://mybinder.org/v2/gh/mwouts/world_bank_data/master?urlpath=lab)
https://mybinder.org/v2/gh/mwouts/world_bank_data/main?urlpath=lab)

This is an implementation of the [World Bank API v2](https://datahelpdesk.worldbank.org/knowledgebase/articles/889386-developer-information-overview) in Python. Use this package to explore the [World Development Indicators](http://datatopics.worldbank.org/world-development-indicators/) published by the [World Bank](http://www.worldbank.org/).

Expand Down Expand Up @@ -57,7 +57,7 @@ to retrieve more information about country classifiers.

## Get the list of indicators

This is done with the `get_indicators` function. You may query only the indicators for a specific source or topic as below. If you input no arguments, the `get_indicator` function will return the description of all the 16,000+ indicators.
This is done with the `get_indicators` function. You may query only the indicators for a specific source or topic as below. If you input no arguments, the `get_indicator` function will return the description of all the 16,000+ indicators.

```python
wb.get_indicators(topic=3, source=2) # topic and source id are from get_topics/get_sources
Expand Down Expand Up @@ -94,9 +94,9 @@ wb.get_series('SP.POP.TOTL', date='2016', id_or_value='id', simplify_index=True)

## Ready for an interative tutorial?

Go to our [Binder](https://mybinder.org/v2/gh/mwouts/world_bank_data/master) and run either this [README](https://github.com/mwouts/world_bank_data/blob/master/README.md), or our other [tutorial](https://github.com/mwouts/world_bank_data/blob/master/examples/) with the code required to produce this plot of the World Population:
Go to our [Binder](https://mybinder.org/v2/gh/mwouts/world_bank_data/main) and run either this [README](https://github.com/mwouts/world_bank_data/blob/main/README.md), or our other [tutorial](https://github.com/mwouts/world_bank_data/blob/main/examples/) with the code required to produce this plot of the World Population:

[![World Population 2017](https://gist.githubusercontent.com/mwouts/ec3a88f1d97e36a062f69d4072b91e39/raw/79211a09957c6934fabf738a59c2c9b8df943696/world_population.gif)](https://nbviewer.jupyter.org/github/mwouts/world_bank_data/blob/master/examples/A%20sunburst%20plot%20of%20the%20world%20population.ipynb)
[![World Population 2017](https://gist.githubusercontent.com/mwouts/ec3a88f1d97e36a062f69d4072b91e39/raw/79211a09957c6934fabf738a59c2c9b8df943696/world_population.gif)](https://nbviewer.jupyter.org/github/mwouts/world_bank_data/blob/main/examples/A%20sunburst%20plot%20of%20the%20world%20population.ipynb)

# References

Expand All @@ -122,7 +122,7 @@ The reason for which I wrote `world_bank_data` is mostly speed, e.g. I wanted to
## R

R users can use two packages to access the World Bank data:
- [`WDI`](https://github.com/vincentarelbundock/WDI/blob/master/README.md)
- [`WDI`](https://github.com/vincentarelbundock/WDI/blob/master/README.md)
- [`wbstats`](https://github.com/GIST-ORNL/wbstats/blob/master/README.md)

See also the [Introduction to the wbstats R-package](https://cran.r-project.org/web/packages/wbstats/vignettes/Using_the_wbstats_package.html), or this [quick review](https://cengel.github.io/gearup2016/worldbank.html) of the two packages.
Expand Down
13 changes: 10 additions & 3 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
name: world-bank-data-dev
name: world-bank-data
channels:
- defaults
- conda-forge
dependencies:
# dependencies
- pandas
- requests
- cachetools
- mock
# tests
- pytest
- flake8
- pytest-cov
- pytest-xdist
# pre-commits
- pre-commit
# build
- hatch
# Jupyter
- plotly
- jupytext
- jupyter
Loading
Loading