Files
handbook/docs/libraries.md
T
dsql 4fd19bf620 rename to 'rethink development', brighten lib table, drop stale note
- Rename site 'a rethink development' -> 'rethink development' (site_name,
  landing H1); copyright -> 'rethink development (handbook)'.
- libraries.md: remove the 'if the live list is empty' admonition now that
  Gitea CORS is fixed.
- extra.css: improve Library-column readability — brighter #cfe6ff code
  chips on a cyan-tinted bg, more weight, roomier cell padding (0.7/1em),
  nowrap lib names, accent-colored links.

Signed-off-by: disqualifier <dev@disqualifier.me>
2026-06-29 20:35:16 -04:00

4.0 KiB

Libraries

The shared rethink-public library suite. Before hand-rolling common functionality — retry/backoff, logging setup, HTTP sessions, proxies, webhooks, IMAP/mail, datastore/KV, crypto, discord.py helpers, timing/paths/masking utilities — check here first and prefer an existing lib.

This list is pulled live from Gitea, so a new library in the org shows up on the next page load — nothing here is rebuilt or version-pinned. Each entry links to the repo, where the README and tags live.

Install

Pin a tag in your dependencies — never an unpinned branch:

<lib> @ git+https://git.rethinkstudios.io/rethink-public/<lib>.git@<tag>

??? example "Using a library — install, import, go"

Add it to your project's deps (e.g. `pyproject.toml`):

```toml
[project]
dependencies = [
    "aioweb @ git+https://git.rethinkstudios.io/rethink-public/aioweb.git@v0.3.1",
]
```

Then use it — the README in each repo has the real surface; this is the shape:

```python
import asyncio

from aioweb import Session


async def main() -> None:
    """fetch a page through the shared async http session"""
    async with Session() as web:
        resp = await web.get("https://example.test")
        print(resp.status, len(resp.content))


asyncio.run(main())
```

Need to bump a lib? Change the `@<tag>` and reinstall — versions live with the
lib, not in these docs.

Loading libraries from Gitea…

<script> (function () { var API = "https://git.rethinkstudios.io/api/v1/orgs/rethink-public/repos?limit=50"; var REPO_BASE = "https://git.rethinkstudios.io/rethink-public"; var FALLBACK = 'Could not load the live list. View the libraries directly at ' + 'git.rethinkstudios.io/rethink-public.'; // Non-library repos to exclude from the render. var DENYLIST = ["handbook", ".profile", ".profile-private"]; function isLibrary(repo) { if (!repo || !repo.name) return false; if (repo.name.charAt(0) === ".") return false; // any dot-repo return DENYLIST.indexOf(repo.name) === -1; } function escapeHtml(s) { return String(s == null ? "" : s) .replace(/&/g, "&").replace(//g, ">") .replace(/"/g, """); } function render(repos) { var libs = repos.filter(isLibrary).sort(function (a, b) { return a.name.localeCompare(b.name); }); var el = document.getElementById("lib-list"); if (!libs.length) { el.innerHTML = '

No libraries found. Browse the org at ' + 'git.rethinkstudios.io/rethink-public.

'; return; } var rows = libs.map(function (r) { var url = r.html_url || (REPO_BASE + "/" + r.name); var desc = r.description ? escapeHtml(r.description) : "No description."; var lang = r.language ? '' + escapeHtml(r.language) + "" : ''; return '' + escapeHtml(r.name) + "" + desc + "" + lang + ""; }).join(""); el.innerHTML = '
' + "" + "" + rows + "
LibraryWhat it doesLanguage
"; } function fail() { document.getElementById("lib-list").innerHTML = '

' + FALLBACK + '

'; } try { fetch(API, { headers: { "Accept": "application/json" } }) .then(function (resp) { if (!resp.ok) throw new Error("HTTP " + resp.status); return resp.json(); }) .then(function (data) { if (!Array.isArray(data)) throw new Error("unexpected response"); render(data); }) .catch(fail); } catch (e) { fail(); } })(); </script>