Python client for the Tickr API (counters service)
Project description
Tickr Python Client
Simple, Shareable, Powerful Counters for Anything.
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)
- Supports API key authentication (recommended; JWT is deprecated)
- Supports
is_privateandis_readonlycounter properties
Installation
pip install -e .
Usage
from tickr_client import TickrClient
# Create a client instance (API key is recommended for authenticated endpoints)
# You can get your API key from the Tickr API docs page: https://tickr.cc/api-docs
client = TickrClient(api_key="YOUR_API_KEY")
# Fetch all counters (authenticated)
counters = client.get_counters()
# Create a new counter (authenticated, with privacy/read-only options)
new_counter = client.create_counter(name="My Counter", initial_value=10, is_private=True, is_readonly=False)
# 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, is_private=False)
# Delete a counter (authenticated, owner only)
client.delete_counter(slug="abc123xyz")
Authentication
For authenticated endpoints, obtain an API key from your Tickr dashboard and pass it to the client as api_key. Public endpoints do not require authentication.
Note: JWT authentication is deprecated. Use API keys for all new integrations.
Counter Properties
is_private: IfTrue, only authorized users can increment the counter.is_readonly: IfTrue, the counter cannot be incremented by anyone.
These properties are always included in returned counter objects.
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
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.2.tar.gz.
File metadata
- Download URL: tickr_client-0.1.2.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d02d968320f96a465484696a34e14d1d963b4afe23de706a1d9f208f551b78e9
|
|
| MD5 |
3df270ceb3ed4b398e12c1b9d8271b00
|
|
| BLAKE2b-256 |
228d1b427cd98eed2598387330273c399b34cf5145ff5b654821a2dac4c06d4a
|
File details
Details for the file tickr_client-0.1.2-py3-none-any.whl.
File metadata
- Download URL: tickr_client-0.1.2-py3-none-any.whl
- Upload date:
- Size: 5.7 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 |
5ff35861c5c60e568755c984741270df6ee1dd1a296d4229aac76de181f8f5e5
|
|
| MD5 |
35c0653c64d743e5df31e59e649c89f8
|
|
| BLAKE2b-256 |
37ac69f323d8d4a18acb77758c6f60e82d10a70c6e49c92dec00d041fc40eee1
|