Skip to main content

google-asr-africa

Transcribe African-language speech with Google's free web ASR endpoint — but only for the languages where it actually works.

The free recognize_google endpoint silently falls back to English for languages it doesn't really support. You request wolof and get English "transcripts" that look like success. That is worse than silence: it poisons training data. This package ships a verified catalog of African languages whose transcripts genuinely come back in the target language, a resumable batched transcriber, and a probe that tests whether any new language code really works before you trust it.

Verified against real audio (JW.org clips) with three independent signals: transcribing under a bogus code (same output ⇒ the code does nothing), GlotLID (what language is the text actually in), and africa-g2p orthography coverage. See probe below.

Install

pip install google-asr-africa

Transcribe

# list the verified languages
google-asr-africa list-languages

# transcribe a folder of audio (resumable)
google-asr-africa transcribe data/amharic_clips --language amharic
# --rpm 50 by default (rate-limit the free endpoint); --ext .flac to pick
# wav/mp3; 0 = unlimited

The transcriber is concurrent, rate-limited and crash-safe: every clip's verdict is written the moment it's produced, so a rerun continues exactly where a stopped run left off and retries only transient API failures.

from google_asr_africa import transcribe_folder, support_code

tr = transcribe_folder('data/kirundi_clips', language='rn', rpm=50)
print(tr.stats)                       # {'ok':... 'unknown':... 'request':... 'error':...}
text = tr.transcripts['clip_00042.flac']

Language semantics

Statuses per clip:

  • ok — recognised in the requested language
  • unknown — no intelligible speech heard (a real, final answer; never retried)
  • request — API/network/rate-limit failure (transient; retried on rerun)
  • error — unreadable clip or unexpected failure (retried on rerun)

Verify a language before trusting it

# needs real audio with actual speech in the candidate language
google-asr-africa probe rg --audio my_kiraundi.wav
# SUPPORTED / UNSUPPORTED / REVIEW(<actual-language>)

It reports what the endpoint actually returns under the language's own code and under a bogus code. If both come back identical, the code does nothing. Then GlotLID and africa-g2p say whether the text is really in your language. Supported results can be added to languages.json and shipped.

Verified languages

20 African languages today (Amharic, Chichewa, Hausa, Igbo, Kinyarwanda, Kirundi, Ndebele, Oromo, Sepedi, Sesotho, Setswana, Shona, Swahili, Swati, Tsonga, Tigrinya, Twi, Venda, Xhosa, Yoruba, Zulu — 21 entries). Run list-languages for the full table.

Verification method, the catalog and the probe trade the same source of truth as the Africa Female Speech dataset pipeline that first pinned these languages down.

  • africaspeech-selector — audio selection for ASR/TTS from recorded African speech.
  • africa-g2p — orthography toolkit used by the probe's character-cover signal.

License

MIT — this license covers only the code in this repository (the thin wrapper around Google's speech endpoint: catalog, batch transcriber, probe). It does not license Google's ASR service or anything it produces.

Google's free web ASR endpoint is a Google service. Using it, and any transcripts/intermediate audio it returns, is subject to Google's Terms of Service and the terms of the endpoint you call (speech_recognition.recognize_google is the web demo endpoint, not the paid Cloud Speech-to-Text API). If your use needs a commercial SLA or a formal data-processing agreement, use Google Cloud Speech-to-Text instead and swap one line in transcribe.py.

Part of AfriSpeech — open-source tools for African language technology.

Metadata

Release files for google-asr-africa 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for google-asr-africa 0.1.0
File Size Uploaded Provenance
google_asr_africa-0.1.0.tar.gz 13.6 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for google-asr-africa 0.1.0
File Interpreter ABI Platform
google_asr_africa-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 28.0 kB

Release files / google_asr_africa-0.1.0.tar.gz

Download URL google_asr_africa-0.1.0.tar.gz
Size 13.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8dac3d3a56411b1d0c1acf26561417e8dc68063e421251c817da32cddcd7d3ec
BLAKE2b-256 checksum
How to use checksums
e142a0ea1c4a271f024a53e3a8ed9143a55cd0c92a1a0aac1164a7ce54d31cee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release files / google_asr_africa-0.1.0-py3-none-any.whl

Download URL google_asr_africa-0.1.0-py3-none-any.whl
Size 14.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bb093a63acf21c6a052db5b1c00752c64a163d3a5bf156f5d9ea2873ea43dd4e
BLAKE2b-256 checksum
How to use checksums
c5a2266899bdd92f8353c728b349d9bbace17c66aa84a1b3d911dc9bda65b6eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Security for google-asr-africa 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for google_asr_africa-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page