|
1 |
| -# label-studio-custom-scripts |
| 1 | +# Label Studio Custom Scripts |
| 2 | + |
| 3 | + |
| 4 | +Welcome to **Label Studio Custom Scripts**! This repository contains `custom scripts` designed to extend the functionality of [Label Studio](https://labelstud.io), a powerful data labeling tool. These scripts can be used to automate workflows, integrate with external tools, and customize the labeling process according to your needs. |
| 5 | + |
| 6 | +Whether you're building custom data processors, integrations, or UI components, you'll find the necessary resources and examples in this repo to get started. |
| 7 | + |
| 8 | +## Official Documentation |
| 9 | + |
| 10 | +For detailed documentation and guides on how to use and extend Label Studio with custom scripts, visit the official [Label Studio Scripts Documentation](https://docs.humansignal.com/guide/scripts). |
| 11 | + |
| 12 | +## File Structure |
| 13 | + |
| 14 | +This repository follows a clear folder structure to organize the various custom scripts and configuration files: |
| 15 | + |
| 16 | +```bash |
| 17 | +label-studio-custom-scripts/ |
| 18 | +├── custom-scripts/ |
| 19 | +│ ├── script1/ |
| 20 | +│ │ ├── data.{json|mp3|mp4} |
| 21 | +│ │ ├── script.js |
| 22 | +│ │ └── view.xml |
| 23 | +│ ├── script2/ |
| 24 | +│ │ ├── data.{json|mp3|mp4} |
| 25 | +│ │ ├── script.js |
| 26 | +│ │ └── view.xml |
| 27 | +│ └── ... |
| 28 | +└── manifest.json |
| 29 | +``` |
| 30 | + |
| 31 | +- **`/script1`**: Contains all the files to document a custom script. |
| 32 | + - Each script has a `script.js` and `view.xml` file that define the logic and UI of the script. |
| 33 | +- **`/script.js`**: Contains the actual custom script `javascript` file that can be embedded in the Label Studio code editor. |
| 34 | +- **`/view.xml`**: Stores an example of a `<View>` that will work along the script. |
| 35 | +- **`/data.{json|mp3|mp4}`**: Stores an example of the data that can be used along with the script. |
| 36 | +- **`manifest.json`**: This file lists the scripts, their metadata (title, description, etc.), and their paths for easy integration with Label Studio. |
| 37 | + |
| 38 | +## Usage |
| 39 | + |
| 40 | +After your script gets merged you will be able to find it in your project's **Labeling Interface** |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | +## Contributing |
| 45 | + |
| 46 | +We welcome contributions! Whether it's bug fixes or new scripts, feel free to open a pull request. Here's how you can get started: |
| 47 | + |
| 48 | +1. **Create a new branch** for your feature or bugfix. |
| 49 | +2. **Make your changes** and ensure that they adhere to the project's file structure and guidelines. You need to create a folder with the name using underscores (`path`) of your script and add a `view.xml` and a `script.js` file minimum. |
| 50 | +3. **Register the script** in the `manifest.json` adding the following information: |
| 51 | + ```json |
| 52 | + [ |
| 53 | + { |
| 54 | + "title": "Your script title", |
| 55 | + "description": "Your script description", |
| 56 | + "path": "exact_name_of_the_script_folder", // `script1` as per the File Structure example |
| 57 | + "private": false // whether you want to hide it in the "Insert Script" dropdown in the Configurator code tab |
| 58 | + } |
| 59 | + ] |
| 60 | + ``` |
| 61 | +4. **Test your changes** to ensure everything works as expected. |
| 62 | +5. **Submit a pull request** explaining the changes you made. |
| 63 | + |
| 64 | +Please make sure that your contributions follow the existing code style and structure. |
| 65 | + |
| 66 | +## License |
| 67 | + |
| 68 | +This software is licensed under the [Apache 2.0 LICENSE](/LICENSE) © [Heartex](https://www.heartex.com/). 2020-2025 |
| 69 | + |
| 70 | +--- |
| 71 | + |
| 72 | +If you have any questions or need assistance, feel free to reach out through issues or discussions. We look forward to your contributions! |
0 commit comments