<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Nuzuli</title>
    <description>The latest articles on DEV Community by Nuzuli (@nuzuli).</description>
    <link>https://dev.to/nuzuli</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4258424%2Fe99aea01-899d-477b-9534-311da01fe533.jpg</url>
      <title>DEV Community: Nuzuli</title>
      <link>https://dev.to/nuzuli</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nuzuli"/>
    <language>en</language>
    <item>
      <title>Building a Username Checker With Zero Dependencies (Python Standard Library Only)</title>
      <dc:creator>Nuzuli</dc:creator>
      <pubDate>Sun, 22 Nov 2026 08:14:48 +0000</pubDate>
      <link>https://dev.to/nuzuli/building-a-username-checker-with-zero-dependencies-python-standard-library-only-4chd</link>
      <guid>https://dev.to/nuzuli/building-a-username-checker-with-zero-dependencies-python-standard-library-only-4chd</guid>
      <description>&lt;p&gt;Is octocat taken on Mastodon? What about Keybase, Chess.com, or Hugging Face?&lt;/p&gt;

&lt;p&gt;I got tired of answering questions like that by opening profile pages one by one, so I built a small CLI that checks a username across 20 platforms in a single command:&lt;/p&gt;

&lt;p&gt;pip install sosmed-scanner&lt;br&gt;
sosmed-scanner octocat&lt;/p&gt;

&lt;p&gt;GitHub — found — &lt;a href="https://github.com/octocat" rel="noopener noreferrer"&gt;https://github.com/octocat&lt;/a&gt;&lt;br&gt;
GitLab — unknown — &lt;a href="https://gitlab.com/octocat" rel="noopener noreferrer"&gt;https://gitlab.com/octocat&lt;/a&gt;&lt;br&gt;
Reddit — found — &lt;a href="https://www.reddit.com/user/octocat" rel="noopener noreferrer"&gt;https://www.reddit.com/user/octocat&lt;/a&gt;&lt;br&gt;
Mastodon — found — &lt;a href="https://mastodon.social/@octocat" rel="noopener noreferrer"&gt;https://mastodon.social/@octocat&lt;/a&gt;&lt;br&gt;
Dribbble — not_found — &lt;a href="https://dribbble.com/octocat" rel="noopener noreferrer"&gt;https://dribbble.com/octocat&lt;/a&gt;&lt;br&gt;
Hugging Face — found — &lt;a href="https://huggingface.co/octocat" rel="noopener noreferrer"&gt;https://huggingface.co/octocat&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The part I want to talk about is not the tool itself, but a constraint I gave myself: standard library only. No requests, no httpx, no third-party packages at all. Here is what that decision taught me.&lt;/p&gt;

&lt;p&gt;Why stdlib only?&lt;/p&gt;

&lt;p&gt;Three reasons:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install is one step. pip install sosmed-scanner, done. There is no dependency tree that can break, conflict with your environment, or disappear.&lt;/li&gt;
&lt;li&gt;Auditing is trivial. The whole network layer is a few dozen lines of urllib. Anyone can read exactly what leaves their machine.&lt;/li&gt;
&lt;li&gt;It forces you to understand the problem. With no library smoothing things over, every edge case — timeouts, redirects, rate limits, servers that just close the connection — lands on your desk.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The price is real too: you write more code, and some of it is uglier than the requests equivalent. For a tool this small, I think the trade is worth it.&lt;/p&gt;

&lt;p&gt;The whole network layer fits on one screen&lt;/p&gt;

&lt;p&gt;This is the actual fetch function from the project:&lt;/p&gt;

&lt;p&gt;def fetch_status(url: str, timeout: float = DEFAULT_TIMEOUT) -&amp;gt; HttpResult:&lt;br&gt;
"""Request a public URL and return its HTTP status code.&lt;/p&gt;

&lt;p&gt;Network problems never raise: they are reported through error.&lt;br&gt;
"""&lt;br&gt;
request = urllib.request.Request(url, headers={"User-Agent": USER_AGENT})&lt;br&gt;
try:&lt;br&gt;
    with urllib.request.urlopen(request, timeout=timeout) as response:&lt;br&gt;
        return HttpResult(url=url, status=response.status)&lt;br&gt;
except urllib.error.HTTPError as error:&lt;br&gt;
    return HttpResult(url=url, status=error.code)&lt;br&gt;
except OSError as error:&lt;br&gt;
    # URLError and TimeoutError are both subclasses of OSError.&lt;br&gt;
    return HttpResult(url=url, status=None, error=str(error))&lt;/p&gt;

&lt;p&gt;Two details matter here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HTTPError is caught separately, because for this tool an HTTP 404 is not a failure — it is an answer ("this username does not exist here").&lt;/li&gt;
&lt;li&gt;Network problems never raise. A timeout or a refused connection is returned as data (status=None plus the error message), so the caller can report it instead of crashing halfway through a 20-platform scan.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The User-Agent is descriptive — sosmed-scanner/0.4.0 (+&lt;a href="https://github.com/Nuzuli/sosmed-scanner" rel="noopener noreferrer"&gt;https://github.com/Nuzuli/sosmed-scanner&lt;/a&gt;) — so site operators can see what is hitting their servers and where to complain. The scanner also waits a short delay between requests. Checking usernames is not worth being a rude guest.&lt;/p&gt;

&lt;p&gt;Three statuses, because "I don't know" is an answer&lt;/p&gt;

&lt;p&gt;Most username checkers give you two outcomes: found or not found. Real life has a third: the site refused to tell you. Rate limits (HTTP 429), bot walls (403), and servers that hang up mid-request are all common.&lt;/p&gt;

&lt;p&gt;So the tool has three statuses:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;found — the profile page returned HTTP 200&lt;/li&gt;
&lt;li&gt;not_found — it returned HTTP 404&lt;/li&gt;
&lt;li&gt;unknown — anything else, with the reason attached&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Guessing in the third case would produce confident wrong answers, which is worse than no answer. If a platform blocks the check, the honest output is "unknown (HTTP 403)", not a coin flip.&lt;/p&gt;

&lt;p&gt;Every platform had to pass a live test to get in&lt;/p&gt;

&lt;p&gt;A platform is just a URL pattern — &lt;a href="https://github.com/%7Busername%7D" rel="noopener noreferrer"&gt;https://github.com/{username}&lt;/a&gt;, &lt;a href="https://sr.ht/%7E%7Busername%7D" rel="noopener noreferrer"&gt;https://sr.ht/~{username}&lt;/a&gt;, and so on. But a pattern is only useful if the site actually behaves: an existing profile must return 200, and a nonexistent username must return 404.&lt;/p&gt;

&lt;p&gt;Before any platform was added, I verified it live with the tool's own fetcher. Plenty of candidates failed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Some big sites return 200 for usernames that don't exist, so a 404-based check can never work there.&lt;/li&gt;
&lt;li&gt;Some block automated requests outright, which would fill the results with unknown.&lt;/li&gt;
&lt;li&gt;A few simply don't have public profile URLs in a checkable form.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those platforms were left out. The list that survived — GitHub, GitLab, Reddit, Medium, DEV, PyPI, YouTube, Mastodon, Tumblr, Flickr, SoundCloud, Dribbble, Linktree, Gravatar, Codeberg, SourceHut, Keybase, Chess.com, Docker Hub, and Hugging Face — is smaller than the "hundreds of sites" other tools advertise, but every entry on it is one I can stand behind.&lt;/p&gt;

&lt;p&gt;The test suite (42 tests, ~99% coverage) is entirely mock-based, so CI never touches the network; the live verification happens once, when a platform is added, not on every run.&lt;/p&gt;

&lt;p&gt;Try it&lt;/p&gt;

&lt;p&gt;pip install sosmed-scanner&lt;br&gt;
sosmed-scanner your-username&lt;/p&gt;

&lt;p&gt;Output is plain text, JSON (--json), or CSV (--csv) if you want to script around it. The source is MIT-licensed: &lt;a href="https://github.com/Nuzuli/sosmed-scanner" rel="noopener noreferrer"&gt;https://github.com/Nuzuli/sosmed-scanner&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Two questions for you:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Which platform should be added next — and does it actually return 404 for a username that doesn't exist?&lt;/li&gt;
&lt;li&gt;If you've built something stdlib-only, where did you draw the line? What was the first edge case that made you miss a library?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Full source: &lt;a href="https://github.com/Nuzuli/sosmed-scanner" rel="noopener noreferrer"&gt;https://github.com/Nuzuli/sosmed-scanner&lt;/a&gt; — also listed for sale on SideProjectors if you'd like to take it further than I can.&lt;/p&gt;

</description>
      <category>python</category>
      <category>opensource</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
