Skip to main content

A Python library for reading and writing Movie Information Format (.mif) containers.

Project description

MIFpy

mifpy is a lightweight Python library for the Movie Information Format (.mif), a ZIP-based container format for movie metadata, subtitles, actor appearance timelines, and associated assets.

Features

  • Load and save .mif archives using Python zipfile
  • Validate required package files and formats
  • Parse manifest.ini, meta.ini, appearances.json, and subtitles.srt
  • Add content assets under content/
  • CLI support: inspect, extract, and create

Package structure

A valid .mif archive contains:

  • manifest.ini
  • meta.ini
  • subtitles.srt
  • appearances.json
  • content/ (optional)

Installation

Install with Poetry:

poetry install

Usage

from mifpy import MIFPackage

pkg = MIFPackage.create(
    meta={"title": "The Matrix", "year": 1999, "runtime_ms": 8160000},
    subtitles="1\n00:00:00,000 --> 00:00:02,000\nWake up, Neo.\n",
    appearances={
        "actors": {
            "keanu_reeves": {
                "name": "Keanu Reeves",
                "image": "content/keanu.png",
            }
        },
        "appearances": [
            {"actor": "keanu_reeves", "start_ms": 1000, "end_ms": 10000}
        ],
    },
)

pkg.add_content_file("keanu.png", b"<raw-image-bytes>")
pkg.save("movie.mif")

CLI

mifpy inspect movie.mif
mifpy extract movie.mif ./out
mifpy create sample.mif

Testing

Run tests with:

poetry run pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mifpy-1.0.0.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mifpy-1.0.0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file mifpy-1.0.0.tar.gz.

File metadata

  • Download URL: mifpy-1.0.0.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.14.3 Windows/11

File hashes

Hashes for mifpy-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5285382c8625d07f2752c658aefd39b8682135689535058a34bc82af25754ec5
MD5 c8a463a505ca1a1fc67d8a8bd0d01878
BLAKE2b-256 c3ca62957b90441394e9a52d23f429b6e957ddb87683b20e31dac88d3022252d

See more details on using hashes here.

File details

Details for the file mifpy-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: mifpy-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.14.3 Windows/11

File hashes

Hashes for mifpy-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3f2851e4b20936862db4435951f19b37a52f7d74cf036440cf3b1cd0d4367273
MD5 b817502c70e9cd357df0461cf42dd870
BLAKE2b-256 6e0abc630766bb8f6b4e8877c020363cc5361df644023e420c16fa2748ee944e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page