Skip to main content

Corpus Replicator

Task Status Matrix PyPI

Corpus Replicator is a corpus generation tool that enables the creation of multiple unique output files based on templates. The primary intended use case is the creation of a seed corpus that can be used by fuzzers. Support for additional output formats can be added via the creation of Recipes. If a desired format is unsupported, support can be added via the creation of a CorpusGenerator.

The goal is to create an efficient corpus that maximizes code coverage and minimizes file size. Small unique files that execute quickly are preferred.

Currently four media types can be generated animation, audio, image and video.

Requirements

Corpus Replicator relies on FFmpeg.

Installation

pip install corpus-replicator

Example

This is an example recipe file.

# "base" contains required entries and default flags
base:
  codec: "h264"       # name of the codec
  container: "mp4"    # container/file extension
  library: "libx264"  # name of library
  medium: "video"     # supported medium
  tool: "ffmpeg"      # name of supported tool
  default_flags:
    encoder:          # "encoder" flag group
      ["-c:v", "libx264"]
    resolution:       # "resolution" flag group
      ["-s", "320x240"]

# variations allow flags to be added and overwritten
# one file will be generated for each entry in a flag group
variation:
  resolution:         # flag group - overwrites default flag group in "base"
  - ["-s", "640x480"]
  - ["-s", "32x18"]
  - ["-s", "64x64"]
  monochrome:         # flag group - adds new flag group
  - ["-vf", "hue=s=0"]

Running the recipe will generate a corpus:

$ corpus-replicator example.yml video -t test
Generating templates...
1 recipe(s) will be used with 1 template(s) to create 4 file(s).
Generating 4 'video/libx264/h264/mp4' file(s) using template 'test'...
Optimizing corpus, checking for duplicates...
Done.

Resulting corpus:

$ ls generated-corpus/
video-h264-libx264-test-monochrome-00.mp4
video-h264-libx264-test-resolution-01.mp4
video-h264-libx264-test-resolution-00.mp4
video-h264-libx264-test-resolution-02.mp4

A more complex corpus can be generated by using multiple Recipes and Templates at once.

Recipes are stored in src/corpus_replicator/recipes.

Metadata

Release files for corpus-replicator 1.1.2

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

Source distribution (sdist)

Source distribution for corpus-replicator 1.1.2
File Size Uploaded Provenance
corpus-replicator-1.1.2.tar.gz 27.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for corpus-replicator 1.1.2
File Interpreter ABI Platform
corpus_replicator-1.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 67.9 kB

Release files / corpus-replicator-1.1.2.tar.gz

Download URL corpus-replicator-1.1.2.tar.gz
Size 27.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f75c72b4e5f7337cc1e0b6c92ab3749b5ec6864ef56195a22679b86340cc64c4
BLAKE2b-256 checksum
How to use checksums
17f342dc7ebee750dc32ecad2e52d7da631ca066b5f0e8de55048385d4a4ce2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.18

Release files / corpus_replicator-1.1.2-py3-none-any.whl

Download URL corpus_replicator-1.1.2-py3-none-any.whl
Size 40.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
966c028f82ca7ae754e5a0a28a0381fa920b8168c3440603f76c5328df503260
BLAKE2b-256 checksum
How to use checksums
4f6c5e73b0839e88392bc7264374a3bdb16e25110369b8c3c26dcaf72728f705
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.18

Security for corpus-replicator 1.1.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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