Skip to main content

A Python API wrapper for procyclingstats.com

Project description

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!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

procyclingstats-0.2.8.tar.gz (34.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

procyclingstats-0.2.8-py3-none-any.whl (41.7 kB view details)

Uploaded Python 3

File details

Details for the file procyclingstats-0.2.8.tar.gz.

File metadata

  • Download URL: procyclingstats-0.2.8.tar.gz
  • Upload date:
  • Size: 34.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for procyclingstats-0.2.8.tar.gz
Algorithm Hash digest
SHA256 ff86455453ccfba9d25a93bcd7cf69dae3e07f14d2164be48d45ba0bfe8687e8
MD5 32e27629a4bcb5f04d9df9a8f2832226
BLAKE2b-256 990a6adb200ef7338e2d48cf9b59d40c6c7eed25833b5a8083fcf6b250461567

See more details on using hashes here.

File details

Details for the file procyclingstats-0.2.8-py3-none-any.whl.

File metadata

File hashes

Hashes for procyclingstats-0.2.8-py3-none-any.whl
Algorithm Hash digest
SHA256 fda56f0e67254a58c2e32d30f9bd3aad9c6cda8d06206d18f6e484f290bc9288
MD5 64ebbbdf27ef8e46cc93ac26d3ad2a39
BLAKE2b-256 70019ec2c48efe97e350ef4e12a373b5121673d67bc34f53ba48d7a8c659d027

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page