parsai
Парсер названий медиафайлов: из имени релиза достаёт название, год, сезоны и серии, разрешение, источник, кодеки, озвучку, субтитры и тип медиа.
"The.Matrix.1999.1080p.BluRay.x264-GROUP.mkv"
→ title="The Matrix" year=1999 screen_size=1080p source=BluRay video_codec=H.264
"Брат (1997) BDRip 1080p MVO R.G. Pravitel"
→ title="Брат" year=1997 source=BDRip dub=professional
"[AniLibria] Атака титанов - 12 [1080p] [AAC].mkv"
→ title="Атака титанов" episodes=[12] screen_size=1080p audio_codec=AAC
"Сваты [1-9 сезоны: 1-164 серии из 180] (2008-2021) SATRip"
→ seasons=[1..9] episodes=[1..164] episodes_total=180
Установка
pip install parsai # библиотека
pip install parsai[cli] # + консольная команда `parsai`
Нужен Python 3.11+. Модель входит в пакет, сеть не требуется
(инференс идёт через onnxruntime на процессоре).
Использование
from parsai import parse
r = parse("The.Matrix.1999.1080p.BluRay.x264-GROUP.mkv")
r.title # "The Matrix"
r.year # 1999
r.kind # "movie" | "series" | "tv" | "music" | "game" | "software" | "other" | "anime"
r.seasons # list[int] | None — полное перечисление: "[1-9 сезоны]" → [1, ..., 9]
r.episodes # list[int] | None — "1-7 серии" → [1..7]; "серии 1, 3, 5-7" → [1, 3, 5, 6, 7]
r.episodes_total # int | None — заявленный тотал «из N»
r.media_score # 0..1: насколько вход похож на имя медиафайла (порог выбирает потребитель)
Пакетный разбор (потоки, порядок сохраняется, ошибки возвращаются как результаты с ошибкой):
from parsai import parse_batch, aparse_batch
results = parse_batch(titles)
results = parse_batch(titles, max_workers=1) # строго последовательно
results = await aparse_batch(titles) # для asyncio-кода
Командная строка
parsai parse "The.Matrix.1999.1080p.BluRay.x264-GROUP.mkv"
parsai parse --json "Бригада.S01E01.DVDRip.avi"
Переменные окружения
| Переменная | Назначение |
|---|---|
PARSAI_ORT_THREADS |
число потоков onnxruntime (по умолчанию 1) |
Лицензия
PolyForm Noncommercial 1.0.0; условия коммерческого использования — в файле
LICENSE.
Metadata
Release files for parsai 0.4.160
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| parsai-0.4.160-py3-none-any.whl | Python 3 | none | any | Details for parsai-0.4.160-py3-none-any.whl |
Release files / parsai-0.4.160-py3-none-any.whl
| Download URL | parsai-0.4.160-py3-none-any.whl |
|---|---|
| Size | 5.5 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5f0c355ca4428d12255f2022a15d91276d46d70a6468ece492175371cde5c932
|
|
BLAKE2b-256 checksum How to use checksums |
d3543fee9b4e4575e0d7ad50c7805034ecdbac208a7160708e5127ed4e3a6c78
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.18
|
Security for parsai 0.4.160
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.