Skip to main content

Intervals.icu API

Project description

python-intervals-icu-client

A Python client library for the Intervals.icu API.

NOTE: This client is in early development and not published to PyPI yet. You can install it directly from the GitHub repository as described below. Most functionality should work, but most of the endpoints have not been tested yet. Check tests/functional and tests/integration for examples of usage.

Requirements.

Python 3.9+

Installation & Usage

pip install

Install directly from the GitHub repository using pip:

pip install git+https://github.com/LeonardHd/python-intervals-icu-client.git

Then import the package:

import intervals_icu_client

Example usage

Please follow the installation procedure and then run the following:

import intervals_icu_client
from intervals_icu_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://intervals.icu
# See configuration.py for a list of all supported configuration parameters.
configuration = intervals_icu_client.Configuration(
    host = "https://intervals.icu"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: APIKey
configuration = intervals_icu_client.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Configure Bearer authorization: AccessToken
configuration = intervals_icu_client.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)


# Enter a context with an instance of the API client
with intervals_icu_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = intervals_icu_client.ActivitiesApi(api_client)
    id = 'id_example' # str | 
    activity = intervals_icu_client.Activity() # Activity | 

    try:
        # Create a manual activity
        api_response = api_instance.create_manual_activity(id, activity)
        print("The response of ActivitiesApi->create_manual_activity:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling ActivitiesApi->create_manual_activity: %s\n" % e)

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

intervals_icu_client-0.0.1.tar.gz (176.9 kB view details)

Uploaded Source

Built Distribution

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

intervals_icu_client-0.0.1-py3-none-any.whl (285.8 kB view details)

Uploaded Python 3

File details

Details for the file intervals_icu_client-0.0.1.tar.gz.

File metadata

  • Download URL: intervals_icu_client-0.0.1.tar.gz
  • Upload date:
  • Size: 176.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for intervals_icu_client-0.0.1.tar.gz
Algorithm Hash digest
SHA256 e09bcea531af336fb8707858588b5bd55f8f907390e1a6e7377a5cb514882f02
MD5 a7e9b77361e86ebc7dcbefe65a03002a
BLAKE2b-256 549c3ded84ba82f6977638e3bb69076646d8ec3aa15274f17fd2b9a4211524e2

See more details on using hashes here.

Provenance

The following attestation bundles were made for intervals_icu_client-0.0.1.tar.gz:

Publisher: release.yml on LeonardHd/python-intervals-icu-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file intervals_icu_client-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for intervals_icu_client-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c949856aa062d7a09d3466adeb66089bc3ed620b7b03e740d3729c78e8780b6f
MD5 b5c1bff0bc101660b724d8834b788aec
BLAKE2b-256 109816a6ae6430183d039c58be6218b72dab8e3939a9c3ce333d1563cc164bb5

See more details on using hashes here.

Provenance

The following attestation bundles were made for intervals_icu_client-0.0.1-py3-none-any.whl:

Publisher: release.yml on LeonardHd/python-intervals-icu-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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