Convert TTML to JSON
Project description
ttml-to-json
Convert TTML to JSON
Installation
Install this tool using pip:
pip install ttml-to-json
Usage
To output JSON for a TTML file:
ttml-to-json subtitles.ttml
This will output to standard output. Use -o filename to send it to a specified file.
Use -s or --single to output single "line" keys instead of a "lines" array.
You can also use:
python -m ttml_to_json ...
Output
Regular output:
[
{
"start": "00:00:00.000",
"end": "00:00:04.560",
"lines": ["my career in side projects and open"]
}
]
-s or --single output:
[
{
"start": "00:00:00.000",
"end": "00:00:04.560",
"line": "my career in side projects and open"
}
]
Development
To contribute to this tool, first checkout the code. Then create a new virtual environment:
cd ttml-to-json
python -m venv venv
source venv/bin/activate
Now install the dependencies and test dependencies:
pip install -e '.[test]'
To run the tests:
pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ttml-to-json-0.2.tar.gz.
File metadata
- Download URL: ttml-to-json-0.2.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
acb771b12bed29367c3201dc7cfd9d297effe2671f286c3145c2965248701377
|
|
| MD5 |
37557f995eabdb92e5bec647af000979
|
|
| BLAKE2b-256 |
ff7768a9396b0a06f87ab1bb57c2fcd2f9f80a6df3cd7e2460174b0629587903
|
File details
Details for the file ttml_to_json-0.2-py3-none-any.whl.
File metadata
- Download URL: ttml_to_json-0.2-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aad6e960f9e387009181f7cc93dcc860b94d7f98a110bc5183ae0b2fb2546117
|
|
| MD5 |
df9d997ae7003748a4426a4d9b0121a5
|
|
| BLAKE2b-256 |
4a1f25f73a1ec91e7c14d6eb375fc165d75c603c51f7418677094cffb1238aff
|