Skip to content

Commit

Permalink
chore: Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
tkarabela committed May 5, 2024
1 parent 90186b5 commit c0bc201
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 63 deletions.
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ pip install -r requirements-dev.txt
pytest
```

Your branch should also pass MyPy typecheck with no errors:
Your branch should also pass Ruff and strict MyPy checks with no errors:

```sh
mypy
mypy --strict
ruff check
```
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
pysubs2
=======

[![pysubs2 build master branch](https://img.shields.io/github/actions/workflow/status/tkarabela/pysubs2/main.yml?branch=master)](https://github.com/tkarabela/pysubs2/actions)
[![pysubs2 test code coverage](https://img.shields.io/codecov/c/github/tkarabela/pysubs2)](https://app.codecov.io/github/tkarabela/pysubs2)
[![Static Badge](https://img.shields.io/badge/MyPy%20%26%20Ruffle-checked-blue?style=flat)](https://github.com/tkarabela/pysubs2/actions)
[![PyPI - Version](https://img.shields.io/pypi/v/pysubs2.svg?style=flat)](https://pypi.org/project/pysubs2/)
[![PyPI - Status](https://img.shields.io/pypi/status/pysubs2.svg?style=flat)](https://pypi.org/project/pysubs2/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pysubs2.svg?style=flat)](https://pypi.org/project/pysubs2/)
[![PyPI - License](https://img.shields.io/pypi/l/pysubs2.svg?style=flat)](LICENSE.txt)
[![GitHub Repo stars](https://img.shields.io/github/stars/tkarabela/pysubs2?style=flat&label=GitHub%20stars)](https://github.com/tkarabela/pysubs2)


pysubs2 is a Python library for editing subtitle files.
It’s based on *SubStation Alpha*, the native format of
[Aegisub](http://www.aegisub.org/); it also supports *SubRip (SRT)*,
*MicroDVD*, *MPL2*, *TMP* and *WebVTT* formats and *OpenAI Whisper* captions.

There is a small CLI tool for batch conversion and retiming.

```bash
pip install pysubs2
pysubs2 --shift 0.3s *.srt
pysubs2 --to srt *.ass
```

```python
import pysubs2
subs = pysubs2.load("my_subtitles.ass", encoding="utf-8")
subs.shift(s=2.5)
for line in subs:
line.text = "{\\be1}" + line.text
subs.save("my_subtitles_edited.ass")
```

To learn more, please [see the documentation](http://pysubs2.readthedocs.io).
If you'd like to contribute, see [CONTRIBUTING.md](CONTRIBUTING.md).

pysubs2 is licensed under the MIT license (see [LICENSE.txt](LICENSE.txt)).
53 changes: 0 additions & 53 deletions README.rst

This file was deleted.

12 changes: 6 additions & 6 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ pysubs2 is a Python library for editing subtitle files. It’s based on *SubStat
the native format of `Aegisub <http://www.aegisub.org/>`_; it also supports *SubRip (SRT)*,
*MicroDVD*, *MPL2*, *TMP* and *WebVTT* formats. There is a small CLI tool for batch conversion and retiming.

.. code-block:: text
.. code-block:: bash
$ pip install pysubs2
$ pysubs2 --shift 0.3s *.srt
$ pysubs2 --to srt *.ass
pip install pysubs2
pysubs2 --shift 0.3s *.srt
pysubs2 --to srt *.ass
.. code-block:: python
Expand All @@ -20,10 +20,10 @@ the native format of `Aegisub <http://www.aegisub.org/>`_; it also supports *Su
line.text = "{\\be1}" + line.text
subs.save("my_subtitles_edited.ass")
The library works in Python 3.7 or newer, with no extra dependencies.
The library works in Python 3.8 or newer, with no extra dependencies.
It’s available under the MIT license (see bottom of the page).
To get started, simply install it using `pip <https://pypi.python.org/pypi/pip>`_: ``pip install pysubs2``.
You can also clone `the GitHub repository <https://github.com/tkarabela/pysubs2/>`_ and install via ``python setup.py install``.
You can also clone `the GitHub repository <https://github.com/tkarabela/pysubs2/>`_.

If you find a bug or have something to say, please let me know `via GitHub <https://github.com/tkarabela/pysubs2/issues>`_ or
email (tkarabela at seznam dot cz). Your feedback is much appreciated. Thanks!
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ version = attr: pysubs2.common.VERSION
author = Tomas Karabela
author_email = [email protected]
description = A library for editing subtitle files
long_description = file: README.rst
long_description_content_type = text/x-rst
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/tkarabela/pysubs2
keywords = SubStation, SubRip, MicroDVD, MPL2, WebVTT, ass, srt, sub, vtt, subtitles, captions
license = MIT
Expand Down

0 comments on commit c0bc201

Please sign in to comment.