Skip to main content

Pinch Python SDK for real-time speech translation

Project description

Pinch Python SDK

Real-time speech translation.

Requirements

Quick Start (uv recommended)

git clone https://github.com/pinch/pinch-python.git
cd pinch-python
export PINCH_API_KEY="your_key_here"
uv run python examples/translate.py

Install from PyPI

pip install pinch-sdk

Or with uv:

uv add pinch-sdk

Usage

import asyncio
from pinch import translate_file

async def main():
    await translate_file(
        input_wav_path="input.wav",
        output_wav_path="output.wav",
        transcript_path="transcript.txt",
        # source_language="en-US",  # default
        # target_language="es-ES",  # default
    )

asyncio.run(main())

API Key

Set PINCH_API_KEY as an environment variable:

export PINCH_API_KEY="your_key_here"

Or create a .env file in your project directory:

PINCH_API_KEY=your_key_here

Audio Requirements

  • Input must be 16-bit PCM WAV
  • Supported sample rates: 16000 Hz and 48000 Hz
  • Other sample rates require: pip install "pinch-sdk[audio]"

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pinch_sdk-0.1.0.tar.gz (205.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pinch_sdk-0.1.0-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file pinch_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: pinch_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 205.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pinch_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 180577ff1c22cecf704459f348728bff27c12944327ec0e2f5c3abeba975de34
MD5 d2f20c38f91a213c94c032c02c325ff6
BLAKE2b-256 aa7c87497dd078d721e2a378d41dc0dacf07bc7408e5ac05d2800a7282df9e00

See more details on using hashes here.

Provenance

The following attestation bundles were made for pinch_sdk-0.1.0.tar.gz:

Publisher: publish.yml on pinch-eng/pinch-python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pinch_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pinch_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pinch_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 056f12812ce5b9991db5fa8798876f51192c377fd7df81cf0936c14d42f08c6a
MD5 2e7491f6972552092c2db3b97fde99e6
BLAKE2b-256 c66a81f712c8f3f7ae43f93134346e7967d312abefb70a95b16288eb5d6bfd06

See more details on using hashes here.

Provenance

The following attestation bundles were made for pinch_sdk-0.1.0-py3-none-any.whl:

Publisher: publish.yml on pinch-eng/pinch-python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page