Procyclingstats is a Python package for scraping procyclingstats.com, which is a website with cycling stats. It’s recommended to get familiar with the website before using this package.
Installation
Using pip:
$ pip install procyclingstats
Manual (for development):
$ git clone https://github.com/themm1/procyclingstats.git
$ pip install -r procyclingstats/requirements_dev.txt
Basic usage
Basic Rider class usage:
>>> from procyclingstats import Rider
>>> rider = Rider("rider/tadej-pogacar")
>>> rider.birthdate()
"1998-9-21"
>>> rider.parse()
{
'birthdate': '1998-9-21',
'height': 1.76,
'name': 'Tadej Pogačar',
'nationality': 'SI',
...
}
Interface consists from scraping classes which are currently Race, RaceStartlist, RaceClimbs, RaceCombativeRiders, Ranking, Rider, RiderResults, Stage and Team. Usage of all scraping classes is almost the same and the only difference among them are parsing methods as is for example birthdate in Rider class usage example.
Unexpected behaviour and parsing errors
Since the project is a web scraper which parses HTML, it’s difficult to make it reliable and it’s common to encounter some HTML parsing problems. After getting some kind of unexpected behaviour or parsing errors, it’s recommended to update the package on your system using pip install procyclingstats --upgrade. If the problem proceeds, see the GitHub issues page and if the issue hasn’t been opened yet, don’t hesitate to open one!
Links
Metadata
Release files for procyclingstats 0.2.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| procyclingstats-0.2.8.tar.gz | 34.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| procyclingstats-0.2.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 76.1 kB
Release files / procyclingstats-0.2.8.tar.gz
| Download URL | procyclingstats-0.2.8.tar.gz |
|---|---|
| Size | 34.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ff86455453ccfba9d25a93bcd7cf69dae3e07f14d2164be48d45ba0bfe8687e8
|
|
BLAKE2b-256 checksum How to use checksums |
990a6adb200ef7338e2d48cf9b59d40c6c7eed25833b5a8083fcf6b250461567
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.12
|
Release files / procyclingstats-0.2.8-py3-none-any.whl
| Download URL | procyclingstats-0.2.8-py3-none-any.whl |
|---|---|
| Size | 41.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fda56f0e67254a58c2e32d30f9bd3aad9c6cda8d06206d18f6e484f290bc9288
|
|
BLAKE2b-256 checksum How to use checksums |
70019ec2c48efe97e350ef4e12a373b5121673d67bc34f53ba48d7a8c659d027
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.12
|