Skip to content

Commit

Permalink
Worldometer v2.0.0 (#30)
Browse files Browse the repository at this point in the history
## Added

- **New module structure (#22)**
   - new scraper module;
   - new world module for public api;
   - get home page counters, like in the old api, but now having a special data class;
   - get population and geography data;
   - set new dependencies;
   - new mapped pages;
   - add some tests.
- **Add docstrings to the new api (#23)**
- **Define explicit fields in all counter dataclasses (#26)**

## Changed

- **Reformulation of all docs (#24)**
   - new fully documented API;
   - new package logo and icon.
 - **Use the new API in the old core module. This is a temporary measure until the module is completely removed. (#25)**
    - warn about the deprecation of the old API and indicate the use of the new one.
- **Update all project metadata (#27)**
- **Change package manager and add action to run tests (#29)**
- **Support only Python `>=3.9, <3.12` (#29)**

## Removed

- **Removed support for Python 3.7 and 3.8 (#29)**

## Deprecated

- **`worldometer.core` and `worldometer.api` deprecated (#25)**

## Fixed

- **Fix old API (#25)**
   - fix: import "requests_html" could not be resolved (#12)
   - fix: problem with Importing and Crashing (#13)
   - fix: issue with "sanitize_metrics" method (#18)
   - fix: navigation Timeout Exceeded Error (#20)
   - fix: import error (#21)
  • Loading branch information
matheusfelipeog authored Oct 25, 2023
2 parents 7b430a5 + a07a60d commit ac998de
Show file tree
Hide file tree
Showing 52 changed files with 5,110 additions and 1,233 deletions.
Binary file modified .github/assets/images/worldometer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Tests

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

jobs:
unittests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11']

steps:
- name: Checkout repository
uses: actions/checkout@v4

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

- name: Install poetry
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Install dependencies
run: |
poetry install
- name: Run unittests
run: |
poetry run pytest --verbose
199 changes: 187 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,20 +1,195 @@
# Ignore local directory
.vscode/
# Created by https://www.toptal.com/developers/gitignore/api/python,visualstudiocode
# Edit at https://www.toptal.com/developers/gitignore?templates=python,visualstudiocode

# Ignore local secret file
.env
.pypirc

# Ignore cache
### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Ignore build and distribution directories/files
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

### Python Patch ###
# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
poetry.toml

# ruff
.ruff_cache/

# LSP config files
pyrightconfig.json

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

# Local History for Visual Studio Code
.history/

# Built Visual Studio Code Extensions
*.vsix

# Ignore the docs build directory
docs/build/
### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide

# Ignore local tests
local_test.py
# End of https://www.toptal.com/developers/gitignore/api/python,visualstudiocode
7 changes: 4 additions & 3 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,20 @@ version: 2

# Select the Docker image used for building the docs.
build:
image: latest
os: ubuntu-22.04
tools:
python: "3.8"

# Build documentation in the docs/ directory with Sphinx
sphinx:
builder: html
configuration: docs/source/conf.py
fail_on_warning: true
fail_on_warning: false

# Build all formats (htmlzip, pdf and epub)
formats: all

# Configure python for install requirements
python:
version: 3.8
install:
- requirements: docs/docs_requirements.txt
11 changes: 0 additions & 11 deletions Pipfile

This file was deleted.

Loading

0 comments on commit ac998de

Please sign in to comment.