Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(update 1.0.0): refactor | Break Change #6

Merged
merged 13 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: publish
on:
workflow_dispatch:
push:
tags:
- pypi*

permissions:
contents: read

jobs:
pypi-publish:
name: upload release to PyPI
runs-on: ubuntu-latest
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v3

- uses: pdm-project/setup-pdm@v3

- name: Publish package distributions to PyPI
run: pdm publish
39 changes: 0 additions & 39 deletions .github/workflows/python-publish.yml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/python_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Run tests

on:
workflow_dispatch:
push:
branches:
- main
- dev
- develop
- '**-develop'

jobs:
Testing:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [ '3.8', '3.9', '3.10', '3.11' ]
os: [ ubuntu-latest ] # , windows-latest, macos-latest

steps:
- uses: actions/checkout@v3
- name: Set up PDM
uses: pdm-project/setup-pdm@v3
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
pdm install --no-lock -G testing
- name: Run Tests
run: |
pdm run -v pytest tests
38 changes: 0 additions & 38 deletions .github/workflows/test.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,4 @@ dmypy.json

# Pyre type checker
.pyre/
/.pdm-python
14 changes: 14 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files

# check python requirements
- repo: https://github.com/pdm-project/pdm
rev: 2.11.2 # a PDM release exposing the hook
hooks:
- id: pdm-lock-check
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
# subtitle_utils

![cover](https://raw.githubusercontent.com/sudoskys/subtitle_utils/main/cover.jpg)
![cover](https://raw.githubusercontent.com/sudoskys/subtitle_utils/main/src/cover.jpg)

<p align="center">
<img src="https://img.shields.io/badge/Python-3.7|8|9|10-green" alt="Python" >
<img src="https://img.shields.io/badge/Python-3.8|9|10|11-green" alt="Python" >
<img src="https://img.shields.io/pypi/dm/subtitle_utils.svg" alt="Download">
</p>

Subtilte Conversion utils - ass2srt vtt2bcc srt2bcc ass2bcc and more

`pip install -U subtitle_utils`
## Install

## 使用
```
pip install -U subtitle_utils
```

## Usage

```python
import subtitle_utils
Expand All @@ -30,4 +35,4 @@ def get_convert(pre: str = "ass", aft: str = "srt", input_str: str = None) -> st
print(f"{_result_group.pre}->{print(_result_group.aft)}")
print(_result_group.msg)
return result
```
```
9 changes: 9 additions & 0 deletions feature_test/split_exp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# -*- coding: utf-8 -*-
# @Time : 2024/1/18 下午11:09
# @Author : sudoskys
# @File : split_exp.py

method = "ass2srt"
sub_key, key = method.split("2", maxsplit=1)

print(sub_key, key)
Loading
Loading