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.7.tar.gz (32.1 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.7-py3-none-any.whl (39.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: procyclingstats-0.2.7.tar.gz
  • Upload date:
  • Size: 32.1 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.7.tar.gz
Algorithm Hash digest
SHA256 0b7a97a4ddc40b271d8cf4e1d7634e3e0378f1a6dead31b6e3e4bb8054784d9f
MD5 210ec946c5ceb922b027be82bb330d97
BLAKE2b-256 0e2bf6f742dddb9fdaa53f9bd646d3580ef6329f944d1ed39a3078c70c96a22d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for procyclingstats-0.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 97ae5bf5ef8c77630b88a0fc298fcd3965560e236dbeda3f572b425fc8e40247
MD5 52683743cf1bf8cb178a09de3d0fc5cc
BLAKE2b-256 38cc4061532462d6e75008ec817d7aaaef5a91ca4f1f2148702d533f9c4951e3

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