stravalib


Namestravalib JSON
Version 2.2 PyPI version JSON
download
home_pageNone
SummaryA Python package that makes it easy to access and download data from the Strava V3 REST API.
upload_time2025-02-08 20:51:56
maintainerLeah Wasser, Hans Lellelid, Jonatan Samoocha, Yihong, Γ‰mile Nadeau
docs_urlhttps://pythonhosted.org/stravalib/
authorNone
requires_python>=3.10
licenseApache 2.0 License
keywords strava running cycling athletes
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # Welcome to stravalib

[![All Contributors](https://img.shields.io/github/all-contributors/stravalib/stravalib?color=ee8449&style=flat-square)](#contributors)
[![DOI](https://zenodo.org/badge/8828908.svg)](https://zenodo.org/badge/latestdoi/8828908)
![PyPI](https://img.shields.io/pypi/v/stravalib?style=plastic) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/stravalib?style=plastic) [![Documentation Status](https://readthedocs.org/projects/stravalib/badge/?version=latest)](https://stravalib.readthedocs.io/en/latest/?badge=latest) ![Package Tests Status](https://github.com/stravalib/stravalib/actions/workflows/build-test.yml/badge.svg) ![PyPI - Downloads](https://img.shields.io/pypi/dm/stravalib?style=plastic) [![codecov](https://codecov.io/gh/stravalib/stravalib/branch/main/graph/badge.svg?token=sHbFJn7epy)](https://codecov.io/gh/stravalib/stravalib)

The **stravalib** Python package provides easy-to-use tools for accessing and
downloading Strava data from the Strava V3 web service. Stravalib provides a Client class that supports:

- Authenticating with stravalib
- Accessing and downloading Strava activity, club, and profile data
- Making changes to account activities

It also provides support for working with date/time/temporal attributes
and quantities through the [Python Pint library](https://pypi.org/project/Pint/).

## Dependencies

- Python 3.9+
- [Setuptools](https://pypi.org/project/setuptools/) for building stravalib
- Other Python libraries (installed automatically when using pip):
     - [requests](https://pypi.org/project/requests/),
     - [pytz](https://pypi.org/project/pytz/)
     - [pint](https://pypi.org/project/pint/)
     - [arrow](https://pypi.org/project/arrow/),
     - [pydantic 2.x](https://pypi.org/project/pydantic/)

## Installation

stravalib is available on [PyPI](https://pypi.org/project/stravalib/) and can be installed using `pip`:

`pip install stravalib`


## Get started using Stravalib

Most of the methods that you will use with stravalib are in the `stravalib.client.Client` class.

You may be interested in the following tutorials to get started

1. [How to create
a Strava app.](https://stravalib.readthedocs.io/en/latest/get-started/authenticate-with-strava.html#authenticate-with-the-strava-api-using-stravalib)
1. [How to authenticate with Strava using stravalib.](https://stravalib.readthedocs.io/en/latest/get-started/authenticate-with-strava.html)
1. [How to get activities using stravalib.](https://stravalib.readthedocs.io/en/latest/get-started/activities.html)
2. [Athlete data using stravalib](https://stravalib.readthedocs.io/en/latest/get-started/athletes.html)
3. [Unit conversion and stravalib](https://stravalib.readthedocs.io/en/latest/get-started/activities.html#stravalib-offers-unit-conversion-helpers)

We welcome contributions to our tutorials and get started documentation if you are a stravalib user and want to contribute!


## How to Contribute to Stravalib

### Contributing quickstart

Ready to contribute? Here's how to set up Stravalib for local development.

1. Fork the repository on GitHub

To create your own copy of the repository on GitHub, navigate to the
`stravalib/stravalib <https://github.com/stravalib/stravalib>` repository
and click the **Fork** button in the top-right corner of the page.

2. Clone your fork locally

Use `git clone` to get a local copy of your stravalib repository on your
local filesystem:

```console
git clone git@github.com:your_name_here/stravalib.git
cd stravalib/
```

3. Set up your fork for local development

Read through our [development guide](https://stravalib.readthedocs.io/en/latest/contributing/development-guide.html) to learn how to:

* [Run our test suite](https://stravalib.readthedocs.io/en/latest/contributing/development-guide.html#about-the-stravalib-test-suite)
* [Build our docs](https://stravalib.readthedocs.io/en/latest/contributing/development-guide.html#documentation)
* [Lint and format our code](https://stravalib.readthedocs.io/en/latest/contributing/development-guide.html#code-format-and-syntax)

### Building from source

To build the project locally and install in editable mode:

1. access the project root directory
2. run:

```bash
$ pip install -e .
```


### Pull Requests and tests

Please add tests that cover any changes that you make to stravalib. Adding tests will greatly reduce the effort of reviewing
and merging your Pull Request. [Read more about our test suite here.](https://stravalib.readthedocs.io/en/latest/contributing/development-guide.html#about-the-stravalib-test-suite). We developed a [mock fixture](https://stravalib.readthedocs.io/en/latest/contributing/development-guide.html#tests-the-stravalib-mock-fixture) that ensures that when tests are run, they are not hitting the Strava API.


## Still reading?

The [published sphinx documentation](https://stravalib.readthedocs.io/) provides much more.

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
  <tbody>
    <tr>
      <td align="center" valign="top" width="14.28%"><a href="https://towardsdatascience.com/@djcunningham0"><img src="https://avatars.githubusercontent.com/u/38900370?v=4?s=100" width="100px;" alt="Danny Cunningham"/><br /><sub><b>Danny Cunningham</b></sub></a><br /><a href="https://github.com/stravalib/stravalib/commits?author=djcunningham0" title="Documentation">πŸ“–</a> <a href="#ideas-djcunningham0" title="Ideas, Planning, & Feedback">πŸ€”</a></td>
      <td align="center" valign="top" width="14.28%"><a href="http://www-ljk.imag.fr/membres/Jerome.Lelong/"><img src="https://avatars.githubusercontent.com/u/2910140?v=4?s=100" width="100px;" alt="Jerome Lelong"/><br /><sub><b>Jerome Lelong</b></sub></a><br /><a href="https://github.com/stravalib/stravalib/issues?q=author%3Ajlelong" title="Bug reports">πŸ›</a></td>
      <td align="center" valign="top" width="14.28%"><a href="https://vortza.com"><img src="https://avatars.githubusercontent.com/u/1788027?v=4?s=100" width="100px;" alt="Jonatan Samoocha"/><br /><sub><b>Jonatan Samoocha</b></sub></a><br /><a href="https://github.com/stravalib/stravalib/commits?author=jsamoocha" title="Code">πŸ’»</a> <a href="https://github.com/stravalib/stravalib/pulls?q=is%3Apr+reviewed-by%3Ajsamoocha" title="Reviewed Pull Requests">πŸ‘€</a> <a href="https://github.com/stravalib/stravalib/commits?author=jsamoocha" title="Documentation">πŸ“–</a> <a href="#maintenance-jsamoocha" title="Maintenance">🚧</a></td>
      <td align="center" valign="top" width="14.28%"><a href="http://www.leahwasser.com"><img src="https://avatars.githubusercontent.com/u/7649194?v=4?s=100" width="100px;" alt="Leah Wasser"/><br /><sub><b>Leah Wasser</b></sub></a><br /><a href="https://github.com/stravalib/stravalib/commits?author=lwasser" title="Code">πŸ’»</a> <a href="https://github.com/stravalib/stravalib/pulls?q=is%3Apr+reviewed-by%3Alwasser" title="Reviewed Pull Requests">πŸ‘€</a> <a href="https://github.com/stravalib/stravalib/commits?author=lwasser" title="Documentation">πŸ“–</a></td>
      <td align="center" valign="top" width="14.28%"><a href="https://github.com/yotam5"><img src="https://avatars.githubusercontent.com/u/69643410?v=4?s=100" width="100px;" alt="Yotam"/><br /><sub><b>Yotam</b></sub></a><br /><a href="https://github.com/stravalib/stravalib/commits?author=yotam5" title="Documentation">πŸ“–</a></td>
      <td align="center" valign="top" width="14.28%"><a href="https://github.com/enadeau"><img src="https://avatars.githubusercontent.com/u/12940089?v=4?s=100" width="100px;" alt="Γ‰mile Nadeau"/><br /><sub><b>Γ‰mile Nadeau</b></sub></a><br /><a href="https://github.com/stravalib/stravalib/commits?author=enadeau" title="Code">πŸ’»</a> <a href="https://github.com/stravalib/stravalib/pulls?q=is%3Apr+reviewed-by%3Aenadeau" title="Reviewed Pull Requests">πŸ‘€</a> <a href="https://github.com/stravalib/stravalib/commits?author=enadeau" title="Documentation">πŸ“–</a> <a href="#maintenance-enadeau" title="Maintenance">🚧</a></td>
    </tr>
  </tbody>
</table>

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "stravalib",
    "maintainer": "Leah Wasser, Hans Lellelid, Jonatan Samoocha, Yihong, \u00c9mile Nadeau",
    "docs_url": "https://pythonhosted.org/stravalib/",
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "strava, running, cycling, athletes",
    "author": null,
    "author_email": "Hans Lellelid <hans@xmpl.org>",
    "download_url": "https://files.pythonhosted.org/packages/40/6e/fdc819ee94009e5d958924b914d7dc02c7a381511f55d4dce9643140f0b8/stravalib-2.2.tar.gz",
    "platform": null,
    "description": "# Welcome to stravalib\n\n[![All Contributors](https://img.shields.io/github/all-contributors/stravalib/stravalib?color=ee8449&style=flat-square)](#contributors)\n[![DOI](https://zenodo.org/badge/8828908.svg)](https://zenodo.org/badge/latestdoi/8828908)\n![PyPI](https://img.shields.io/pypi/v/stravalib?style=plastic) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/stravalib?style=plastic) [![Documentation Status](https://readthedocs.org/projects/stravalib/badge/?version=latest)](https://stravalib.readthedocs.io/en/latest/?badge=latest) ![Package Tests Status](https://github.com/stravalib/stravalib/actions/workflows/build-test.yml/badge.svg) ![PyPI - Downloads](https://img.shields.io/pypi/dm/stravalib?style=plastic) [![codecov](https://codecov.io/gh/stravalib/stravalib/branch/main/graph/badge.svg?token=sHbFJn7epy)](https://codecov.io/gh/stravalib/stravalib)\n\nThe **stravalib** Python package provides easy-to-use tools for accessing and\ndownloading Strava data from the Strava V3 web service. Stravalib provides a Client class that supports:\n\n- Authenticating with stravalib\n- Accessing and downloading Strava activity, club, and profile data\n- Making changes to account activities\n\nIt also provides support for working with date/time/temporal attributes\nand quantities through the [Python Pint library](https://pypi.org/project/Pint/).\n\n## Dependencies\n\n- Python 3.9+\n- [Setuptools](https://pypi.org/project/setuptools/) for building stravalib\n- Other Python libraries (installed automatically when using pip):\n     - [requests](https://pypi.org/project/requests/),\n     - [pytz](https://pypi.org/project/pytz/)\n     - [pint](https://pypi.org/project/pint/)\n     - [arrow](https://pypi.org/project/arrow/),\n     - [pydantic 2.x](https://pypi.org/project/pydantic/)\n\n## Installation\n\nstravalib is available on [PyPI](https://pypi.org/project/stravalib/) and can be installed using `pip`:\n\n`pip install stravalib`\n\n\n## Get started using Stravalib\n\nMost of the methods that you will use with stravalib are in the `stravalib.client.Client` class.\n\nYou may be interested in the following tutorials to get started\n\n1. [How to create\na Strava app.](https://stravalib.readthedocs.io/en/latest/get-started/authenticate-with-strava.html#authenticate-with-the-strava-api-using-stravalib)\n1. [How to authenticate with Strava using stravalib.](https://stravalib.readthedocs.io/en/latest/get-started/authenticate-with-strava.html)\n1. [How to get activities using stravalib.](https://stravalib.readthedocs.io/en/latest/get-started/activities.html)\n2. [Athlete data using stravalib](https://stravalib.readthedocs.io/en/latest/get-started/athletes.html)\n3. [Unit conversion and stravalib](https://stravalib.readthedocs.io/en/latest/get-started/activities.html#stravalib-offers-unit-conversion-helpers)\n\nWe welcome contributions to our tutorials and get started documentation if you are a stravalib user and want to contribute!\n\n\n## How to Contribute to Stravalib\n\n### Contributing quickstart\n\nReady to contribute? Here's how to set up Stravalib for local development.\n\n1. Fork the repository on GitHub\n\nTo create your own copy of the repository on GitHub, navigate to the\n`stravalib/stravalib <https://github.com/stravalib/stravalib>` repository\nand click the **Fork** button in the top-right corner of the page.\n\n2. Clone your fork locally\n\nUse `git clone` to get a local copy of your stravalib repository on your\nlocal filesystem:\n\n```console\ngit clone git@github.com:your_name_here/stravalib.git\ncd stravalib/\n```\n\n3. Set up your fork for local development\n\nRead through our [development guide](https://stravalib.readthedocs.io/en/latest/contributing/development-guide.html) to learn how to:\n\n* [Run our test suite](https://stravalib.readthedocs.io/en/latest/contributing/development-guide.html#about-the-stravalib-test-suite)\n* [Build our docs](https://stravalib.readthedocs.io/en/latest/contributing/development-guide.html#documentation)\n* [Lint and format our code](https://stravalib.readthedocs.io/en/latest/contributing/development-guide.html#code-format-and-syntax)\n\n### Building from source\n\nTo build the project locally and install in editable mode:\n\n1. access the project root directory\n2. run:\n\n```bash\n$ pip install -e .\n```\n\n\n### Pull Requests and tests\n\nPlease add tests that cover any changes that you make to stravalib. Adding tests will greatly reduce the effort of reviewing\nand merging your Pull Request. [Read more about our test suite here.](https://stravalib.readthedocs.io/en/latest/contributing/development-guide.html#about-the-stravalib-test-suite). We developed a [mock fixture](https://stravalib.readthedocs.io/en/latest/contributing/development-guide.html#tests-the-stravalib-mock-fixture) that ensures that when tests are run, they are not hitting the Strava API.\n\n\n## Still reading?\n\nThe [published sphinx documentation](https://stravalib.readthedocs.io/) provides much more.\n\n<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\n<!-- prettier-ignore-start -->\n<!-- markdownlint-disable -->\n<table>\n  <tbody>\n    <tr>\n      <td align=\"center\" valign=\"top\" width=\"14.28%\"><a href=\"https://towardsdatascience.com/@djcunningham0\"><img src=\"https://avatars.githubusercontent.com/u/38900370?v=4?s=100\" width=\"100px;\" alt=\"Danny Cunningham\"/><br /><sub><b>Danny Cunningham</b></sub></a><br /><a href=\"https://github.com/stravalib/stravalib/commits?author=djcunningham0\" title=\"Documentation\">\ud83d\udcd6</a> <a href=\"#ideas-djcunningham0\" title=\"Ideas, Planning, & Feedback\">\ud83e\udd14</a></td>\n      <td align=\"center\" valign=\"top\" width=\"14.28%\"><a href=\"http://www-ljk.imag.fr/membres/Jerome.Lelong/\"><img src=\"https://avatars.githubusercontent.com/u/2910140?v=4?s=100\" width=\"100px;\" alt=\"Jerome Lelong\"/><br /><sub><b>Jerome Lelong</b></sub></a><br /><a href=\"https://github.com/stravalib/stravalib/issues?q=author%3Ajlelong\" title=\"Bug reports\">\ud83d\udc1b</a></td>\n      <td align=\"center\" valign=\"top\" width=\"14.28%\"><a href=\"https://vortza.com\"><img src=\"https://avatars.githubusercontent.com/u/1788027?v=4?s=100\" width=\"100px;\" alt=\"Jonatan Samoocha\"/><br /><sub><b>Jonatan Samoocha</b></sub></a><br /><a href=\"https://github.com/stravalib/stravalib/commits?author=jsamoocha\" title=\"Code\">\ud83d\udcbb</a> <a href=\"https://github.com/stravalib/stravalib/pulls?q=is%3Apr+reviewed-by%3Ajsamoocha\" title=\"Reviewed Pull Requests\">\ud83d\udc40</a> <a href=\"https://github.com/stravalib/stravalib/commits?author=jsamoocha\" title=\"Documentation\">\ud83d\udcd6</a> <a href=\"#maintenance-jsamoocha\" title=\"Maintenance\">\ud83d\udea7</a></td>\n      <td align=\"center\" valign=\"top\" width=\"14.28%\"><a href=\"http://www.leahwasser.com\"><img src=\"https://avatars.githubusercontent.com/u/7649194?v=4?s=100\" width=\"100px;\" alt=\"Leah Wasser\"/><br /><sub><b>Leah Wasser</b></sub></a><br /><a href=\"https://github.com/stravalib/stravalib/commits?author=lwasser\" title=\"Code\">\ud83d\udcbb</a> <a href=\"https://github.com/stravalib/stravalib/pulls?q=is%3Apr+reviewed-by%3Alwasser\" title=\"Reviewed Pull Requests\">\ud83d\udc40</a> <a href=\"https://github.com/stravalib/stravalib/commits?author=lwasser\" title=\"Documentation\">\ud83d\udcd6</a></td>\n      <td align=\"center\" valign=\"top\" width=\"14.28%\"><a href=\"https://github.com/yotam5\"><img src=\"https://avatars.githubusercontent.com/u/69643410?v=4?s=100\" width=\"100px;\" alt=\"Yotam\"/><br /><sub><b>Yotam</b></sub></a><br /><a href=\"https://github.com/stravalib/stravalib/commits?author=yotam5\" title=\"Documentation\">\ud83d\udcd6</a></td>\n      <td align=\"center\" valign=\"top\" width=\"14.28%\"><a href=\"https://github.com/enadeau\"><img src=\"https://avatars.githubusercontent.com/u/12940089?v=4?s=100\" width=\"100px;\" alt=\"\u00c9mile Nadeau\"/><br /><sub><b>\u00c9mile Nadeau</b></sub></a><br /><a href=\"https://github.com/stravalib/stravalib/commits?author=enadeau\" title=\"Code\">\ud83d\udcbb</a> <a href=\"https://github.com/stravalib/stravalib/pulls?q=is%3Apr+reviewed-by%3Aenadeau\" title=\"Reviewed Pull Requests\">\ud83d\udc40</a> <a href=\"https://github.com/stravalib/stravalib/commits?author=enadeau\" title=\"Documentation\">\ud83d\udcd6</a> <a href=\"#maintenance-enadeau\" title=\"Maintenance\">\ud83d\udea7</a></td>\n    </tr>\n  </tbody>\n</table>\n\n<!-- markdownlint-restore -->\n<!-- prettier-ignore-end -->\n\n<!-- ALL-CONTRIBUTORS-LIST:END -->\n",
    "bugtrack_url": null,
    "license": "Apache 2.0 License",
    "summary": "A Python package that makes it easy to access and download data from the Strava V3 REST API.",
    "version": "2.2",
    "project_urls": {
        "changelog": "https://github.com/stravalib/stravalib/blob/main/changelog.md",
        "documentation": "https://stravalib.readthedocs.io",
        "repository": "https://github.com/stravalib/stravalib"
    },
    "split_keywords": [
        "strava",
        " running",
        " cycling",
        " athletes"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "e948d4630695d0839cce5535ac92b1691c2397497e26b238b2b339c1d7aa5e63",
                "md5": "07097ca7c088b723026e2a55d9e2fa99",
                "sha256": "45f9b7b25073701411387b504a8314a95365c20843080a2c4a51f7010a452755"
            },
            "downloads": -1,
            "filename": "stravalib-2.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "07097ca7c088b723026e2a55d9e2fa99",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 125040,
            "upload_time": "2025-02-08T20:51:53",
            "upload_time_iso_8601": "2025-02-08T20:51:53.727216Z",
            "url": "https://files.pythonhosted.org/packages/e9/48/d4630695d0839cce5535ac92b1691c2397497e26b238b2b339c1d7aa5e63/stravalib-2.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "406efdc819ee94009e5d958924b914d7dc02c7a381511f55d4dce9643140f0b8",
                "md5": "901d269d50b58955fce86af23dc28df9",
                "sha256": "e4f96e5db81c279cee10d76d7c607c348c43e827fc7543a505babb6f0f74d9a3"
            },
            "downloads": -1,
            "filename": "stravalib-2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "901d269d50b58955fce86af23dc28df9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 456059,
            "upload_time": "2025-02-08T20:51:56",
            "upload_time_iso_8601": "2025-02-08T20:51:56.819138Z",
            "url": "https://files.pythonhosted.org/packages/40/6e/fdc819ee94009e5d958924b914d7dc02c7a381511f55d4dce9643140f0b8/stravalib-2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-08 20:51:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "stravalib",
    "github_project": "stravalib",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "stravalib"
}
        
Elapsed time: 2.61762s