Skip to main content

A Python package for audio transcription, synthesis, and tagging using Boto3.

Project description

CoAiAPy

CoAiAPy is a Python package that provides functionality for audio transcription, synthesis, and tagging of MP3 files using Boto3 and the Mutagen library. This package is designed to facilitate the processing of audio files for various applications.

Features

  • Audio Transcription: Convert audio files to text using AWS services.
  • Audio Synthesis: Generate audio files from text input.
  • MP3 Tagging: Add metadata tags to MP3 files for better organization and identification.
  • Redis Stashing: Stash key-value pairs to a Redis service.

Installation

To install the package, you can use pip:

pip install coaiapy

Usage

CLI Tool

CoAiAPy provides a CLI tool for audio transcription, summarization, and stashing to Redis.

Help

To see the available commands and options, use the --help flag:

coaia --help

Setup

Set these environment variables to use the AWS transcription service:

OPENAI_API_KEY
AWS_KEY_ID
AWS_SECRET_KEY
AWS_REGION
REDIS_HOST
REDIS_PORT
REDIS_PASSWORD
REDIS_SSL

Transcribe Audio

To transcribe an audio file to text:

coaia transcribe <file_path>

Example:

coaia transcribe path/to/audio/file.mp3

Summarize Text

To summarize a text:

coaia summarize <text>

Example:

coaia summarize "This is a long text that needs to be summarized."

To summarize text from a file:

coaia summarize --f <file_path>

Example:

coaia summarize --f path/to/text/file.txt

Stash Key-Value Pair to Redis

To stash a key-value pair to Redis:

coaia tash <key> <value>

Example:

coaia tash my_key "This is the value to stash."

To stash a key-value pair from a file:

coaia tash <key> --f <file_path>

Example:

coaia tash my_key --f path/to/value/file.txt

Fetch Value from Redis

To fetch a value from Redis by key:

coaia fetch <key>

Example:

coaia fetch my_key

To fetch a value from Redis and save it to a file:

coaia fetch <key> --output <file_path>

Example:

coaia fetch my_key --output path/to/output/file.txt

Process Custom Tags

Enable custom quick addons for assistants or bots using process tags. To add a new process tag to coaia.json, include entries like:

	"dictkore_temperature":0.2,
	"dictkore_instruction": "You do : Receive a dictated text that requires correction and clarification.\n\n# Corrections\n\n- In the dictated text, spoken corrections are made. You make them and remove the text related to that to keep the essence of what is discussed.\n\n# Output\n\n- You keep all the essence of the text (same length).\n- You keep the same style.\n- You ensure annotated dictation errors in the text are fixed.",
coaia p dictkore "my text to correct"

Building and Publishing

Use the provided Makefile to build and distribute the package. Typical tasks:

make build        # create sdist and wheel
make dist         # alias for make build
make upload-test  # upload the distribution to Test PyPI
make test-release # bump patch version, clean, build, and upload to Test PyPI

Both upload tasks use: twine upload --repository testpypi dist/* make test-release automatically sources $HOME/.env so TWINE_USERNAME and TWINE_PASSWORD are available. If you need the variables in your shell, run:

export $(grep -v '^#' $HOME/.env | xargs)

It also bumps the patch version using bump.py before uploading.

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

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

coaiapy-0.2.46.tar.gz (23.4 kB view details)

Uploaded Source

Built Distribution

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

coaiapy-0.2.46-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

File details

Details for the file coaiapy-0.2.46.tar.gz.

File metadata

  • Download URL: coaiapy-0.2.46.tar.gz
  • Upload date:
  • Size: 23.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for coaiapy-0.2.46.tar.gz
Algorithm Hash digest
SHA256 4778d5c300b4be12d3f83499cb9e56b54e9539c92f862462671d5d1799d14370
MD5 bd09da042f74029ca72a0b0a65368152
BLAKE2b-256 1393ea45ef69d3285c63da6ce78e97d9cf63c36399bb6f816ba12bbcd87434a3

See more details on using hashes here.

File details

Details for the file coaiapy-0.2.46-py3-none-any.whl.

File metadata

  • Download URL: coaiapy-0.2.46-py3-none-any.whl
  • Upload date:
  • Size: 22.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for coaiapy-0.2.46-py3-none-any.whl
Algorithm Hash digest
SHA256 7986cfc691619ce321b2ada575aad7a14f91078f30f8ec32313ad67f7ff0eb93
MD5 a627ce1516320d635f44bcde96b8f742
BLAKE2b-256 7e3b0cfcb924d7d13fe08d5293c03c40386b10b340e52851b5ee1d601f58e0a7

See more details on using hashes here.

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