Package: textgrid-tools
textgrid-toolsCommand-line interface (CLI) to modify TextGrids and their corresponding audio files.Featuresgridsmerge: merge grids togetherplot-durations: plot durationsmark-durations: mark intervals with specific durations with a textcreate-dictionary: create pronunciation dictionary out of a word and a pronunciation tierplot-stats: plot statisticsexport-vocabulary: export vocabulary out of multiple grid filesexport-marks: exports marks of a tier to a fileexport-durations: exports durations of grids to a fileexport-paths: exports grid paths to a fileexport-audio-paths: exports audio paths to a fileimport-paths: import grids from paths written in a fileimport-audio-paths: import audio files from paths written in a filegridcreate: convert text files to grid filessync: synchronize grid minTime and maxTime according to the corresponding audio filesplit: split a grid file on intervals into multiple grid files (incl. audio files)print-stats: print statisticstiersapply-mapping: apply mapping table to markstranscribe: transcribe words of tiers using a pronunciation dictionaryremove: remove tierstierrename: rename tierclone: clone tiermap: map tier to other tiersmove: move tier to another positionexport: export content of tier to a txt fileimport: import content of tier from a txt fileintervalsjoin: join adjacent intervalsjoin-between-marks: join intervals between marksjoin-by-boundary: join intervals by boundaries of a tierjoin-by-duration: join intervals by a durationjoin-marks: join intervals containing specific marksjoin-symbols: join intervals containing specific symbolsjoin-template: join intervals according to a templatesplit: split intervalsfix-boundaries: align boundaries of tiers according to a reference tierremove: remove intervalsplot-durations: plot durationsreplace-text: replace text using regex patternRoadmapPerformance improvementAdding more testsInstallationpipinstalltextgrid-tools--userUsageusage: textgrid-tools-cli [-h] [-v] {grids,grid,tiers,tier,intervals} ...

This program provides methods to modify TextGrids (.TextGrid) and their corresponding audio files (.wav).

positional arguments:
  {grids,grid,tiers,tier,intervals}  description
    grids                            execute commands targeted at multiple grids at once
    grid                             execute commands targeted at single grids
    tiers                            execute commands targeted at multiple tiers at once
    tier                             execute commands targeted at single tiers
    intervals                        execute commands targeted at intervals of tiers

optional arguments:
  -h, --help                         show this help message and exit
  -v, --version                      show program's version number and exitDependenciesnumpy>=1.18.5scipy>=1.8.0tqdm>=4.63.0TextGrid>=1.5pandas>=1.4.0ordered_set>=4.1.0matplotlib>=3.5.0pronunciation_dictionary>=0.0.5ContributingIf you notice an error, please don't hesitate to open an issue.Development setup# updatesudoaptupdate# install Python 3.8, 3.9, 3.10 & 3.11 for ensuring that tests can be runsudoaptinstallpython3-pip\python3.8python3.8-devpython3.8-distutilspython3.8-venv\python3.9python3.9-devpython3.9-distutilspython3.9-venv\python3.10python3.10-devpython3.10-distutilspython3.10-venv\python3.11python3.11-devpython3.11-distutilspython3.11-venv# install pipenv for creation of virtual environmentspython3.8-mpipinstallpipenv--user# check out repogitclonehttps://github.com/stefantaubert/textgrid-ipa.gitcdtextgrid-ipa# create virtual environmentpython3.8-mpipenvinstall--devRunning the tests# first install the tool like in "Development setup"# then, navigate into the directory of the repo (if not already done)cdtextgrid-ipa# activate environmentpython3.8-mpipenvshell# run teststoxFinal lines of test result output:py38: commands succeeded
  py39: commands succeeded
  py310: commands succeeded
  py311: commands succeeded
  congratulations :)TroubleshootingIf recordings/audio files are not in.wavformat they need to be converted, e.g.:sudoaptinstallffmpeg-y# e.g., mp3 to wav conversionffmpeg-i*.mp3-acodecpcm_s16le-ar22050*.wavLicenseMIT LicenseAcknowledgmentsFunded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) – Project-ID 416228727 – CRC 1410CitationIf you want to cite this repo, you can use this BibTeX-entry generated by GitHub (seeAbout => Cite this repository).Changelogv0.0.8 (2023-05-30)Fixed:Bugfixintervals removecopying on different in/out-locationsBugfiximport-pathsandimport-audio-pathsoption--symlinkis now creating symbolic links instead of hard linksChanged:Improved logging inimport-pathsandimport-audio-pathsImproved logging of durations ingrids plot-statsAdded:Added option to get durations from audio files ongrids export-durationsv0.0.7 (2023-01-12)Fixed:Bugfixgrids import-pathsandgrids import-audio-pathsAdded:Added option--ignoreto ignore custom marks ingrids export-vocabularyAdded option--modetointervals replace-textto replace text on different interval positionsAdded returning of an exit codeRemoved:Removedtiers mark-silencebecausegrids mark-durationsshould be usedRemovedtiers remove-symbolsbecauseintervals replace-textshould be usedRemovedintervals join-between-pausesbecausejoin-between-marksshould be usedv0.0.6 (2022-12-23)improved validation for pronunciation dictionary creationbugfix replace text loggingadded intervals join-templatesupport Python 3.11update pylint configfix description of grid/audio importv0.0.5 (2022-11-25)intervals remove: added parametermodeto better choose which intervals should be removedAdded method to plot statistics for all grids togethertiers transcribe: added optionassign-mark-to-missingto replace missing transcriptions with a custom markBugfix:mark-durationsempty couldn't be assignedAdded--min-counttomark-durationsImproved sorting of phonemes in durations plottingChanged marks exporting format to only contain tier marksAdded exporting/importing of audio pathsAdded durations exportingAdded exporting/importing of grid pathsAdded replacement of marks using regex patternAdded--dryoption to most methodsMake split symbol on split mandatoryUpper-cased metavarsv0.0.4 (2022-06-09)fixed bug while saving TextGridsimproved robustness against file system errorsv0.0.3 (2022-05-31)fixed invalid installation format and clarified dependenciesadjusted textgrid serialization equal to praat outputadded optioninclude-emptyon vocabulary exportset default chunksize to1added missing__init__.pyfilesimproved loggingv0.0.2 (2022-05-06)improved loggingimproved reading/saving speed of TextGridsremoved n_digits argumentadded option to define encoding of TextGridsadded option to insert interval between grids which should be merged togetherremoved tier copyadded parser for tier exportv0.0.1 (2022-04-29)initial release