vocalpy
A core package for acoustic communication research in Python
Science Score: 67.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 6 DOI reference(s) in README -
✓Academic publication links
Links to: nature.com, zenodo.org -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (18.1%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
A core package for acoustic communication research in Python
Basic Info
- Host: GitHub
- Owner: vocalpy
- License: bsd-3-clause
- Language: Python
- Default Branch: main
- Homepage: https://vocalpy.readthedocs.io/en/latest/
- Size: 8.42 MB
Statistics
- Stars: 37
- Watchers: 2
- Forks: 9
- Open Issues: 84
- Releases: 20
Topics
Metadata Files
README.md
A core package for acoustic communication research in Python
There are many great software tools for researchers studying acoustic communication in animals[^1]. But our research groups work with a wide range of different data formats: for audio, for array data, for annotations. This means we write a lot of low-level code to deal with those formats, and then our code for analyses is tightly coupled to those formats. In turn, this makes it hard for other groups to read our code, and it takes a real investment to understand our analyses, workflows and pipelines. It also means that it requires significant work to translate from a pipeline or analysis worked out by a scientist-coder in a Jupyter notebook into a generalized, robust service provided by an application.
In particular, acoustic communication researchers working with the Python programming language face these problems. How can our scripts and libraries talk to each other? Luckily, Python is a great glue language! Let's use it to solve these problems.
The goals of VocalPy are to: - make it easy to work with a wide array of data formats: audio, array (spectrograms, features), annotation - provide classes that represent commonly-used data types: audio, spectograms, features, annotations - provide classes that represent common processes and steps in pipelines: segmenting audio, computing spectrograms, extracting features - make it easier for scientist-coders to flexibly and iteratively build datasets, without needing to deal directly with a database if they don't want to - make it possible to re-use code you have already written for your own research group - and finally: - make code easier to share and read across research groups, by providing these classes, and idiomiatic ways of coding with them; think of VocalPy as an interoperability layer and a common language - facilitate collaboration between scientist-coders writing imperative analysis scripts and research software engineers developing libraries and applications
A paper introducing VocalPy and its design has been accepted at Forum Acusticum 2023 as part of the session "Open-source software and cutting-edge applications in bio-acoustics", and will be published in the proceedings.
[^1]: For a curated collection, see https://github.com/rhine3/bioacoustics-software.
Features
Data types for acoustic communication data: audio, spectrogram, annotations, features
The vocalpy.Sound data type
- Works with a wide array of audio formats, thanks to soundfile.
- Also works with the cbin audio format saved by the LabView app EvTAF used by many neuroscience labs studying birdsong, thanks to evfuncs.
```python
import vocalpy as voc datadir = ('tests/data-for-tests/source/audiowavannotbirdsongrec/Bird0/Wave/') wavpaths = voc.paths.fromdir(datadir, 'wav') sounds = [voc.Sound.read(wavpath) for wavpath in wavpaths] print(sounds[0]) vocalpy.Sound(data=array([3.0517...66210938e-04]), samplerate=32000, channels=1)) ```
The vocalpy.Spectrogram data type
- Save expensive-to-compute spectrograms to array files, so you don't regenerate them over and over again
```python
import vocalpy as voc datadir = ('tests/data-for-tests/generated/spectnpz/') spectpaths = voc.paths.fromdir(datadir, 'wav.npz') spects = [voc.Spectrogram.read(spectpath) for spectpath in spectpaths] print(spects[0]) vocalpy.Spectrogram(data=array([[3.463...7970774e-14]]), frequencies=array([ 0....7.5, 16000. ]), times=array([0.008,...7.648, 7.65 ])) ```
The vocalpy.Annotation data type
- Load many different annotation formats using the pyOpenSci package crowsetta
```python
import vocalpy as voc datadir = ('tests/data-for-tests/source/audiocbinannotnotmat/gy6or6/032312/') notmatpaths = voc.paths.fromdir(datadir, '.not.mat') annots = [voc.Annotation.read(notmatpath, format='notmat') for notmatpath in notmatpaths] print(annots[1]) Annotation(data=Annotation(annotpath=PosixPath('tests/data-for-tests/source/audiocbinannotnotmat/gy6or6/032312/gy6or6baseline2303120809.141.cbin.not.mat'), notatedpath=PosixPath('tests/data-for-tests/source/audiocbinannotnotmat/gy6or6/032312/gy6or6baseline2303120809.141.cbin'), seq=
), path=PosixPath('tests/data-for-tests/source/audiocbinannotnotmat/gy6or6/032312/gy6or6baseline2303120809.141.cbin.not.mat')) ```
Classes for common steps in your pipelines and workflows
A Segmenter for segmentation into sequences of units
```python
import evfuncs import vocalpy as voc datadir = ('tests/data-for-tests/source/audiocbinannotnotmat/gy6or6/032312/') cbinpaths = voc.paths.fromdir(datadir, 'cbin') audios = [voc.Sound.read(cbinpath) for cbinpath in cbinpaths] segmentparams = {'threshold': 1500, 'minsyldur': 0.01, 'minsilentdur': 0.006} segmenter = voc.Segmenter(callback=evfuncs.segmentsong, segmentparams=segmentparams) seqs = segmenter.segment(audios, parallelize=True) [ ########################################] | 100% Completed | 122.91 ms print(seqs[1]) Sequence(units=[Unit(onset=2.19075, offset=2.20428125, label='-', audio=None, spectrogram=None), Unit(onset=2.35478125, offset=2.38815625, label='-', audio=None, spectrogram=None), Unit(onset=2.8410625, offset=2.86715625, label='-', audio=None, spectrogram=None), Unit(onset=3.48234375, offset=3.49371875, label='-', audio=None, spectrogram=None), Unit(onset=3.57021875, offset=3.60296875, label='-', audio=None, spectrogram=None), Unit(onset=3.64403125, offset=3.67721875, label='-', audio=None, spectrogram=None), Unit(onset=3.72228125, offset=3.74478125, label='-', audio=None, spectrogram=None), Unit(onset=3.8036875, offset=3.8158125, label='-', audio=None, spectrogram=None), Unit(onset=3.82328125, offset=3.83646875, label='-', audio=None, spectrogram=None), Unit(onset=4.13759375, offset=4.16346875, label='-', audio=None, spectrogram=None), Unit(onset=4.80278125, offset=4.814, label='-', audio=None, spectrogram=None), Unit(onset=4.908125, offset=4.922875, label='-', audio=None, spectrogram=None), Unit(onset=4.9643125, offset=4.992625, label='-', audio=None, spectrogram=None), Unit(onset=5.039625, offset=5.0506875, label='-', audio=None, spectrogram=None), Unit(onset=5.10165625, offset=5.1385, label='-', audio=None, spectrogram=None), Unit(onset=5.146875, offset=5.16203125, label='-', audio=None, spectrogram=None), Unit(onset=5.46390625, offset=5.49409375, label='-', audio=None, spectrogram=None), Unit(onset=6.14503125, offset=6.1565625, label='-', audio=None, spectrogram=None), Unit(onset=6.31003125, offset=6.346125, label='-', audio=None, spectrogram=None), Unit(onset=6.38996875, offset=6.4018125, label='-', audio=None, spectrogram=None), Unit(onset=6.46053125, offset=6.4796875, label='-', audio=None, spectrogram=None), Unit(onset=6.83525, offset=6.8643125, label='-', audio=None, spectrogram=None)], method='segmentsong', segmentparams={'threshold': 1500, 'minsyldur': 0.01, 'minsilentdur': 0.006}, audio=vocalpy.Sound(data=None, samplerate=None, channels=None), path=tests / data - for -tests / source / audiocbinannotnotmat / gy6or6 / 032312 / gy6or6baseline2303120809.141.cbin), spectrogram=None) ```
A SpectrogramMaker for computing spectrograms
```python
import vocalpy as voc wavpaths = voc.paths.fromdir('wav') audios = [voc.Sound(wavpath) for wavpath in wavpaths] spectparams = {'fftsize': 512, 'stepsize': 64} spectmaker = voc.SpectrogramMaker(spectparams=spectparams) spects = spectmaker.make(audios, parallelize=True) ```
And more!
For a crash course in VocalPy, please see the quickstart in the documentation. And for walkthroughs on how to use VocalPy for common tasks, please see the How-Tos section of the user guide.
Installation
With pip
pip install vocalpy
With conda
conda install vocalpy -c conda-forge
For more detail see Getting Started - Installation
Support
To report a bug or request a feature,
please use the issue tracker on GitHub:
https://github.com/vocalpy/vocalpy/issues
To ask a question about vocalpy, discuss its development,
or share how you are using it,
please start a new topic on the VocalPy forum
with the vocalpy tag:
https://forum.vocalpy.org/
Contribute
Code of conduct
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
Contributing Guidelines
Below we provide some quick links,
but you can learn more about how you can help and give feedback
by reading our Contributing Guide.
To ask a question about vocalpy, discuss its development,
or share how you are using it,
please start a new "Q&A" topic on the VocalPy forum
with the vocalpy tag:
https://forum.vocalpy.org/
To report a bug, or to request a feature,
please use the issue tracker on GitHub:
https://github.com/vocalpy/vocalpy/issues
CHANGELOG
You can see project history and work in progress in the CHANGELOG
License
The project is licensed under the BSD license.
Citation
If you use vocalpy, please cite the DOI:
Contributors ✨
Thanks goes to these wonderful people (emoji key):
Ralph Emilio Peterson 🤔 📓 📖 🐛 💻 |
Tetsuo Koyama 📖 |
avanikop 🤔 |
This project follows the all-contributors specification. Contributions of any kind welcome!
Owner
- Name: VocalPy
- Login: vocalpy
- Kind: organization
- Website: https://forum.vocalpy.org/
- Repositories: 8
- Profile: https://github.com/vocalpy
Citation (CITATION.cff)
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!
cff-version: 1.2.0
title: vocalpy
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- given-names: David
family-names: Nicholson
email: nicholdav@gmail.com
orcid: 'https://orcid.org/0000-0002-4261-4719'
affiliation: Independent researcher
identifiers:
- type: doi
value: 10.5281/zenodo.7905425
description: Zenodo
repository-code: 'https://github.com/vocalpy/vocalpy'
url: 'https://vocalpy.readthedocs.io/en/latest/'
abstract: >-
A core package for acoustic communication research in
Python
keywords:
- acoustic communication
- bioacoustics
- Python
license: BSD-3-Clause
commit: 2fbd08b16cfd0dc4e5f9a749903d3d7258991b8b
version: 0.10.0.post1
date-released: '2024-11-28'
GitHub Events
Total
- Create event: 8
- Release event: 2
- Issues event: 33
- Watch event: 6
- Delete event: 1
- Issue comment event: 23
- Push event: 40
- Pull request review event: 4
- Pull request review comment event: 4
- Pull request event: 9
- Fork event: 4
Last Year
- Create event: 8
- Release event: 2
- Issues event: 33
- Watch event: 6
- Delete event: 1
- Issue comment event: 23
- Push event: 40
- Pull request review event: 4
- Pull request review comment event: 4
- Pull request event: 9
- Fork event: 4
Committers
Last synced: 9 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| David Nicholson | n****e | 107 |
| David Nicholson | N****e | 47 |
| allcontributors[bot] | 4****] | 6 |
| Tetsuo Koyama | t****0@g****m | 4 |
| Ralph Emilio Peterson | r****n | 3 |
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 157
- Total pull requests: 58
- Average time to close issues: 5 months
- Average time to close pull requests: 17 days
- Total issue authors: 5
- Total pull request authors: 7
- Average comments per issue: 0.84
- Average comments per pull request: 0.72
- Merged pull requests: 52
- Bot issues: 0
- Bot pull requests: 7
Past Year
- Issues: 30
- Pull requests: 11
- Average time to close issues: 3 days
- Average time to close pull requests: 3 months
- Issue authors: 4
- Pull request authors: 5
- Average comments per issue: 0.4
- Average comments per pull request: 0.64
- Merged pull requests: 5
- Bot issues: 0
- Bot pull requests: 2
Top Authors
Issue Authors
- NickleDave (138)
- ralphpeterson (8)
- avanikop (1)
- eintzandt (1)
- neuronalX (1)
Pull Request Authors
- NickleDave (54)
- allcontributors[bot] (11)
- ralphpeterson (6)
- tkoyama010 (4)
- yarikoptic (3)
- JacquelineGoe (2)
- eaogorman (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 53 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 22
- Total maintainers: 1
pypi.org: vocalpy
A core package for acoustic communication research in Python
- Homepage: https://github.com/vocalpy/vocalpy
- Documentation: https://vocalpy.readthedocs.io/
- License: BSD License
-
Latest release: 0.10.2
published 7 months ago
Rankings
Maintainers (1)
Dependencies
- actions/checkout v2 composite
- actions/setup-python v2 composite
- codecov/codecov-action v3 composite
- SQLAlchemy >=2.0.12
- SoundFile >=0.12.1
- attrs >=23.1.0
- crowsetta >=5.0.0
- dask >=2.10.1
- evfuncs >= 0.3.3
- librosa >= 0.10.0.post2
- matplotlib >=3.7.1
- numpy >=1.21.0
- pandas >= 1.3.5
- scipy >=1.7.0