Python client for the Tickr API (counters service)
Project description
Tickr Python Client
A Python client library for interacting with the Tickr API (counters service).
Features
- Fetch all your counters (requires authentication)
- Create a new counter (requires authentication)
- Fetch a public counter by slug
- Increment a counter (public or private, depending on API config)
- Update a counter (requires authentication and ownership)
- Delete a counter (requires authentication and ownership)
Installation
pip install -e .
Usage
from tickr_client import TickrClient
# Create a client instance (JWT is optional, for authenticated endpoints)
# You can get your API JWT from the Tickr API docs page: https://tickr.cc/api-docs
client = TickrClient(jwt="YOUR_API_JWT")
# Fetch all counters (authenticated)
counters = client.get_counters()
# Create a new counter (authenticated)
new_counter = client.create_counter(name="My Counter", initial_value=10)
# Fetch a public counter by slug
public_counter = client.get_counter(slug="abc123xyz")
# Increment a counter (public or private)
updated_counter = client.increment_counter(slug="abc123xyz", increment_by=2)
# Update a counter (authenticated, owner only)
updated = client.update_counter(slug="abc123xyz", name="Renamed", current_value=42)
# Delete a counter (authenticated, owner only)
client.delete_counter(slug="abc123xyz")
Authentication
For authenticated endpoints, obtain a API JWT and pass it to the client. Public endpoints do not require authentication.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tickr_client-0.1.1.tar.gz
(4.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tickr_client-0.1.1.tar.gz.
File metadata
- Download URL: tickr_client-0.1.1.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e5ef102d9ca0f04165664c3c35443be0ea3226d1d3162061fa4e9a4f1913476
|
|
| MD5 |
887ee26fba9453c2e586596b63e2cea8
|
|
| BLAKE2b-256 |
115ffa2bea7e15ecc6b0519595ef2d0ef4adf492f812b8a2acd7cbf82264076a
|
File details
Details for the file tickr_client-0.1.1-py3-none-any.whl.
File metadata
- Download URL: tickr_client-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
412285016076fdd0570a16c5fed29d57e3dbeec830a90fde6d64727935cdbcfa
|
|
| MD5 |
c8bbfe934865c9204d700d0a1fc07940
|
|
| BLAKE2b-256 |
d020e7d971f0c3014aa9b80ab2188ec610dc8006d551f51c733fa3c1b3a393ba
|