Skip to main content

swapsub

这是一个字幕文件格式转换器
支持LRC,SRT,TXT三者互转

安装

推荐使用pip包管理器进行安装

pip install swapsub

使用方法

导入swapsub

import swapsub

load()函数

load函数用于加载并预处理字幕文件

swapsub.load(path)

#path:文件路径 

load()函数将返回一个列表,里面包含里经预处理后的数据

convert()函数

convert函数用于转换并将转换后的文件储存到指定位置

swapsub.convert(data,path)

#data:load()函数返回的值  
#path:文件路径

示例

sub = swapsub.load("a.lrc")  
swapsub.convert(sub,"/home/cybytess/b.srt")

注意,路径须包含文件名及扩展名

许可证

GPL-3.0

Metadata

Release files for swapsub 2.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for swapsub 2.0.2
File Size Uploaded
swapsub-2.0.2b.tar.gz 14.7 kB Details

Release files / swapsub-2.0.2b.tar.gz

Download URL swapsub-2.0.2b.tar.gz
Size 14.7 kB
Tags Source
SHA-256 checksum
How to use checksums
83eedf7a140d4c69487ae842e501dc40d57b133617bb32a7e2e1d45c45b4e8bd
BLAKE2b-256 checksum
How to use checksums
8d5285d08c75d1bd5393e2c55a11423fd7368794e7384de4125dd22dd64cc5fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.8.3 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.9

Release history Release notifications | RSS feed

This release

2.0.2 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page