Skip to main content

Python library for using the Trackbear app API https://help.trackbear.app/api

Project description

Python 3.10 | 3.11 | 3.12 | 3.13 | 3.14 Code style: black Nox

pre-commit.ci status Python tests

trackbear-api


Deveploment in progress

Python library for using the Trackbear app API https://help.trackbear.app/api

Installation

tbd

Example use

Defining a client

The client allows you to communicate with TrackBear's API. It requires your API token and allows you to define a custom User-Agent header if desired.

See the .env.example file for which environment variables are supported.

from trackbear_api import TrackBearClient

# If TRACKBEAR_API_TOKEN is set in the environment
client = TrackBearClient()

# To provide the API token directly
client = TrackBearClient(api_token="provide your token directly")

# Default User-Agent header can be replaced directly or through the environment
client = TrackBearClient(user_agent="My Custom App/1.0 (https://...)")

# GET a list of projects: https://help.trackbear.app/api/Projects_list
# POST, PATCH, DELETE are also available with the same behaviors
response = client.get("/project")

if not response.success:
    raise ValueError(f"Error: {response.code}: {response.message}")

for project in response.data:
    print(project["title"])

TrackBearResponse object

Attribute Type Description
.success bool True or False if the request was succesful.
.data Any API response if success is True
.error.code str Error code if success is False
.error.message str Error message if success is False
.status_code int The HTTP status code of the response
.remaining_requests int Number of requests remaining before rate limits apply
.rate_reset int Number of seconds before remaining_requests resets

Rate Limiting

Rate limiting is defined by the TrackBear API here: https://help.trackbear.app/api/rate-limits

This library does not enforce the rate limits. It is on the client to monitor the returned rate limit information and act accordingly.

Logging

All loggers use the name trackbear-api. No handlers are defined by default in this library.

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

trackbear_api-0.0.2.tar.gz (49.4 kB view details)

Uploaded Source

Built Distribution

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

trackbear_api-0.0.2-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file trackbear_api-0.0.2.tar.gz.

File metadata

  • Download URL: trackbear_api-0.0.2.tar.gz
  • Upload date:
  • Size: 49.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for trackbear_api-0.0.2.tar.gz
Algorithm Hash digest
SHA256 f46d2e7273394b012c1963efb54ae09acbd49571c7764d5fb1bef75f4ec1c28c
MD5 ab181134c8343b71c07db222ca842b5d
BLAKE2b-256 41387b576bf7a574a90de31c0dd3a5c71d646e88c2afda23883f650d146f4e6c

See more details on using hashes here.

Provenance

The following attestation bundles were made for trackbear_api-0.0.2.tar.gz:

Publisher: pypi-publish.yml on Preocts/trackbear-api

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

File details

Details for the file trackbear_api-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: trackbear_api-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for trackbear_api-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 833829b9f0a34e91fbad0041841b5b508148128750d0f7a7c67a84babed67eb1
MD5 093eb12caad7486ddcb6a5d556099f61
BLAKE2b-256 b8ddf5da521548bcfeb521ba54c3c54635c1a69827704278b633cda3c7460b30

See more details on using hashes here.

Provenance

The following attestation bundles were made for trackbear_api-0.0.2-py3-none-any.whl:

Publisher: pypi-publish.yml on Preocts/trackbear-api

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