Science Score: 49.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 2 DOI reference(s) in README -
✓Academic publication links
Links to: sciencedirect.com -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (16.5%) to scientific vocabulary
Keywords from Contributors
Repository
Praat in Python, the Pythonic way
Basic Info
- Host: GitHub
- Owner: YannickJadoul
- License: gpl-3.0
- Language: C++
- Default Branch: master
- Homepage: https://parselmouth.readthedocs.io/
- Size: 101 MB
Statistics
- Stars: 1,170
- Watchers: 19
- Forks: 125
- Open Issues: 21
- Releases: 15
Metadata Files
README.md
Parselmouth - Praat in Python, the Pythonic way
Parselmouth is a Python library for the Praat software.
Though other attempts have been made at porting functionality from Praat to Python, Parselmouth is unique in its aim to provide a complete and Pythonic interface to the internal Praat code. While other projects either wrap Praat's scripting language or reimplementing parts of Praat's functionality in Python, Parselmouth directly accesses Praat's C/C++ code (which means the algorithms and their output are exactly the same as in Praat) and provides efficient access to the program's data, but also provides an interface that looks no different from any other Python library.
Drop by our Gitter chat room or post a message to our Google discussion group if you have any question, remarks, or requests!
Try out Parselmouth online, in interactive Jupyter notebooks on Binder.
Installation
Parselmouth can be installed like any other Python library, using (a recent version of) the Python package manager pip, on Linux, macOS, and Windows:
pip install praat-parselmouth
or, to update your installed version to the latest release:
pip install -U praat-parselmouth
For more detailed instructions, please refer to the documentation.
Example usage
```Python import parselmouth
import numpy as np import matplotlib.pyplot as plt import seaborn as sns
sns.set() # Use seaborn's default style to make attractive graphs
Plot nice figures using Python's "standard" matplotlib library
snd = parselmouth.Sound("docs/examples/audio/thenorthwindandthesun.wav")
plt.figure()
plt.plot(snd.xs(), snd.values.T)
plt.xlim([snd.xmin, snd.xmax])
plt.xlabel("time [s]")
plt.ylabel("amplitude")
plt.show() # or plt.savefig("sound.png"), or plt.savefig("sound.pdf")

Python
def drawspectrogram(spectrogram, dynamicrange=70):
X, Y = spectrogram.xgrid(), spectrogram.ygrid()
sgdb = 10 * np.log10(spectrogram.values)
plt.pcolormesh(X, Y, sgdb, vmin=sgdb.max() - dynamic_range, cmap='afmhot')
plt.ylim([spectrogram.ymin, spectrogram.ymax])
plt.xlabel("time [s]")
plt.ylabel("frequency [Hz]")
def draw_intensity(intensity): plt.plot(intensity.xs(), intensity.values.T, linewidth=3, color='w') plt.plot(intensity.xs(), intensity.values.T, linewidth=1) plt.grid(False) plt.ylim(0) plt.ylabel("intensity [dB]")
intensity = snd.tointensity()
spectrogram = snd.tospectrogram()
plt.figure()
drawspectrogram(spectrogram)
plt.twinx()
drawintensity(intensity)
plt.xlim([snd.xmin, snd.xmax])
plt.show() # or plt.savefig("spectrogram.pdf")

Python
def drawpitch(pitch):
# Extract selected pitch contour, and
# replace unvoiced samples by NaN to not plot
pitchvalues = pitch.selectedarray['frequency']
pitchvalues[pitchvalues==0] = np.nan
plt.plot(pitch.xs(), pitchvalues, 'o', markersize=5, color='w')
plt.plot(pitch.xs(), pitch_values, 'o', markersize=2)
plt.grid(False)
plt.ylim(0, pitch.ceiling)
plt.ylabel("fundamental frequency [Hz]")
pitch = snd.to_pitch()
If desired, pre-emphasize the sound fragment before calculating the spectrogram
preemphasizedsnd = snd.copy()
preemphasizedsnd.preemphasize()
spectrogram = preemphasizedsnd.tospectrogram(windowlength=0.03, maximumfrequency=8000)
plt.figure()
drawspectrogram(spectrogram)
plt.twinx()
drawpitch(pitch)
plt.xlim([snd.xmin, snd.xmax])
plt.show() # or plt.savefig("spectrogram_0.03.pdf")

Python
Find all .wav files in a directory, pre-emphasize and save as new .wav and .aiff file
import parselmouth
import glob import os.path
for wavefile in glob.glob("audio/*.wav"): print("Processing {}...".format(wavefile)) s = parselmouth.Sound(wavefile) s.preemphasize() s.save(os.path.splitext(wavefile)[0] + "pre.wav", 'WAV') # or parselmouth.SoundFileFormat.WAV instead of 'WAV' s.save(os.path.splitext(wavefile)[0] + "pre.aiff", 'AIFF') ```
More examples of different use cases of Parselmouth can be found in the documentation's examples section.
Documentation
Documentation is available at ReadTheDocs, including the API reference of Parselmouth.
Development
Currently, the actual project and Parselmouth's code is not very well documented. Or well, hardly documented at all. That is planned to still change in order to allow for easier contribution to this open source project. Until that day in some undefined future, if you want to contribute to Parselmouth, do let me know on Gitter or by email, and I will very gladly guide you through the project and help you get started.
Briefly summarized, Parselmouth is built using cmake. Next to that, to manually build Parselmouth, the only requirement is a modern C++ compiler supporting the C++17 standard.
Acknowledgements
- Parselmouth builds on the extensive code base of Praat by Paul Boersma, which actually implements the huge variety of speech processing and phonetic algorithms that can now be accessed through Parselmouth.
- In order to do so, Parselmouth makes use of the amazing pybind11 library, allowing to expose the C/C++ functionality of Praat as a Python interface.
- Special thanks go to Bill Thompson and Robin Jadoul for their non-visible-in-history but very valuable contributions.
License
- Parselmouth is released under the GNU General Public License, version 3 or later. See the
LICENSEfile for details.
A manuscript introducing Parselmouth (and supplementary material) has been published in the Journal of Phonetics. Scientific research using Parselmouth's functionality can cite Parselmouth as follows:
Jadoul, Y., Thompson, B., & de Boer, B. (2018). Introducing Parselmouth: A Python interface to Praat. Journal of Phonetics, 71, 1-15. https://doi.org/10.1016/j.wocn.2018.07.001
- Praat, together with its dependencies, is released under the GNU General Public License, version 3 or later. Praat's own source code (excluding dependencies) is released under the GNU General Public License, version 2 or later. Small changes to this code base, made in the context of Parselmouth, can be found within the
githistory.
Parselmouth only exposes Praat's existing functionality and implementation of algorithms. If you use Parselmouth in your research and plan to cite it in a scientific publication, please do not forget to cite Praat.
Boersma, P., & Weenink, D. (2021). Praat: doing phonetics by computer [Computer program]. Version 6.1.38, retrieved 2 January 2021 from http://www.praat.org/
pybind11 is released under a BSD-style license.
The audio fragment extracted from a recording of the Aesop fable The North Wind and the Sun, used as example audio in the documentation and tests, is a Wikimedia Commons audio file licensed by the International Phonetic Association under the Creative Commons Attribution-Share Alike 3.0 Unported license.
Owner
- Name: Yannick Jadoul
- Login: YannickJadoul
- Kind: user
- Location: Rome, Italy
- Company: Sapienza University of Rome & Vrije Universiteit Brussel
- Repositories: 27
- Profile: https://github.com/YannickJadoul
GitHub Events
Total
- Create event: 6
- Release event: 1
- Issues event: 12
- Watch event: 103
- Delete event: 6
- Issue comment event: 47
- Push event: 27
- Pull request event: 14
- Fork event: 13
Last Year
- Create event: 6
- Release event: 1
- Issues event: 12
- Watch event: 103
- Delete event: 6
- Issue comment event: 47
- Push event: 27
- Pull request event: 14
- Fork event: 13
Committers
Last synced: 10 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Yannick Jadoul | y****l@b****t | 901 |
| dependabot[bot] | 4****] | 39 |
| pre-commit-ci[bot] | 6****] | 13 |
| Michał Górny | m****y@g****g | 1 |
| Takeshi Ikuma | t****a@g****m | 1 |
| Marianne | m****k@g****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 83
- Total pull requests: 76
- Average time to close issues: about 1 month
- Average time to close pull requests: 7 days
- Total issue authors: 75
- Total pull request authors: 8
- Average comments per issue: 4.54
- Average comments per pull request: 0.86
- Merged pull requests: 53
- Bot issues: 0
- Bot pull requests: 57
Past Year
- Issues: 9
- Pull requests: 19
- Average time to close issues: 4 days
- Average time to close pull requests: 2 days
- Issue authors: 9
- Pull request authors: 6
- Average comments per issue: 1.67
- Average comments per pull request: 1.0
- Merged pull requests: 12
- Bot issues: 0
- Bot pull requests: 12
Top Authors
Issue Authors
- auspicious3000 (4)
- qo4on (2)
- calebstrait (2)
- ucasiggcas (2)
- hadware (2)
- YannickJadoul (2)
- nils-werner (1)
- Guillaume-Risch (1)
- Luke-Poeppel (1)
- tikuma-lsuhsc (1)
- msukhare (1)
- reedajorgy (1)
- iamsumitjangra (1)
- Sakun92 (1)
- GeorgeQii (1)
Pull Request Authors
- dependabot[bot] (35)
- pre-commit-ci[bot] (22)
- hokiedsp (12)
- mgorny (2)
- npt-1707 (2)
- dtruong27 (1)
- mdhk (1)
- IParraMartin (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 3
-
Total downloads:
- pypi 171,983 last-month
- Total docker downloads: 13,210
-
Total dependent packages: 27
(may contain duplicates) -
Total dependent repositories: 850
(may contain duplicates) - Total versions: 45
- Total maintainers: 1
pypi.org: praat-parselmouth
Praat in Python, the Pythonic way
- Homepage: https://github.com/YannickJadoul/Parselmouth
- Documentation: https://parselmouth.readthedocs.io/
- License: GPLv3
-
Latest release: 0.4.6
published 9 months ago
Rankings
Maintainers (1)
proxy.golang.org: github.com/yannickjadoul/parselmouth
- Documentation: https://pkg.go.dev/github.com/yannickjadoul/parselmouth#section-documentation
- License: gpl-3.0
-
Latest release: v0.4.6
published 9 months ago
Rankings
proxy.golang.org: github.com/YannickJadoul/Parselmouth
- Documentation: https://pkg.go.dev/github.com/YannickJadoul/Parselmouth#section-documentation
- License: gpl-3.0
-
Latest release: v0.4.6
published 9 months ago
Rankings
Dependencies
- flask *
- matplotlib *
- pandas *
- requests *
- seaborn *
- GitPython *
- PyGithub *
- Sphinx >=3
- ipykernel *
- ipywidgets *
- nbsphinx *
- requests *
- sphinx_rtd_theme *
- breathe ==4.25.1
- commonmark ==0.9.1
- recommonmark ==0.7.1
- sphinx ==3.3.1
- sphinx_rtd_theme ==0.5.0
- sphinxcontrib-moderncmakedomain ==3.17
- sphinxcontrib-svg2pdfconverter ==1.1.0
- numpy ==1.16.6
- numpy ==1.18.0
- numpy ==1.19.3
- pytest ==4.6.9
- pytest ==6.1.2
- pytest ==6.2.1
- pytest-timeout *
- scipy ==1.2.3
- scipy ==1.5.4
- numpy >=1.7
- pytest *
- pytest-lazy-fixture *
- tgt *
- actions/checkout v3 composite
- actions/setup-python v4 composite
- ammaraskar/gcc-problem-matcher master composite
- ammaraskar/msvc-problem-matcher master composite
- jwlawson/actions-setup-cmake v1.13 composite
- actions/checkout v3 composite
- actions/download-artifact v3 composite
- actions/setup-python v4 composite
- actions/upload-artifact v3 composite
- jwlawson/actions-setup-cmake v1.13 composite
- ncipollo/release-action v1 composite
- numpy >=1.7.0