rustling#

Submodules#

Package Contents#

rustling.read_chat(path: str | os.PathLike[str], *, filter_files: str | Sequence[str] | None = None, filter_participants: str | Sequence[str] | None = None, cls: type[CHAT] = CHAT, strict: bool = True) CHAT#

Read CHAT data.

Parameters:
  • path – Path to a .zip file, a local directory containing .cha files, a single .cha file, a git repository URL (ending in .git), or an HTTP/HTTPS URL.

  • filter_files – Filename(s) to keep. Regular expression matching is supported. If None, all files are included.

  • filter_participants – Participant code(s) to keep. Regular expression matching is supported. If None, all participants are included.

  • cls – The class used to create the reader. Must be CHAT or a subclass of it.

  • strict – If True, enforce strict parsing of the CHAT data.

Returns:

A CHAT instance filtered by the specified files and participants.

Raises:
  • TypeError – If cls is not CHAT or a subclass of it.

  • ValueError – If path does not point to a recognized source.

rustling.read_conllu(path: str | os.PathLike[str], *, cls: type[CoNLLU] = CoNLLU) CoNLLU#

Read CoNLL-U data.

Parameters:
  • path – Path to a .zip file, a local directory containing .conllu files, a single .conllu file, a git repository URL (ending in .git), or an HTTP/HTTPS URL.

  • cls – The class used to create the reader. Must be CoNLLU or a subclass of it.

Returns:

A CoNLLU instance.

Raises:
  • TypeError – If cls is not CoNLLU or a subclass of it.

  • ValueError – If path does not point to a recognized source.

rustling.read_elan(path: str | os.PathLike[str], *, cls: type[ELAN] = ELAN) ELAN#

Read ELAN data.

Parameters:
  • path – Path to a .zip file, a local directory containing .eaf files, a single .eaf file, a git repository URL (ending in .git), or an HTTP/HTTPS URL.

  • cls – The class used to create the reader. Must be ELAN or a subclass of it.

Returns:

An ELAN instance.

Raises:
  • TypeError – If cls is not ELAN or a subclass of it.

  • ValueError – If path does not point to a recognized source.

rustling.read_srt(path: str | os.PathLike[str], *, cls: type[SRT] = SRT) SRT#

Read SRT data.

Parameters:
  • path – Path to a .zip file, a local directory containing .srt files, a single .srt file, a git repository URL (ending in .git), or an HTTP/HTTPS URL.

  • cls – The class used to create the reader. Must be SRT or a subclass of it.

Returns:

An SRT instance.

Raises:
  • TypeError – If cls is not SRT or a subclass of it.

  • ValueError – If path does not point to a recognized source.

rustling.read_textgrid(path: str | os.PathLike[str], *, cls: type[TextGrid] = TextGrid) TextGrid#

Read TextGrid data.

Parameters:
  • path – Path to a .zip file, a local directory containing .TextGrid files, a single .TextGrid file, a git repository URL (ending in .git), or an HTTP/HTTPS URL.

  • cls – The class used to create the reader. Must be TextGrid or a subclass of it.

Returns:

A TextGrid instance.

Raises:
  • TypeError – If cls is not TextGrid or a subclass of it.

  • ValueError – If path does not point to a recognized source.