Project

pydlock — A File-Encryption Package on PyPI

A small file-encryption package on PyPI — a clean library API and a CLI, carried through the full lifecycle of a real published package.

  • Python
  • Cryptography
  • CLI
  • PyPI

Code ↗

Most of my code lives inside a larger system. pydlock was the opposite exercise: take one small job — encrypt and decrypt a file — and carry it through the full lifecycle of a real package, from a clean API to a CLI to a versioned release on PyPI.

Context

The job is modest: lock a file behind a passphrase, unlock it later. What made it worth doing was treating a one-purpose utility with the discipline a dependency deserves.

The problem

A script and a package look similar and aren’t the same thing. A package needs a stable public surface, works as both an import and a tool, fails legibly, and is installable, versioned, and documented well enough that a stranger can use it without reading the source. That last part is where most personal projects quietly stop.

Approach

pydlock works two ways from one codebase:

  • As a library — import it and call a small, documented API to encrypt or decrypt a file.
  • As a CLIpython -m pydlock lock <file> / unlock <file>, with arguments parsed and validated.

Around that it carries the scaffolding of a published package: setup.py and a MANIFEST, a CHANGELOG, and a release on the Python Package Index.

Outcome

pydlock is live on PyPIpip install pydlock and it’s there, library and CLI both.