I'm building 120 small open-source libraries in 60 nights. Two a night, every night. The kind of libraries you wish existed when you just want one focused job done without dragging in a hundred transitive dependencies.
So far: 78 of 120 done.
I write tests before code. Every project here lives or dies by its test suite, and after Night 27 I started enforcing 100% line and branch coverage as the bar. If a branch can't be reached, I delete it. No "this won't happen in practice" exceptions.
Python projects pass mypy --strict. TypeScript projects pass
tsc --strict --noEmit with the full strictness panel turned on
(exactOptionalPropertyTypes, noImplicitAny, the lot). Functions
stay under 30 lines. Nesting stays under 3 levels. I verify both
with an AST walk before every push.
Almost everything is zero runtime dependencies. When I need a parser, I write the parser. When I need a date library, I write the date library. The point of this sprint is to get good at the fundamentals, not to glue other people's code together.
Every repo has an MIT license, a real README with install instructions, a quick-start example, an API reference, and a section explaining how to run the tests yourself.
These are the projects I'd reach for if I were stranded on a desert island with a config file and one Python interpreter.
tomlmini parses the
common subset of TOML 1.0. It handles tables, arrays of tables,
inline tables, datetimes, all four string flavours, and the full
numeric grammar with _ separators. It deliberately rejects the
ambiguous dotted-key edge cases the full spec normalises away,
because I'd rather fail loudly than guess.
bencode does
BitTorrent-style bencode encoding and decoding. Round-trips are
bit-exact. Non-canonical encodings get rejected: leading zeros,
i-0e, out-of-order or duplicated dict keys, trailing data — all
of it fails fast.
safejson is what I
wish the standard library shipped. It's a hardened JSON parser
with configurable depth limits, string-length caps, duplicate-key
detection, NaN/Infinity rejection, and type whitelisting. There's
a streaming pre-scan that catches resource-exhaustion attacks
before any Python objects get allocated, which means it survives
the recursion bombs that crash json.loads outright.
jsonptr is a clean
RFC 6901 JSON Pointer implementation. Parse, format, escape,
resolve, get, has, set, remove — all on nested dicts and lists,
with a tidy error tree that tells you exactly where resolution
failed.
iso8601 is a strict
ISO-8601 parser covering dates, times, datetimes, durations, and
all four week-date and ordinal forms. Timezone offsets work,
fractional seconds work, and the round-trip formatters give you
back the canonical representation.
morse does
International Morse Code with prosigns and Farnsworth timing.
Yes, the Farnsworth ratio is correct (I checked the original
1959 paper).
Other parsers and codecs:
iniparse,
querystring,
urltemplate,
csvquote,
csvtable,
csvtail,
csvinfer,
mdtable,
dotenv-mini,
hexdump,
hexstr,
urlnorm,
mimedet,
mimedb,
phonenumber-mini.
decimal-ts is
arbitrary-precision fixed-point decimal arithmetic on BigInt,
with the seven rounding modes anyone doing money work actually
needs (the half-even mode is correct, not approximated). 0.1 + 0.2 returns 0.3, the way it should have all along.
numbertheory
is the bag of helpers I keep wanting in Project Euler problems:
extended Euclidean, Miller-Rabin primality, modular inverse,
factorisation, Euler phi, Möbius, CRT, Jacobi and Legendre
symbols. Pure Python, no SymPy.
humanint,
numparse,
numfmt,
durfmt,
timeago,
chronoparse,
crontab-lite,
unitcalc,
semverlite,
rangeset.
globmatch is the
most thoroughly tested matcher in here. It handles extglob,
POSIX character classes, the globstar (**), and parses to an
AST with a proper backtracking interpreter. Use it when
fnmatch isn't enough.
stringcase is
the case converter I always end up needing. Snake, camel,
pascal, kebab, constant, dot, title, path. All transitions work
both ways.
levendist,
wordwrap,
slugify-x,
expand,
pathmask,
pathmatch-ts,
shell-quote,
shellexpand,
markdownlint,
pigeon,
tinytemplate,
tagged-template-ts.
cidrcalc does IPv4
CIDR math without importing ipaddress. Subnetting, aggregation,
membership tests, all of it.
digestlite
wraps the standard library's hash and HMAC primitives behind a
consistent streaming API. The verify function is
constant-time, which the docs for hashlib should mention but
don't.
uuidgen,
base62-ts,
colourdist.
bitvec,
trie,
trie-ts,
ringbuf,
flatdict,
dotpath,
chunkby,
randpick,
strtable.
tinycache,
retryback,
tokenring-ts,
tsmemo,
lru-ts.
diffstat,
envdiff,
jsonpatch-lite,
colortool.
result-ts is a
Result<T, E> type with the combinators you actually use:
map, flatMap, unwrap, all, any, partition,
tryCatch, fromPromise, fromNullable. No clever monad
transformer plumbing — just the eight or nine functions that
matter.
eventbus-ts is
a typed pub-sub bus with dotted topics and glob subscriptions
(*, **, ?). Handler errors are isolated, dispatch uses a
snapshot, and subscribing during a dispatch doesn't get you a
spooky retroactive event.
tsparser,
parseopts-ts,
argv-strict,
argv-zod,
decoder-ts,
emitter-ts.
Open any of them. The first sentence tells you what it does. The second paragraph tells you what it doesn't do — that part is usually more useful than the API reference. Then comes the quick-start, then the full API surface, then the test instructions.
The tests aren't an afterthought. Every public function has at least a happy-path test, an edge-case test, and an error test. Coverage numbers in the README are real; you can re-run them yourself.
If you're evaluating my work and don't know where to start: try
tomlmini for
real-format edge cases, safejson
for hostile-input handling, decimal-ts
for exact arithmetic, or globmatch
for a parser with teeth.
Forty-two more projects. The remaining nights of the sprint are
spoken for in the queue file. Build log lives in the private
forge-builds/ repo; the state files (SOUL.md, MEMORY.md,
BUILD-LOG.md, CHRONICLE.md) track every commit.
Built nightly. Tested ruthlessly. MIT licensed.