Skip to main content

PySerato API.

Project description

pyserato

Programatically create crates in Serato.

Example use using the DEFAULT_SERATO_FOLDER. This can be overwritten to a non default location by passing the desired root in to the builder.save() API.

from pathlib import Path
from pyserato.crate import DEFAULT_SERATO_FOLDER, Crate, Builder

def list_crates_sync(serato_folder: Path = DEFAULT_SERATO_FOLDER) -> list[Crate]:
    all_crates = []
    subcrates_folder = serato_folder / "SubCrates"
    crates = [
        Crate(name.stem) for name in subcrates_folder.glob("*.crate")
    ]
    all_crates.extend(crates)
    return all_crates

if __name__ == '__main__':
    crates = list_crates_sync()
    print(crates)
    
    child_crate3 = Crate('child3')
    child_crate3.add_song("/Users/lukepurnell/nav_music/Laker/Noise From The Ruliad/00 Cloud Formation.mp3")
    child_crate = Crate('child1', children=[child_crate3])
    child_crate.add_song("/Users/lukepurnell/nav_music/Russian Circles/Gnosis/01 Tupilak.wav")
    child_crate2 = Crate('child2')
    child_crate2.add_song("/Users/lukepurnell/nav_music/Laker/Noise From The Ruliad/00 Entropy Increasing.mp3")
    child_crate.add_song("/Users/lukepurnell/nav_music/Laker/Noise From The Ruliad/00 Cloud Formation.mp3")
    root_crate = Crate('root', children=[child_crate, child_crate2])
    builder = Builder()
    builder.save(root_crate)

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

pyserato-0.0.1.tar.gz (16.5 kB view hashes)

Uploaded Source

Built Distribution

pyserato-0.0.1-py3-none-any.whl (15.6 kB view hashes)

Uploaded Python 3

Supported by

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