Cloud-based MP3 transcription CLI built on Google Speech-to-Text v2 (Chirp 2)
Project description
gcp-transcribe
Cloud-based MP3 transcription CLI built on Google Speech-to-Text v2 (Chirp 2). Submit a job, get a job ID back, then poll for status and fetch results when ready.
- Async batch workflow for long-form audio
- Multilingual via Chirp 2 (any BCP-47 language Chirp 2 supports)
- Outputs
.txt,.json, and optional.srt - Jobs survive across CLI invocations and reboots
Prerequisites
- Python 3.10+
- A Google Cloud account with billing enabled
- The
gcloudCLI installed locally
Set up Google Cloud
You can do this in the Google Cloud Console or entirely from the terminal. The CLI flow:
1. Create or select a project
# Create a new project
gcloud projects create <your-project-id> --name="Transcribe"
# Or pick an existing one
gcloud projects list
gcloud config set project <your-project-id>
2. Enable billing
A billing account must be linked to the project. List your billing accounts and link one:
gcloud billing accounts list
gcloud billing projects link <your-project-id> \
--billing-account=<billing-account-id>
(Or do this once in the Console under Billing → Link a billing account.)
3. Enable the required APIs
gcloud services enable \
speech.googleapis.com \
storage.googleapis.com \
--project=<your-project-id>
4. Authenticate
This tool uses Application Default Credentials, so you don't need a service-account key for local use:
gcloud auth application-default login
gcloud auth application-default set-quota-project <your-project-id>
The user account you log in with needs roles that allow Speech-to-Text recognition plus bucket and object management on the staging bucket. For personal use, Owner or Editor on the project is sufficient. For tighter scoping, the minimum is:
roles/speech.clientroles/storage.admin(orstorage.objectAdmin+storage.bucketAdminif you'd rather not grant full admin)
Running in CI or a server? Create a service account, grant the same roles, download a JSON key, and point
GOOGLE_APPLICATION_CREDENTIALSat it instead of runninggcloud auth ....
Install
pip install gcp-transcribe
Or from source:
git clone https://github.com/bengeos/gcp-transcribe.git
cd gcp-transcribe
pip install -e .
Configure
Create a .env file in your working directory (or export these as environment variables):
GCP_PROJECT_ID=your-gcp-project-id
GCP_REGION=us-central1
GCS_BUCKET=your-staging-bucket
DEFAULT_LANGUAGES=en-US
| Key | Default | Notes |
|---|---|---|
GCP_PROJECT_ID |
— | Required. |
GCP_REGION |
us-central1 |
Must be a Chirp 2-supported region. |
GCS_BUCKET |
<project-id>-transcription |
Auto-created on first run if it doesn't exist. |
DEFAULT_LANGUAGES |
en-US |
Comma-separated BCP-47 codes. |
Verify everything is wired up:
transcribe doctor
Usage
Submit a job
transcribe submit audio.mp3
# → prints a job ID
Multiple files in one job:
transcribe submit a.mp3 b.mp3 c.mp3
Override languages per call:
transcribe submit audio.mp3 -l en-US -l es-ES
Check status
transcribe status <job-id>
State is one of running, done, failed, fetched.
Fetch the transcript
transcribe result <job-id> --out ./transcripts
Adds subtitles:
transcribe result <job-id> --out ./transcripts --srt
GCS staging objects are deleted after a successful fetch. Use --keep-remote to retain them.
Other commands
transcribe list # all known jobs
transcribe forget <job-id> # remove a job from the local manifest
transcribe doctor # verify config + GCP auth
Costs
Chirp 2 batch transcription is roughly $0.016 per minute of audio. A 3-hour file ≈ $2.88.
Limitations
- No speaker diarization (not supported by Chirp 2 in batch mode).
- Each file is capped at the Speech-to-Text v2 batch limit (currently 8 hours per file).
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gcp_transcribe-0.1.1.tar.gz.
File metadata
- Download URL: gcp_transcribe-0.1.1.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
037bad4226c462678988fd187c1cd2b991611b919deed4f599832f8947a77b14
|
|
| MD5 |
e7975c4bf8a6e8c927aa7a78a2c68e1a
|
|
| BLAKE2b-256 |
5361e0dc98fc070faf3e79d11c40a5dca99664189bcda285bb529e7100f40cbe
|
Provenance
The following attestation bundles were made for gcp_transcribe-0.1.1.tar.gz:
Publisher:
publish.yml on bengeos/gcp-transcribe
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gcp_transcribe-0.1.1.tar.gz -
Subject digest:
037bad4226c462678988fd187c1cd2b991611b919deed4f599832f8947a77b14 - Sigstore transparency entry: 1382401344
- Sigstore integration time:
-
Permalink:
bengeos/gcp-transcribe@df46a11385145beec963dad2e4699e02474dbadb -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/bengeos
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@df46a11385145beec963dad2e4699e02474dbadb -
Trigger Event:
push
-
Statement type:
File details
Details for the file gcp_transcribe-0.1.1-py3-none-any.whl.
File metadata
- Download URL: gcp_transcribe-0.1.1-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0725aa8efccc3338a975ef075a9dbb892f232ea296a1826434f1ab3fc11544e6
|
|
| MD5 |
2bd0cdd6d4b1fedec267c1fc2241b199
|
|
| BLAKE2b-256 |
565b30777eab9fc77f0a58e61cbd123d4b55b50d06299452141cb63dbb2e59da
|
Provenance
The following attestation bundles were made for gcp_transcribe-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on bengeos/gcp-transcribe
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gcp_transcribe-0.1.1-py3-none-any.whl -
Subject digest:
0725aa8efccc3338a975ef075a9dbb892f232ea296a1826434f1ab3fc11544e6 - Sigstore transparency entry: 1382401441
- Sigstore integration time:
-
Permalink:
bengeos/gcp-transcribe@df46a11385145beec963dad2e4699e02474dbadb -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/bengeos
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@df46a11385145beec963dad2e4699e02474dbadb -
Trigger Event:
push
-
Statement type: