Skip to content

Repository files navigation

uploadkit-audio

CI Coverage Python

Audio validators, policies, and metadata for UploadKit.

What problem does this solve?

Codec, duration, and structural checks for audio uploads that plug into UploadPolicy.validators without modifying UploadKit Core.

When to use it

Use for MP3, WAV, FLAC, OGG/Opus, M4A/AAC, and WebM audio uploads.

When not to use it

  • Do not transcode, normalize, or generate waveforms here.
  • Do not put generic MIME/filename checks here (see uploadkit-security).

Installation

Requires Python 3.10+.

pip install uploadkit-audio

Quick Start

from uploadkit import Uploader
from uploadkit_audio import AudioPolicy

uploader = Uploader(
    AudioPolicy(max_duration_sec=600, allowed_codecs=frozenset({"mp3", "wav"})),
    storage=my_storage,
)

Public API

Symbol Kind
AudioPolicy Public
AudioMetadata / inspect_audio Public
AudioStructureValidator / AudioCodecValidator / AudioLimitsValidator Public
default_audio_validators / default_async_audio_validators Public
Async validator equivalents Public

Coverage

The coverage badge is a measured total from coverage report --include='src/*', not an aspirational 100%. CI enforces --fail-under=80.

Most of the gap is defensive and format-variant code in metadata.py (non-WAV codecs, mutagen edge cases). Validators and policies are largely covered. Unlike Core / framework adapters, this package does not claim 100% yet — fixtures for those branches are welcome.

Changelog

See CHANGELOG.md.

Contributing

See CONTRIBUTING.md.

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages