Skip to main content

A regex-based Python library to parse scene release names and extract technical metadata

Project description

Releascenify

A robust, regex-based Python library to parse scene release names and extract technical metadata (title, year, resolution, quality, codec, audio, languages, etc.).

Live Demo & Web Interface: https://dmachard.github.io/releascenify/docs/

Why?

Release names follow a strict grammar inherited from the Scene and P2P groups. Once decoded, you can predict the quality, source, language, and release group just from the filename. This library is a modernized alternative to PTN (Parse Torrent Name).

Installation

(To be published on PyPI)

Usage

from releascenify import parse_filename
from releascenify.comparator import get_quality_score, is_better_release

filename = "Gladiator.II.2024.MULTi.2160p.WEB-DL.DV.HDR.H265-GROUP"
parsed = parse_filename(filename)

print(parsed)
# {
#   "title": "Gladiator II",
#   "year": 2024,
#   "resolution": "2160P",
#   "quality": "WEB-DL",
#   "v_quality": "HDR DV",
#   "codec": "H265",
#   "languages": ["MULTI"]
#   ...
# }

# Calculate quality score
score = get_quality_score(parsed)
print(f"Quality Score: {score}")

# Compare two releases
rel_a = parse_filename("Gladiator.II.2024.1080p.BluRay.x264-GROUP")
rel_b = parse_filename("Gladiator.II.2024.2160p.WEB-DL.x265-GROUP")

if is_better_release(rel_b, rel_a):
    print("Release B is better than Release A")

Development & Tests

Setup Local Virtual Environment

To set up the development environment, create a virtual environment and install the package in editable mode with development dependencies:

# Create the virtual environment
virtualenv .venv

# Activate the virtual environment
source .venv/bin/activate

# Install the package in editable/development mode
pip install -e .[dev]

Run Tests

Run the test suite using pytest:

pytest tests/ -v

Run Website Locally

Due to browser CORS security policies, opening the HTML files directly as a local file (via file://) will block loading the relative Python files. You need to run a local web server from the repository root:

# Start a local HTTP server
python3 -m http.server 8000

Then navigate to: http://localhost:8000/ (which redirects to /docs/) or directly to http://localhost:8000/docs/.

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

releascenify-0.1.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

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

releascenify-0.1.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file releascenify-0.1.0.tar.gz.

File metadata

  • Download URL: releascenify-0.1.0.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for releascenify-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5538b99d0f8e2b8488b41fe6956551c462e0451e62fb666cbc63623b1cfbddda
MD5 285fda9f1e2a0197bb183d60530296ed
BLAKE2b-256 19ea0f7ef1df24ee67ea8c21e7ea92e55601ecb6e09037212308578a19e55087

See more details on using hashes here.

Provenance

The following attestation bundles were made for releascenify-0.1.0.tar.gz:

Publisher: publish.yml on dmachard/releascenify

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file releascenify-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: releascenify-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for releascenify-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 29b773d9b2836f74bbc3462eab7b20dc0ef8059280da532762183c1b0e424cfc
MD5 252d4844f91943974a1c124e0f30f04c
BLAKE2b-256 a027abd44689a0912ce0eb9dff30aa995f28ec750c647ef287bd32a79be32e0e

See more details on using hashes here.

Provenance

The following attestation bundles were made for releascenify-0.1.0-py3-none-any.whl:

Publisher: publish.yml on dmachard/releascenify

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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