Skip to main content

The script reads a JSON file (or folder) and generates an ELAN file to match.

Project description

JSON to ELAN

The script looks in a folder, and generates an ELAN file to match each JSON file.

JSON format

It has been written for the JSON output from Huggingface ASR pipelines. Here's an example of the expected JSON format.

[
    {
        "text": "luanghan",
        "timestamp":
        [
            1.16,
            1.48
        ]
    },
    {
        "text": "ian",
        "timestamp":
        [
            1.56,
            1.7
        ]
    }
]

Basic usage

Put your JSON files somewhere easily accessible, eg in a data folder in your working directory. Install it. Use it by providing a path to your data.

pip install json-to-elan
from json_to_elan import make_elan 
make_elan(data_dir="content")

Using this in Colab?

To use this in Google Colab, upload your JSON files into the File browser. Then define the data directory as:

data_dir="/content"

Options

You can also set a different tier name from the default (which is "default").

The ELAN file gets a linked media file written, for which we assume that the media file is a WAV with the same name as the JSON file. If you want to change this to MP3, change the audio_format.

Here's an example:

make_elan(data_dir="content", tier_name="Words", audio_format="mp3")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

json-to-elan-0.1.17.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

json_to_elan-0.1.17-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file json-to-elan-0.1.17.tar.gz.

File metadata

  • Download URL: json-to-elan-0.1.17.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.9.12 Darwin/21.5.0

File hashes

Hashes for json-to-elan-0.1.17.tar.gz
Algorithm Hash digest
SHA256 4b7bed625505e84f16e79dab018bc89cbeb88079cb960d603d60d39790652fdf
MD5 eb16c9e400984b8df7142c9d87305bf0
BLAKE2b-256 11dfa264f244875af163d0719865ad058f39ebeedcd5ea57fcc58877fe60341c

See more details on using hashes here.

File details

Details for the file json_to_elan-0.1.17-py3-none-any.whl.

File metadata

  • Download URL: json_to_elan-0.1.17-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.9.12 Darwin/21.5.0

File hashes

Hashes for json_to_elan-0.1.17-py3-none-any.whl
Algorithm Hash digest
SHA256 51f5183b161a508bb6431e1d5adeb483fa4cb5f11770afe98b5912386389f678
MD5 5bb7ac678b6a9367cb973b976fdd81fb
BLAKE2b-256 99db57876748eda2fd1bdd3ff48036aa5e5a2cf858d17a9e04fb80e85b7377b3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page