A regex-based Python library to parse scene release names and extract technical metadata
Project description
Releascenify
Parse Scene and P2P release names into structured metadata and compare release quality automatically. Built with a rule/regex engine.
Live Demo: 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 an alternative to PTN (Parse Torrent Name).
Installation
pip install releascenify
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")
Quality Scoring
For details on how files are rated, scoring weights, and priority factors, see SCORING.md.
Expected Tags & Normalization
Here are the metadata fields extracted by releascenify and how their values are normalized:
Video Codecs (codec)
To make release metadata processing and quality comparison consistent, the parser normalizes various representations of codecs:
H265: Normalized from inputs containingH265,x265,HEVC(including variants with dots or hyphens likeH.265orH-265).H264: Normalized from inputs containingH264,x264,AVC(including variants with dots or hyphens likeH.264orH-264).VC-1: Normalized from inputs containingVC1orVC-1.
Resolutions (resolution)
To keep resolution metadata consistent, they are normalized to standard keys:
2160P: Normalized from inputs containing2160p,2160P,4K, orUHD.1080P: Normalized from inputs containing1080por1080P.720P: Normalized from inputs containing720por720P.4KLIGHT: Extracted from inputs containing4KLIGHT.
Source Quality (quality)
The source tags are normalized to standard quality keys:
WEB-DL: Normalized from inputs containingWEB-DL,WEBDL, orWEB.WEBRIP: Extracted from inputs containingWEBRiporWEBRIP.BLURAY: Extracted fromBLURAY,BDRIP, orBRRIP.REMUX/DVDRIP/HDTV/WEBLIGHT
Audio Codecs (audio)
To keep audio metadata consistent, standard audio codecs are normalized as follows:
EAC3: Normalized from inputs containingEAC3,E-AC3,DDP,DDP2.0,DDP5.1,DDP7.1, etc. (Dolby Digital Plus).DTS-HD MA: Normalized from inputs containingDTS-HD MA,DTSHDMA,DTS-HD.MA,DTS-HD-MA,DTS-HD_MA, etc. (DTS-HD Master Audio).DTS-HD: Normalized from inputs containingDTS-HD,DTS.HD,DTS_HD,DTS HD,DTSHD, etc. when the Master Audio suffix is not present.- Other standard codecs extracted:
TRUEHD/DTS/AC3/AAC/FLAC/MP3. - Note: If
ATMOSis present, it is appended to the base codec (e.g.,EAC3 ATMOS,TRUEHD ATMOS,DTS-HD MA ATMOS). If only Atmos is present, it will beATMOS.
Audio Channels (channels)
- Standard channel counts:
7.1/5.1/2.1/2.0/1.0(mono).
Video Enhancements (v_quality)
HDR/HDR10/HDR10+/DV(Dolby Vision) /HLG/SDR/10BIT/12BIT
Languages (languages)
- Lists of extracted language tags:
VFF(TrueFrench) /FRENCH/VF/VF2/VFI/VFQ/VOSTFR/FASTSUB/EN/VO/MULTI
Network/Platform (network)
- Stream/broadcast platform names normalized:
Netflix(fromNF)Amazon Prime(fromAMZN,AMAZON STUDIOS,AMAZON PRIME)Disney+(fromDSNP,DSNY,DISNEY PLUS)Apple TV+(fromATV,APPLE TV PLUS)HBO Max/HBO(fromHMAX,HBO MAX,HBO)Hulu(fromHULU)Paramount+(fromPARAMOUNT PLUS)
Special Tags (extra)
- Extracted modifiers:
REPACK/PROPER/FINAL/INTERNAL/CUSTOM.
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:
virtualenv .venv
source .venv/bin/activate
Run Tests
Run the test suite using pytest:
pytest tests/ -v
Run Website Locally
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file releascenify-0.21.0.tar.gz.
File metadata
- Download URL: releascenify-0.21.0.tar.gz
- Upload date:
- Size: 47.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
048f46e2064692c89c248e947e71557f162759cfb5689c40ea2d4ccd912be462
|
|
| MD5 |
ac232260475b2f5adb446aa0d51bfc6b
|
|
| BLAKE2b-256 |
68773ec07f63f45f7dc6203ed4b5fa6237beae5c25784cae6c2a6144be9da77c
|
Provenance
The following attestation bundles were made for releascenify-0.21.0.tar.gz:
Publisher:
publish.yml on dmachard/ReleascenIFY
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
releascenify-0.21.0.tar.gz -
Subject digest:
048f46e2064692c89c248e947e71557f162759cfb5689c40ea2d4ccd912be462 - Sigstore transparency entry: 2023956725
- Sigstore integration time:
-
Permalink:
dmachard/ReleascenIFY@7cb3515c5c7832e879b88bd4c1a5ba54fefc3d4c -
Branch / Tag:
refs/tags/v0.21.0 - Owner: https://github.com/dmachard
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7cb3515c5c7832e879b88bd4c1a5ba54fefc3d4c -
Trigger Event:
release
-
Statement type:
File details
Details for the file releascenify-0.21.0-py3-none-any.whl.
File metadata
- Download URL: releascenify-0.21.0-py3-none-any.whl
- Upload date:
- Size: 16.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
37fa1b11e62849cceb780690fc1081c9c2feb7868aa9464066e6c87669c9e0a8
|
|
| MD5 |
e4e8bd4d61dc73d9f01d69c5a641c11d
|
|
| BLAKE2b-256 |
3c1f3bd8715fe208ec6022b30ed1bdfcca5523b0c241390e1572d8f4587b004f
|
Provenance
The following attestation bundles were made for releascenify-0.21.0-py3-none-any.whl:
Publisher:
publish.yml on dmachard/ReleascenIFY
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
releascenify-0.21.0-py3-none-any.whl -
Subject digest:
37fa1b11e62849cceb780690fc1081c9c2feb7868aa9464066e6c87669c9e0a8 - Sigstore transparency entry: 2023956819
- Sigstore integration time:
-
Permalink:
dmachard/ReleascenIFY@7cb3515c5c7832e879b88bd4c1a5ba54fefc3d4c -
Branch / Tag:
refs/tags/v0.21.0 - Owner: https://github.com/dmachard
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7cb3515c5c7832e879b88bd4c1a5ba54fefc3d4c -
Trigger Event:
release
-
Statement type: