Metadata-Version: 2.1
Name: elevenlabslib
Version: 0.1.10
Summary: Complete python wrapper for the elevenlabs API
Author-email: lugia19 <lugia19@lugia19.com>
Project-URL: Homepage, https://github.com/lugia19/elevenlabslib
Project-URL: Bug Tracker, https://github.com/lugia19/elevenlabslib
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Development Status :: 3 - Alpha
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE

# elevenlabslib
Python wrapper for the full elevenlabs API.

# Installation

Just run `pip install elevenlabslib`, it's on pypi.

# Usage

Here is a very simple usage sample. 
- Retrieves a voice based on the name
- Plays back (using pydub) all its samples (and the preview) 
- Generates and plays back a new audio
- Deletes the newly created audio from the user history

```py
from elevenlabslib import *
import pydub
import pydub.playback
import io

#Playback function
def play(bytesData):
    sound = pydub.AudioSegment.from_file_using_temporary_files(io.BytesIO(bytesData))
    pydub.playback.play(sound)
    return

user = ElevenLabsUser("[API_KEY]")
voice = user.get_voices_by_name("Rachel")[0]  #This is a list because multiple voices can have the same name

play(voice.get_preview_bytes())

for sample in voice.get_samples():
    play(sample.get_audio_bytes())
    
play(voice.generate_audio_bytes("Test."))

for historyItem in user.get_history_items():
    if historyItem.text == "Test.":
        #The first items are the newest, so we can stop as soon as we find one.
        historyItem.delete()
        break
```

For a far more comprehensive example, check `example.py` on the github repo.
