cd /news/developer-tools/i-built-a-zero-dependency-python-lib… · home topics developer-tools article
[ARTICLE · art-40309] src=dev.to ↗ pub= topic=developer-tools verified=true sentiment=↑ positive

I Built a Zero-Dependency Python Library for OTP Codes

A developer built otp-gateway, a zero-dependency Python library that reads OTP codes from email inboxes via IMAP, eliminating the need for external APIs or services. The library supports generating email aliases and waiting for OTPs, and works with platforms like GitHub, Google, Discord, and OpenAI. It is MIT licensed and available on GitHub.

read1 min views1 publishedJun 26, 2026

Every automation project hits the same wall: OTP verification.

You're building a bot, a scraper, an automation tool — and then you need to verify an account. GitHub, Google, Discord, OpenAI... they all want a code sent to your email.

Your options:

otp-gateway reads OTP codes directly from your inbox via IMAP.

pip install otp-gateway

No API keys. No external services. Just IMAP.

from otp_gateway import OTPGateway, OTPConfig

config = OTPConfig(
    imap_email="you@gmail.com",
    imap_password="your-app-password",
    domain="yourdomain.com",
)

gw = OTPGateway(config)

alias = gw.generate_alias("github")
print(alias)  # "github-a7k2m3@yourdomain.com"

result = gw.wait_for_otp(alias, timeout=90)
print(result["value"])  # "847291"

otp-gateway wait user@domain.com

In automation, every dependency is a risk:

otp-gateway uses only Python's standard library. Copy the otp_gateway/

folder into your project and it works.

$ otp-gateway wait github@yourdomain.com
⏳ Waiting for OTP at github@yourdomain.com...
✅ OTP found: 847291 (GitHub)

$ otp-gateway check --email user@domain.com --since 5m

$ otp-gateway alias github
github-a7k2m3@yourdomain.com

GitHub, Google, Discord, OpenAI, Anthropic, DeepSeek, AWS, Azure, Vercel, Netlify, Cloudflare, DigitalOcean, HuggingFace, Stripe, and 15+ more. The pattern library is easily extensible.

pip install otp-gateway

MIT licensed. PRs welcome.

If you build automation tools, give it a try. If you find it useful, a star on GitHub means a lot.

── more in #developer-tools 4 stories · sorted by recency
── more on @otp-gateway 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/i-built-a-zero-depen…] indexed:0 read:1min 2026-06-26 ·