Utilities and tools for my apis and other life hacks.
Reason this release was yanked:
old
Project description
icakad
Lightweight Python client for managing short links hosted on the linkove.icu worker.
The package exports a small set of helpers that wrap the service API so automations and scripts can add, edit, delete, or list slugs without hand-crafting HTTP requests.
Highlights
- Minimal footprint: only depends on
requests - Module-level configuration for base URL, bearer token, and debug logging
- Uniform response handling that normalises the
listendpoint payload
Installation
pip install icakad
Install requests separately if it is not already available in your environment.
Quick Start
from icakad import add_link, edit_link, delete_link, list_links
from icakad import shorturl
# Configure credentials and optional debugging up front
shorturl.HEADERS["Authorization"] = "Bearer <your-token>"
shorturl.DEBUG = False
# Create or overwrite a slug
add_link(slug="docs", url="https://example.com/docs")
# Update an existing slug
edit_link(slug="docs", new_url="https://example.com/documentation")
# Fetch the full catalogue
links = list_links()
print(links.get("docs"))
# Remove a slug
delete_link(slug="docs")
Each helper returns the JSON body produced by the worker. Inspect it for status codes, error messages, or additional metadata.
API Reference
All helpers live in icakad.shorturl and are re-exported at the package root for convenience.
| Function | Description |
|---|---|
add_link(slug: str, url: str) -> dict |
Create or overwrite a slug with the target URL. |
edit_link(slug: str, new_url: str) -> dict |
Update an existing slug. Backed by POST /api/<slug>. |
delete_link(slug: str) -> dict |
Delete the slug via DELETE /api/<slug>. |
list_links() -> dict[str, str] |
Retrieve all slugs. Normalises both list-style and {"items": [...]} payloads. |
Configuration
Tweak behaviour by adjusting attributes on icakad.shorturl:
BASE: API root (defaulthttps://linkove.icu). Point this elsewhere for staging or local testing.HEADERS: Dictionary of headers supplied with every request. Set the bearer token here.DEBUG: WhenTrue, prints HTTP status codes and JSON responses to stdout.
Feel free to override the module-level requests usage with your own session or retry logic by wrapping these helpers.
Error Handling Tips
- Wrap calls in
try/except requests.RequestExceptionfor transport-level issues. - Validate mandatory keys in the returned JSON before relying on them.
- Enable
DEBUGwhen tuning your worker or troubleshooting authentication.
Development
Clone the repository and install it in editable mode:
pip install -e .
Build packages:
python -m build
Run any tests or scripts you add:
python -m pytest
Contributions that improve ergonomics (e.g., async helpers, richer error handling) are welcome.
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 icakad-0.1.2.tar.gz.
File metadata
- Download URL: icakad-0.1.2.tar.gz
- Upload date:
- Size: 14.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88e83551ae811b8f178331b515a82ee06db05479d02e5fadc1ff395ec1106ad4
|
|
| MD5 |
35ac7c637e996215bcf85f9ad7a7844d
|
|
| BLAKE2b-256 |
3d5eb283acfaed916b9f57680a496890da25834856b3ace69c06d1cdabd4bced
|
File details
Details for the file icakad-0.1.2-py3-none-any.whl.
File metadata
- Download URL: icakad-0.1.2-py3-none-any.whl
- Upload date:
- Size: 13.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30e7fe5f458198a6d4fbb36ea159f560f4b3c8e4ac65b2678a4df41ae41578fd
|
|
| MD5 |
fabac85d5f0309c65ddf8db3a3bcf568
|
|
| BLAKE2b-256 |
0ac5617ad887a204944b0866096dea7a854801dd478dc6f195f31623bab28f3a
|