Skip to main content

loremfile

Download loremfile.dev sample files and check every byte against the published manifest.

$ pip install loremfile
$ loremfile get pdf/minimal.pdf mp4/720p-5s.mp4
  written  mp4/720p-5s.mp4  1,974,574 bytes
  written  pdf/minimal.pdf  586 bytes
files=2, dest=loremfile-fixtures

Everything it does can be done with curl and sha256sum -c. What it adds is doing it correctly by default: every file is verified, and a file that fails is not written.

Commands

Command
loremfile get PATH… Download those fixtures into --dest (default loremfile-fixtures), verifying each.
loremfile get --format svg --format pdf The same for every published file of a format.
loremfile list [--format F] [--tag T] [--max-bytes N] What is published, without downloading.
loremfile verify [PATH…] Check files already on disk against the manifest.
loremfile mcp Serve the same lookups to an agent over MCP; see below.

Every command takes --json for scripts, --quiet, and --catalog-version X.Y.Z to refuse to run if loremfile.dev has moved on. get also takes --force (overwrite) and --dry-run (what it would fetch, and how many bytes). get, list and verify leave out the sample.{format} aliases, which repeat another file's bytes, unless you pass --include-aliases; a path you name is always fetched.

Exit codes: 0 fine, 1 a file failed verification or is missing, 2 the request was wrong, 3 loremfile.dev could not be read.

In a pytest suite

For files too big to commit: multi-megabyte video, audio and archives that would otherwise bloat a repository. Installing the client gives pytest a loremfile fixture:

def test_reads_a_real_mp4(loremfile):
    video = loremfile("mp4/10mb.mp4")  # a pathlib.Path
    ...

The first call downloads the file into .pytest_cache and checks its SHA-256 against the manifest; a file that does not match is never returned. Published files never change at their path, so after that the file and its manifest entry are reused and the suite needs no network for them. In CI, cache .pytest_cache/d/loremfile between runs to keep it that way; pytest --cache-clear starts over.

It is not for every suite. If your tests may not touch the network, or the file you need is a 4 KB PDF, commit the file: that is simpler and needs nothing from us. The fixture takes a path only (loremfile list finds one), needs pytest 8.0 or newer, and does nothing until a test asks for it.

MCP server

loremfile mcp runs a Model Context Protocol server over stdio, so an agent can find a fixture, read its URL and metadata, and check a file it already has. It returns URLs and metadata, never file bytes: the agent, or your test, fetches the URL. uvx runs it without an install:

{ "mcpServers": { "loremfile": { "command": "uvx", "args": ["loremfile", "mcp"] } } }

It speaks protocol 2026-07-28 (per-request metadata, server/discover) and 2025-11-25 (the initialize handshake), so clients of either era work. All three tools are read-only, and they are the npm package's npx loremfile mcp tools, definition for definition.

Tool Arguments Returns
list_fixtures format, tag, max_bytes, limit, offset One page of published fixtures, each with path, url, format, mime, bytes, tags and description, plus total and next_offset. format and tag are lists matched as any of; limit defaults to 50, at most 250.
describe_fixture path (required) One fixture's manifest entry: url, mime, bytes, sha256, size_class, tags, description, props and added_in.
verify_file path (required), file (required) Whether the local file is the published path: status is ok, changed or missing, with both hashes and sizes. The file is read to hash it and goes nowhere.

The manifest is read once per server process from loremfile.dev, under the same rules as the commands above.

What it will not do

  • Write a file it could not verify. There is no --no-verify.
  • Talk to any host but loremfile.dev. No mirror option, and redirects off the host are not followed.
  • Take credentials. Nothing it does needs authentication, so it accepts none.
  • Exceed the published rate limit: one file at a time, a pause between them, and a 429 is waited out rather than retried tightly.
  • Generate fixtures. Those are built in a pinned toolchain image; a client that made its own would produce different bytes and undermine the only promise the project makes.

Python versions

3.11, 3.12, 3.13 and 3.14, tested in CI on Linux, macOS and Windows. The floor is the oldest CPython still receiving security fixes when a release is cut; a new one is supported within six weeks of its release, and an end-of-life one is dropped in the next minor release.

Zero dependencies: standard library only.

In GitHub Actions, prefer the action

- uses: kumarprabhashanand/loremfile/action@action-v1
  with:
    paths: pdf/minimal.pdf mp4/720p-5s.mp4

It is shell only and needs no install step. This client is for everywhere else: a laptop, a Makefile, a CI system that is not Actions, or Windows, which the action does not support because it needs sha256sum.

One name, two tools

The console script installed here is loremfile, which is also the name of the repository's own development CLI (the one that generates and publishes the fixtures). They are never installed together (that tool lives only inside the project's toolchain image), but a contributor who installs both into one environment gets whichever was installed last. The published package contains the client only: no generators, no validators, no uploader, no infrastructure code.

Licence

MIT for the client; the files it downloads are CC0.

Metadata

Release files for loremfile 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for loremfile 0.3.1
File Size Uploaded Provenance Actions
loremfile-0.3.1.tar.gz 30.6 kB With provenance Details for loremfile-0.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for loremfile 0.3.1
File Interpreter ABI Platform Actions
loremfile-0.3.1-py3-none-any.whl Python 3 none any Details for loremfile-0.3.1-py3-none-any.whl

Total release size: 51.3 kB

Release files / loremfile-0.3.1.tar.gz

Download URL loremfile-0.3.1.tar.gz
Size 30.6 kB
Tags Source
SHA-256 checksum
How to use checksums
0f45d04ab505007c6f8e6d9a29e8da426baa5bf1df981c3766d51068c59601c7
BLAKE2b-256 checksum
How to use checksums
24fc1056969a2fe06409d8688ff6a3e22405067386f63401c37447633cdd6d69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Release files / loremfile-0.3.1-py3-none-any.whl

Download URL loremfile-0.3.1-py3-none-any.whl
Size 20.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4ea8a150b3d27e3765ebae9d43596c6e0c30facbee202a5148e590a293fbb19f
BLAKE2b-256 checksum
How to use checksums
a8b915af17c04b7f8a6cf2de3a47772657163d64ef238a9881a19df8de5c6b59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Security for loremfile 0.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for loremfile-0.3.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page