Python SDK for the Beatlyze audio analysis API.
Project description
beatlyze
Python SDK for the Beatlyze audio analysis API.
Install
pip install beatlyze
Quick start
from beatlyze import Beatlyze
bz = Beatlyze("bz_your_api_key")
# Analyze from URL (blocks until complete)
result = bz.analyze_url("https://example.com/track.mp3")
print(result["bpm"]) # 128.4
print(result["key"]) # "A"
print(result["energy"]) # 0.78
# Analyze a local file
result = bz.analyze_file("./my-track.wav")
# Async: submit without waiting
job = bz.analyze_url("https://example.com/track.mp3", wait=False)
print(job["job_id"]) # check later with bz.get_analysis(job["job_id"])
# Batch (up to 10 URLs)
jobs = bz.analyze_batch([
"https://example.com/a.mp3",
"https://example.com/b.mp3",
])
# Check usage
usage = bz.get_usage()
print(f"{usage['count']}/{usage['limit']} analyses used this month")
The SDK targets the live production API at https://api.beatlyze.dev by default.
Result fields
| Field | Type | Description |
|---|---|---|
bpm |
float | Tempo in beats per minute |
key |
str | Musical key (e.g. "A") |
scale |
str | "major" or "minor" |
key_notation |
str | Combined (e.g. "Am") |
energy |
float | 0.0 - 1.0 |
danceability |
float | 0.0 - 1.0 |
valence |
float | 0.0 - 1.0 (mood) |
loudness_lufs |
float | Integrated loudness |
duration_seconds |
float | Track duration |
mood_tags |
list[str] | e.g. ["energetic", "dark"] |
genre_suggestions |
list[str] | e.g. ["techno", "house"] |
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
beatlyze-0.1.1.tar.gz
(4.2 kB
view details)
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 beatlyze-0.1.1.tar.gz.
File metadata
- Download URL: beatlyze-0.1.1.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62817aada48199704c706761fb23932698987693d9098e29990810de4ccaabe4
|
|
| MD5 |
0caa14059cb23379e46e11348e10526d
|
|
| BLAKE2b-256 |
15862dfefbb9d19949e2676393776e88b4dc375512786548627604b5bb292006
|
File details
Details for the file beatlyze-0.1.1-py3-none-any.whl.
File metadata
- Download URL: beatlyze-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2fdd12d2569ee3757dccae461738b6e60293e87a09a6c480e88436c9ce1fb179
|
|
| MD5 |
2a89126cfd582145f375c63a9f09a132
|
|
| BLAKE2b-256 |
a6c8b673f69ac72d77c9f6f6ddc7fd7d5a989235b61d8e58a7704481cc711a65
|