nzilbb-labbcat
Client library for communicating with LaBB-CAT servers.
Science Score: 54.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
-
✓Academic publication links
Links to: zenodo.org -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.0%) to scientific vocabulary
Repository
Client library for communicating with LaBB-CAT servers.
Basic Info
- Host: GitHub
- Owner: nzilbb
- License: gpl-3.0
- Language: Python
- Default Branch: main
- Size: 1.59 MB
Statistics
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 2
- Releases: 16
Metadata Files
README.md
nzilbb-labbcat
Client library for communicating with LaBB-CAT servers using Python.
e.g.
```python import labbcat
Connect to the LaBB-CAT corpus
corpus = labbcat.LabbcatView("https://labbcat.canterbury.ac.nz/demo", "demo", "demo")
Find all tokens of a word
matches = corpus.getMatches({"orthography":"quake"})
Get the recording of that utterance
audio = corpus.getSoundFragments(matches)
Get Praat TextGrids for the utterances
textgrids = corpus.getFragments( matches, ["utterance", "word","segment"], "text/praat-textgrid") ```
LaBB-CAT is a web-based linguistic annotation store that stores audio or video recordings, text transcripts, and other annotations.
Annotations of various types can be automatically generated or manually added.
LaBB-CAT servers are usually password-protected linguistic corpora, and can be accessed manually via a web browser, or programmatically using a client library like this one.
The current version of this library requires LaBB-CAT version 20220307.1126.
API documentation is available at https://nzilbb.github.io/labbcat-py/
Basic usage
nzilbb-labbcat is available in the Python Package Index here
To install the module:
pip install nzilbb-labbcat
The following example shows how to: 1. upload a transcript to LaBB-CAT, 2. wait for the automatic annotation tasks to finish, 3. extract the annotation labels, and 4. delete the transcript from LaBB-CAT.
```python import labbcat
Connect to the LaBB-CAT corpus
corpus = labbcat.LabbcatEdit("http://localhost:8080/labbcat", "labbcat", "labbcat")
List the corpora on the server
corpora = corpus.getCorpusIds()
List the transcript types
transcripttypelayer = corpus.getLayer("transcripttype") transcripttypes = transcripttypelayer["validLabels"]
Upload a transcript
corpusid = corpora[0] transcripttype = next(iter(transcripttypes)) taskId = corpus.newTranscript( "test/labbcat-py.test.txt", None, None, transcripttype, corpus_id, "test")
wait for the annotation generation to finish
corpus.waitForTask(taskId) corpus.releaseTask(taskId)
get the "POS" layer annotations
annotations = corpus.getAnnotations("labbcat-py.test.txt", "pos") labels = list(map(lambda annotation: annotation["label"], annotations))
find all /a/ segments (phones) in the whole corpus
results = corpus.getMatches({ "segment" : "a" })
get the start/end times of the segments
segments = corpus.getMatchAnnotations(results, "segment", offsetThreshold=50)
get F1/F2 at the midpoint of each /a/ vowel
formantsAtMidpoint = corpus.processWithPraat( labbcat.praatScriptFormants(), 0.025, results, segments)
delete tha transcript from the corpus
corpus.deleteTranscript("labbcat-py.test.txt") ```
For batch uploading and other example code, see the examples subdirectory.
Developers
Create a virtual environment (once only):
python3 -m venv labbcat-env
Before running any of the commands below:
source labbcat-env/bin/activate
To build, test, release, and document the module, the following prerequisites are required:
pip3 install twinepip3 install pathlibpip3 install deprecatedpip3 install setuptoolssudo apt install python3-sphinx
Unit tests
python3 -m unittest
...or for specific test suites:
python3 -m unittest test.TestLabbcatAdmin
... or for specific tests:
python3 -m unittest test.TestLabbcatEdit.test_generateLayerUtterances
Documentation generation
cd docs
make clean
make
Publishing
rm dist/*
python3 setup.py sdist bdist_wheel
twine check dist/*
twine upload dist/*
Owner
- Name: Te Kāhui Roro Reo | New Zealand Institute of Language, Brain and Behaviour
- Login: nzilbb
- Kind: organization
- Location: Christchurch, New Zealand
- Website: http://www.nzilbb.canterbury.ac.nz/
- Repositories: 43
- Profile: https://github.com/nzilbb
A multi-disciplinary centre dedicated to the study of human language.
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: nzilbb-labbcat python package
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- given-names: Robert
family-names: Fromont
email: robert.fromont@canterbury.ac.nz
affiliation: NZILBB
orcid: 'https://orcid.org/0000-0001-5271-5487'
identifiers:
- type: doi
value: 10.5281/zenodo.16905473
repository-code: 'https://github.com/nzilbb/labbcat-py/'
url: 'https://pypi.org/project/nzilbb-labbcat/'
abstract: >-
Client library for communicating with LaBB-CAT servers
using Python.
keywords:
- LaBB-CAT
- corpus linguistics
license: AGPL-3.0-or-later
version: 1.0.0
date-released: '2025-08-19'
GitHub Events
Total
- Release event: 6
- Push event: 15
- Create event: 11
Last Year
- Release event: 6
- Push event: 15
- Create event: 11
Committers
Last synced: about 3 years ago
All Time
- Total Commits: 155
- Total Committers: 1
- Avg Commits per committer: 155.0
- Development Distribution Score (DDS): 0.0
Top Committers
| Name | Commits | |
|---|---|---|
| Robert Fromont | r****t@f****z | 155 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 8 months ago
All Time
- Total issues: 3
- Total pull requests: 0
- Average time to close issues: 6 months
- Average time to close pull requests: N/A
- Total issue authors: 1
- Total pull request authors: 0
- Average comments per issue: 0.0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- robertfromont (3)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 121 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 20
- Total maintainers: 1
pypi.org: nzilbb-labbcat
Client library for communicating with LaBB-CAT servers
- Homepage: https://github.com/nzilbb/labbcat-py/
- Documentation: https://nzilbb-labbcat.readthedocs.io/
- License: GPL-3.0-or-later
-
Latest release: 1.0.0
published 8 months ago
Rankings
Maintainers (1)
Dependencies
- requests *