Installation Guide
Python Tools
Prerequisites
- Python 3.6 or higher
- pip
Installation Steps
- Navigate to the Python Tools Directory
bash
cd tools/python/
- Create a Virtual Environment (Recommended)
bash
python3 -m venv venv
-
Activate the Virtual Environment
-
On macOS/Linux:
bash source venv/bin/activate -
On Windows:
bash venv\Scripts\activate -
Install Dependencies
bash
pip install -r requirements.txt
Dependencies
The requirements.txt file includes:
stjlib>=0.3.0- STJ file handling and validationsrt>=3.5.2- SRT subtitle format supportwebvtt-py>=0.4.6- WebVTT subtitle format supportpytest>=7.0.0- Testing framework
JavaScript Tools
Prerequisites
- Node.js 12 or higher
- npm (comes with Node.js)
Installation Steps
- Navigate to the JavaScript Tools Directory
bash
cd tools/javascript/
- Install Dependencies
bash
npm install
Dependencies
The package.json includes:
ajvmomentnode-webvttsrt-parser-2
Verifying Installation
To verify that the tools are installed correctly, you can run the following commands:
- Python Validator:
bash
python stj_validator.py ../../examples/latest/simple.stj.json ../../spec/schema/latest/stj-schema.json
pytest
- JavaScript Validator:
bash
node stj-validator.js ../../examples/latest/simple.stj.json ../../spec/schema/latest/stj-schema.json
If no errors are reported, the tools are installed and working properly.
Troubleshooting
-
Python Issues:
-
Ensure you're using the correct version of Python.
-
If you encounter permission issues, try running the command with
--useror within a virtual environment. -
JavaScript Issues:
-
Ensure Node.js and npm are installed and updated.
- If dependencies fail to install, check your internet connection or proxy settings.
For further assistance, please open an issue in the repository or contact the maintainers.