Skip to content

tibberous/hooks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hooks

Pragmatic, single-file Python wrappers around the APIs and services you actually end up needing on every project. Drop the file you want into your project, fill in a config key, and call the function. No frameworks, no plugin systems, no DI containers — just import name_hook and go.

Originally extracted from the CutiePy hook library (~70 modules accumulated across years of glue work for AI agents, desktop automation, and server admin).

About

Built by Trent Tompkins — independent software development consultancy.

📞 (724) 431-5207 — call for a free consultation 🌐 https://trentontompkins.com

Mobile apps, websites, desktop applications, AI integrations, deploy automation — pragmatic, ships-on-time work. If your project needs any of these APIs wired up properly (or just needs to ship), get in touch.

Setup

git clone https://github.com/tibberous/hooks
cd hooks
cp config.example.ini config.ini   # then edit, fill in the keys you actually use
pip install requests               # most hooks just need requests

config.ini is git-ignored. Every hook reads from environment variables FIRST, then falls back to the matching [section] in config.ini. You can use either or both; the env var always wins.

Some hooks pull in optional libraries (anthropic, google-api-python-client, selenium, playwright, PyMuPDF, opencv-python, ...). Each hook's docstring lists what it needs.

Hooks at a glance

AI / LLM providers

Hook Wraps Most useful function
chatgtp_hook.py OpenAI ChatGPT (text/vision/image-gen/files) ask(prompt, model)
claude_hook.py Anthropic Claude (text + vision) ask(prompt, model)
gemini_hook.py Google Gemini (text/vision/Imagen) chat(prompt, model)
ollama_hook.py Local Ollama models ask(prompt, model)
claude_bridge_hook.py Claude.ai via SuperGrok browser bridge (uses your subscription) ask(prompt)
gemini_bridge_hook.py Gemini.google.com via SuperGrok browser bridge ask(prompt)
file_to_model.py Upload local file → OpenAI model → get output back analyze(file, prompt, model)
from chatgtp_hook import ask
print(ask("In one sentence, what is Python?", model="gpt-4o-mini"))

Media generation

Hook Wraps Most useful function
runway_hook.py RunwayML (T2I, I2V, TTS, voice dubbing) action_text_to_image(args) (CLI)
stability_hook.py Stability AI (SDXL T2I) generate(prompt, out_path)
sd_hook.py Local Stable Diffusion / Forge generate(prompt, out_path)
elevenlabs_hook.py ElevenLabs TTS tts(text, voice_id, out_path)

Email

Hook Wraps Most useful function
email_hook.py SMTP self-test send_email(to)
email_check_hook.py IMAP inbox listing list_latest(limit)
email_password_hook.py SMTP + IMAP combined (send, list, read, trash, mark) send_email(to, subject, body)
gmail_api_hook.py Gmail API (per-user OAuth) send(to, subject, body)
sendgrid_hook.py SendGrid transactional email send(to, subject, html)
twilio_hook.py Twilio SMS send_sms(to, body)

Google Workspace

Hook Wraps Most useful function
google_workspace_hook.py Drive + Sheets + Calendar + Admin SDK (service account) workspaceDriveListFiles(query)
google_sheets_hook.py Sheets v4 (read/append/update/clear) read_range(sheet_id, range)

Server admin / DevOps

Hook Wraps Most useful function
aapanel_hook.py aaPanel HTTP API (sites/SSL/DB/files/cron/FTP/firewall) sites_list()
namesilo_hook.py NameSilo domain registrar + DNS list_domains()
cloudflare_hook.py Cloudflare API v4 (zones/DNS/cache) list_zones()
github_hook.py GitHub REST v3 (repos/issues/files) create_repo(name)
nginx_hook.py Local Windows nginx control status()
winscp_hook.py WinSCP.com SFTP/SCP/FTP automation put(local, remote)
winscp_put_hook.py Focused WinSCP uploader with inline payloads put_file(local, remote)
whois_hook.py WHOIS + DNS resolution lookup(domain)

Web / scraping

Hook Wraps Most useful function
selenium_hook.py Selenium (Chrome) screenshot(url, out_path)
playwright_hook.py Playwright (Chromium/Firefox/WebKit) screenshot(url, out_path)
browserless_hook.py Browserless.io (hosted Chrome) screenshot(url, out_path)
serp_hook.py SerpAPI (Google search results) search(query)
local_internet_hook.py requests + DuckDuckGo/Bing scraping fetch(url)
indeed_hook.py Indeed job search scraper search(query, location)
airtable_hook.py Airtable records CRUD list_records(base, table)
x_hook.py X / Twitter (OAuth1 + Bearer) post_tweet_oauth1(text)

Desktop / system

Hook Wraps Most useful function
gui_hook.py Windows screenshots + mouse control screenshot() / click(x, y)
mouse_hook.py Cursor read + move position() / move(x, y)
screencapture_hook.py Full screen / region / window capture capture()
webcam_hook.py OpenCV webcam (still / record / preview) capture(out_path)
process_hook.py List/kill/inspect Windows processes list_processes()
service_hook.py Windows service control status(name)
long_process_hook.py Background job lifecycle (start/wait/tail/stop) start_job(cmd)
socket_hook.py File-backed socket command sessions create_session(worker)

Files / media utilities

Hook Wraps Most useful function
pdf_hook.py WeasyPrint (HTML→PDF) + PyMuPDF (extract text) html_to_pdf(html, out) / extract_text(pdf)
image_data_hook.py EXIF + PIL metadata read(image_path)
imagemagick_hook.py ImageMagick CLI (resize/crop/convert) resize(src, dst, w, h)
zip_hook.py Zip create/extract/list create(out, files)
rar_hook.py WinRAR list/test/extract/add extract(rar, dest)
curl_verify_hook.py curl.exe header/body capture + log verify(url)
env_audit_hook.py Python/Torch/CUDA env probe audit()

Internal / helpers

  • _config.py — shared getConfig(section, key, env=, default=) reader used by every refactored hook.
  • _journal.py, _md5check.py, hook_lifecycle.py, hook_orm.py, trio_hook_lifecycle.py, trio_hook_orm.py — internal plumbing for the CutiePy DB logging path. Most hooks degrade gracefully if these aren't present.

Config sections

config.example.ini is the single source of truth for every key/section the library knows about. Copy it to config.ini and fill only the sections for the hooks you actually use. Sections include:

[openai], [anthropic], [gemini], [runway], [stability], [elevenlabs], [stable_diffusion], [ollama], [google], [gmail], [google_sheets], [github], [aapanel], [namesilo], [cloudflare], [twilio], [sendgrid], [email], [x], [browserless], [airtable], [serp], [winscp], [selenium], [playwright], [indeed], [nginx], [paths], [api_keys].

Usage pattern

Most hooks are dual-mode: import + call, or run from the CLI.

# CLI
python aapanel_hook.py sites list
python runway_hook.py text-to-image --prompt "a wizard" --output wiz.png
python twilio_hook.py send --to +15551234567 --body "Hello"
# Import
from aapanel_hook import sites_list, ssl_apply_letsencrypt
sites_list()
ssl_apply_letsencrypt("arcomage.org", "www.arcomage.org")

Security

  • config.ini is .gitignored and must never be committed. config.example.ini is the committed template and has only placeholders.
  • Tokens in token.json / credentials.json / *.ppk / *.pem are also git-ignored by default.
  • If you fork this and add a new hook, follow the same pattern: read via _config.getConfig(), never embed a key in source.

License

MIT — see LICENSE.txt.

About

Pragmatic Python wrappers around common APIs (OpenAI, Anthropic, Gemini, Runway, Stability, Gmail/Workspace, aaPanel, NameSilo, ElevenLabs, WinSCP, Selenium, ...). Config-driven.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages