semvec/pypi-packages huggingface dataset:
tortitle 0.1.17
一个用于从种⼦标题中解析电影、剧集信息的 Python 库，支持主标题和副标题的提取。
Requires Python: >=3.7

# TorTitle

一个用于从种⼦标题中解析电影、剧集信息的 Python 库，支持主标题和副标题的提取。

## 安装

```bash
pip install tortitle
```

## 使用方法

### 解析主标题

`TorTitle` 用于解析种⼦标题，并提取主要信息，例如标题、年份、季数、集数、分辨率等。

```python
from tortitle import TorTitle
torrent_name = "The.Mandalorian.S01E01.1080p.WEB-DL.DDP5.1.H.264-NTC"
title = TorTitle(torrent_name)

print(f"标题: {title.title}")
print(f"中文标题: {title.cntitle}")
print(f"年份: {title.year}")
print(f"季: {title.season}")
print(f"集: {title.episode}")
print(f"分辨率: {title.resolution}")
print(f"片源: {title.media_source}")
print(f"制作组: {title.group}")

# another example
torrent_name = "[美国][金钱世界][All.the.Money.in.the.World.2017.1080p.BluRay.x264.DTS.5.1-CMCC][中英字幕]"
print(TorTitle(torrent_name).to_dict())
# 输出：
# {'title': 'All the Money in the World', 'cntitle': '金钱世界', 'year': '2017', 'type': 'movie', ....}
```

### 解析副标题

`TorSubtitle` 用于从 PT 站的种⼦副标题中提取`可能是标题`的信息(这里叫extitle)，以及season, episode等。

```python
from tortitle import TorSubtitle
torrent_name = "舌尖上的中国 第一季 | 全7集 | 导演: 陈晓卿 | 主演: 李立宏 国语/中字 4K高码版"
subtitle = TorSubtitle(torrent_name)

print(f"副标题: {subtitle.extitle}")
print(f"季: {subtitle.season}")
print(f"集: {subtitle.episode}")
```

## Contribution

欢迎提交 Pull Request

## License

[MIT](https://choosealicense.com/licenses/mit/)
greenify 0.5.0
Make C module compatible with gevent at runtime.

greenify_
=========

|build| |status| |pypiv| |pyversions| |wheel| |license|

greenify_ can make Python extension modules having network operations in C
code to be compatible with gevent_.

greenify_ uses the Dynamic Function Redirecting technique same as ELF-Hook_
to patch blocking network operations at runtime, without the need modify
the original modules.

Currently greenify_ only supports ELF format modules, and is tested on Linux.


Install from source
-------------------

``greenify`` module is installed using setuptools or pip::

  python setup.py install

or::

  pip install greenify

Usage
-----

1. Active greenify_ before initiate environment::

    import greenify
    greenify.greenify()

2. Make sure the dynamic module(e.g. libmemcached) is patched before using::

    assert greenify.patch_lib('/usr/lib/libmemcached.so')

3. Import and use the corresponding module, which is now gevent_ compatible.

Thread Safety
-------------

Once activated, the green C functions will, on potentially blocking operation,
pass control to gevent's main event loop, which may switch to other ready
greenlet which is also in one of the green functions.  So, make sure your C
code can handle this kind of execution pause and resume.  A thread safe
program usually is ready for greenify, but remember that all the switches
happen in a single thread.


License
-------

greenify_ is written and maintained by `douban`_ and is licensed under New BSD license.


.. _gevent: http://www.gevent.org
.. _greenify: https://github.com/douban/greenify
.. _douban: http://www.douban.com
.. _ELF-Hook: https://github.com/shoumikhin/ELF-Hook

.. |build| image:: https://github.com/douban/greenify/actions/workflows/test.yml/badge.svg
   :target: https://github.com/douban/greenify/actions/workflows/test.yml

.. |pypiv| image:: https://img.shields.io/pypi/v/greenify
   :target: https://pypi.org/project/greenify/

.. |status| image:: https://img.shields.io/pypi/status/greenify
.. |pyversions| image:: https://img.shields.io/pypi/pyversions/greenify
.. |wheel| image:: https://img.shields.io/pypi/wheel/greenify
.. |license| image:: https://img.shields.io/pypi/l/greenify?color=blue