Skip to main content

Includes:

  • Serato track tag parsing and modification, including cue points, track color, beatgrid, waveform, autogain, etc.
  • Serato library database parsing and modification
  • Serato crate parsing and modification
  • Serato smart crate parsing and rule modification
  • Serato crate order reading and modification
  • Dynamic beatgrid analysis that can be saved to a track's beatgrid.
  • Serato USB export that beats Serato's sync by putting all files in 1 folder (without duplicates) and only copying changed files, unlike Serato's sync which takes forever and creates many duplicate file locations

Contents

Example uses:

USB:

  • Export crates (including Smart Crates) to USB. Beats Serato's sync by keeping all files in 1 folder and by comparing files for changes (instead of always copying, like Serato does)

Tracks:

  • Change hot cue's text (i.e. change to all caps; change "c" to "CHORUS", etc.)
  • Set a hot cue's text based on its color (i.e. if RED, set to "EXIT")
  • Set a track's color (i.e. if has hot cues, change to BLUE); see Setting track color to set it in the database too
  • Set a piece of metadata due to a track's color (i.e. if track is green, set "grouping" to "TAGGED") (this is useful since can't create smart crates by track color in Serato)
  • Analyze a track's Dynamic Beatgrid and save it to the beatgrid Serato tag.
  • Snap cue points to the nearest beat with a configurable tolerance (e.g. 1/16, 1/8, 1/4 of a beat).

Library:

  • Rename or delete a track file while updating the database, crates, and smart crates as well, so that it doesn't go missing.
  • Set a track's color, beatgrid lock, or metadata (title, artist, grouping, ...) in its tags and the database at once, so Serato shows it right away.

Database:

  • After changing a track's metadata, modify database values for a specific track so that you don't have to "Reload Id3 Tags" in Serato, the change appears in Serato instantly.
  • List the tracks Serato marked corrupt, and why.

Crate:

  • Read a crate's tracks
  • Remove a track from a crate
  • Add a track to a crate
  • List available crates

Smart Crate:

  • Read a smart crate's tracks and rules
  • Modify a smart crate's rules
  • List available smart crates

Installation

Currently designed for Python 3.12+. If you would like backwards compatibility with an older version, please reach out!

pip install serato-tools

That alone covers crates, smart crates, the library database, and USB export. The rest of the features need extra packages, installed through the matching extra:

Extra Install Adds
track_tags pip install "serato-tools[track_tags]" Getting/modifying track metadata: tags, cue points, beatgrid, and waveform (installs mutagen)
waveform_drawing pip install "serato-tools[waveform_drawing]" Viewing a track's waveform (installs mutagen and pillow)
beatgrid_analysis pip install "serato-tools[beatgrid_analysis]" Beatgrid analysis (installs mutagen, librosa, and numpy)
all pip install "serato-tools[all]" Everything above

Examples

Renaming or removing track files across the library

Library changes a track file and every place Serato points to it: the database, crates, and smart crates, so the track isn't left missing in Serato.

It's also the fastest way for an app to work with the library, since each file is parsed only the first time it's needed, then kept, instead of re-parsing the whole library per change. Use library.database for other database changes too (like modifying the database file), and keep one Library and reuse it, since another copy's save would overwrite this one's changes.

NOTE: Close Serato first. It keeps the library in memory, and saves it over any changes made while it's open. A script can check with serato_is_running(), from serato_tools.utils.serato_process.

from serato_tools.library import Library

library = Library()  # or Library("/Volumes/USB") for the library on another drive
library.rename_track_file(
    src="/Users/Username/Music/Dubstep/Raaket - ILL - Original Mix.mp3",
    dest="/Users/Username/Music/Dubstep/Raaket - ILL.mp3",
)
library.remove_track_files(["/Users/Username/Music/Dubstep/Raaket - ILL (Radio Edit).mp3"], delete_files=True)

Each of those writes the library files that contain the track, and delete_files=True deletes the track's stems files too.

For many changes, put them in a batch(), which writes each changed file once, when the block ends. The track files themselves still change right away, so the library is saved even if the block raises:

with library.batch():
    for src, dest in renames:
        library.rename_track_file(src, dest)

To save changes made through library.database's or the crates' own methods, such as modify, call library.save(), which writes each file that changed.

Modifying the database file

NOTE: Close Serato first. It keeps the library in memory, and saves it over any changes made while it's open. A script can check with serato_is_running(), from serato_tools.utils.serato_process.

import time
from typing import Any

from serato_tools.database_v2 import DatabaseV2

now = int(time.time())
files_set_date = ["/Users/Username/Music/Dubstep/Raaket - ILL.mp3"]


def modify_uadd(filename: str, prev_val: Any):
    print(f'Serato library change - Changed "date added" to today: {filename}')
    return now


def modify_tadd(filename: str, prev_val: Any):
    return str(now)


def remove_group(filename: str, prev_val: Any):
    return " "


db = DatabaseV2()
# the available fields are in DatabaseV2.Fields
db.modify_and_save(
    rules=[
        {"field": DatabaseV2.Fields.DATE_ADDED_U, "files": files_set_date, "func": modify_uadd},
        {"field": DatabaseV2.Fields.DATE_ADDED_T, "files": files_set_date, "func": modify_tadd},
        {"field": DatabaseV2.Fields.GROUPING, "func": remove_group},  # all files
    ]
)

Listing corrupt tracks

>>> python -m serato_tools.database_v2 --list_corrupt
/Users/Username/Music/Dubstep/Raaket - ILL.mp3: Corrupt file: This file contains invalid audio data

Or DatabaseV2().get_corrupt_tracks(), which returns each track's full path with its reason.

Having Serato analyze tracks again

For a track whose audio changed, since Serato otherwise keeps its old waveform and beatgrid. Close Serato first, then run Analyze Files once it's open again.

from serato_tools.library import Library

# deletes the waveform, beatgrid, autotags, and gain from each file, and marks each not yet analyzed in the database.
# A locked beatgrid raises ValueError, unless include_locked=True, which unlocks it
Library().delete_analysis(["/Users/Username/Music/Dubstep/Raaket - ILL.mp3"])

DatabaseV2.set_unanalyzed works as well to trigger re-analysis, but only marks them in the database, leaving the files as they are until Serato analyzes them. A file that keeps its beatgrid keeps it only if Serato's "Set Beatgrid" analysis setting is off, which applies when it analyzes a track on load too.

Exporting crates to USB

NOTE: replaces the crate files already on the drive! The rest of the drive's _Serato_ folder, such as its History, is kept, as are the track files already on it.

>>> serato_usb_export --drive E --crate_matcher "*house*" "*techno*" --root_crate="Dave USB"

On macOS, pass the drive's folder, e.g. --drive /Volumes/USB.

Every track goes in the drive's Tracks folder, copied only when it's changed. A track whose filename another track already has goes in a subfolder named after its own folder.

Analyzing and setting a dynamic beatgrid

Rekordbox has Dynamic Beatgrid Analysis but Serato doesn't. This analyzes a non-consistent BPM across a track, such as a track with live drums, and snaps a beatgrid marker to each beat.

NOTE: This feature has only been tested on a couple of tracks. Recommend reviewing the resulting beatgrid in Serato— some grid markers may require adjustment. It seems to be working pretty great though!

>>> serato_analyze_beatgrid "/Users/Username/Music/Dubstep/Raaket - ILL.mp3"

Changing several of a track's tags at once

Track opens the file once and parses its Serato tags; save() then writes all of your changes in a single write, instead of rewriting the whole file once per tag:

from serato_tools.track import Track
from serato_tools.track_cues_v2 import TrackCuesV2

track = Track("/Users/Username/Music/Dubstep/Raaket - ILL.mp3")
track.set_track_color(TrackCuesV2.TrackColors.PURPLE)  # Serato stores it in cues_v2
track.autotags.set(bpm=128)
track.gain.set(gain=-2.5)
track.save()  # one write; returns False, without writing, if nothing changed

Its tags are cues_v2, cues_v1, beatgrid, autotags, waveform, and gain: the same classes as below, so use their own methods to change them, and Track.save() rather than theirs. Each is parsed unless you pass it False, except waveform, which you pass True to parse; a tag that isn't parsed isn't saved either:

track = Track("/Users/Username/Music/Dubstep/Raaket - ILL.mp3", cues_v1=False, beatgrid=False, waveform=True)

Setting track color

Set a track's color, or lock its beatgrid, with Library, which sets it in both the track file's tags and the library database. Serato shows the database, and only reads a file's tags again when the track is loaded or on "Rescan File Tags", so changing only one of the two leaves Serato showing a stale value, or the file losing the change. Close Serato first.

from serato_tools.library import Library
from serato_tools.track_cues_v2 import TrackCuesV2

library = Library()
library.set_db_track_tags(
    "/Users/Username/Music/Dubstep/Raaket - ILL.mp3",
    color=TrackCuesV2.TrackColors.PURPLE,
    beatgrid_locked=True,
    # delete_tags_v1 (the default) deletes the legacy "Serato Markers_" tag, since a stale one stops the new color from appearing in Serato. No issues have been found from deleting it, but use caution with versions of Serato before 3, which may still read it.
    delete_tags_v1=True,
)
# many tracks at once, saving the database only once
library.set_db_tracks_tags(
    {
        "/Users/Username/Music/Dubstep/Raaket - ILL.mp3": {"color": TrackCuesV2.TrackColors.PURPLE},
        "/Users/Username/Music/Dubstep/Other.mp3": {"color": TrackCuesV2.TrackColors.BLUE1, "beatgrid_locked": False},
    }
)
# both return whether the database changed, and which track files were written
result = library.set_db_track_tags(
    "/Users/Username/Music/Dubstep/Raaket - ILL.mp3", color=TrackCuesV2.TrackColors.PURPLE
)
result.database_changed, result.files_written

The same goes for a track's metadata, which Serato keeps both in the file's ID3 text frames and in the database: title, artist, album, genre, key, grouping, publisher, composer, year, remixer, track_number, disc_number, and comment. An empty value removes it, as clearing it in Serato does.

library.set_db_track_tags("/Users/Username/Music/Dubstep/Raaket - ILL.mp3", grouping="TAGGED", genre="Dubstep")

Only ID3 files (.mp3, .aiff, .aif) are currently supported. A track Serato hasn't analyzed yet gets the color or lock added to its tags, as Serato writes them.

Inside a library.batch() (see above), the database is written when the batch ends, along with any renames or removals in it, rather than once per call.

Avoid Track.set_track_color / set_beatgrid_locked (or TrackCuesV2's), or DatabaseV2.modify on the COLOR / BEATGRID_LOCKED fields, on their own, since each changes only one of the two.

Snapping cue positions to the beatgrid

After you have a good beatgrid (including dynamic beatgrids), you can snap cue positions so they land exactly on beats, within a configurable tolerance:

serato_snap_cues_v2 "/Users/Username/Music/Dubstep/Raaket - ILL.mp3" --snap_cues --snap_tolerance 1/16
  • --snap_cues enables snapping for all cue entries in the Serato Markers2 tag.
  • --snap_tolerance is a fraction of a beat (e.g. 1/16, 1/8, 1/4) that a cue point can come within a beat in order to "snap" to it.

Only cue points within the tolerance window of some beat are moved; others are left unchanged.

In Python, use Track.snap_cues_to_beats, which reads the track's Serato Markers2 and Serato BeatGrid tags, so needs cues_v2 and beatgrid parsed (the default):

from serato_tools.track import Track

track = Track("/Users/Username/Music/Dubstep/Raaket - ILL.mp3", cues_v1=False, autotags=False, gain=False)
for snapped in track.snap_cues_to_beats(tolerance_beats=1 / 16):
    print(f"cue {snapped.index + 1}: {snapped.old_position} ms -> {snapped.new_position} ms")
track.save()

Track.snap_cues_to_beats is TrackCuesV2.snap_cues_to_beats(beatgrid, tolerance_beats) with the track's own beatgrid, which you can also call directly with a TrackBeatgrid read from the same file. track.beatgrid.get_snapped_position (TrackBeatgrid.get_snapped_position) gives the position a single cue would snap to.

Modifying track metadata / hot cues

import dataclasses
from mutagen.id3._frames import TIT1
from serato_tools.track_cues_v2 import TrackCuesV2

CueColors = TrackCuesV2.CueColors
TrackColors = TrackCuesV2.TrackColors

tags = TrackCuesV2("/Users/Username/Music/Dubstep/Raaket - ILL.mp3")


def track_rule(track: TrackCuesV2.TrackCuesInfo) -> TrackCuesV2.TrackCuesInfo | None:
    # Set ID3 grouping field from track color
    if track.color is not None:
        track_color = track.color.color
        if track_color == TrackColors.LIMEGREEN3.value:
            tags.tagfile.tags.setall("TIT1", [TIT1(text="TAGGED")])
        elif track_color in [TrackColors.WHITE.value, TrackColors.GREY.value, TrackColors.BLACK.value]:
            tags.tagfile.tags.setall("TIT1", [TIT1(text="UNTAGGED")])

    # Normalize cue colors and names
    new_cues = []
    for c in track.cues:
        # Make "close to red", red.
        cue_color = CueColors.RED.value if c.color in [CueColors.PINKRED.value, CueColors.MAGENTA.value] else c.color
        # Make all cuenames all-caps
        cue_name = c.name.strip().upper()

        new_cues.append(dataclasses.replace(c, color=cue_color, name=cue_name))
    new_track = dataclasses.replace(track, cues=new_cues)
    return new_track if new_track != track else None


tags.modify_entries(track_rule)
# delete_tags_v1 (the default) deletes the legacy "Serato Markers_" tag, since a stale one stops changes from appearing in Serato.
# save() writes only when the cues changed, so the Grouping set on tags.tagfile above is saved here otherwise
if not tags.save(delete_tags_v1=True):
    tags.tagfile.save()

Listing available crates or smart crates

from serato_tools.crate import Crate

print("\n".join(Crate.get_crate_files()))

from serato_tools.smart_crate import SmartCrate

print("\n".join(SmartCrate.get_crate_files()))

Modifying a SmartCrate Rule

via command line

Each rule field is its own option, such as --grouping or --bpm, which takes a comparison and a value, or DELETE to remove the rule. The available comparisons are the SmartCrate.RuleComparison names, lowercase: str_contains, str_is, int_is_ge, etc. serato_smartcrate --help lists the fields and comparisons.

one crate

>>> serato_smartcrate '/Users/Username/Music/_Serato_/SmartCrates/Dubstep.scrate' --grouping str_is UNTAGGED --year DELETE

all crates

>>> serato_smartcrate --all --grouping str_is UNTAGGED

via code

from serato_tools.smart_crate import SmartCrate

crate = SmartCrate("/Users/Username/Music/_Serato_/SmartCrates/Dubstep.scrate")

# updates the rule on this field, or adds the rule if the crate doesn't have one for it.
# the value is stored in the value field the comparison expects, just like Serato does.
crate.set_rule(SmartCrate.RuleField.GROUPING, SmartCrate.RuleComparison.STR_IS, "UNTAGGED")
crate.save()

Crate details and adding a track

from serato_tools.crate import Crate

crate = Crate("/Users/Username/Music/_Serato_/Subcrates/Dubstep.crate")

crate.print_track_paths()
# /Users/Username/Music/Dubstep/Saka - backitup.mp3
# /Users/Username/Music/Dubstep/Mind Splitter - YAPPIN'.mp3
# /Users/Username/Music/Dubstep/Flozone - DO IT.mp3
# /Users/Username/Music/Dubstep/Evalution - Throw It Back.mp3
# ...

print(crate)  # or crate.print()
# vrsn (Version): 1.0/Serato ScratchLive Crate
# osrt (Sorting): [ tvcn (Column Name): key ], [ brev (Reverse Order): False ]
# ovct (Column): [ tvcn (Column Name): song ], [ tvcw (Column Width): 0 ]
# ovct (Column): [ tvcn (Column Name): artist ], [ tvcw (Column Width): 0 ]
# ovct (Column): [ tvcn (Column Name): bpm ], [ tvcw (Column Width): 0 ]
# ovct (Column): [ tvcn (Column Name): playCount ], [ tvcw (Column Width): 0 ]
# otrk (Track): [ ptrk (Track Path): Music/Dubstep/Flozone - Candy Paint.mp3 ]
# otrk (Track): [ ptrk (Track Path): Music/Dubstep/Mind Splitter - LISTEN TO ME.mp3 ]
# otrk (Track): [ ptrk (Track Path): Music/Dubstep/Flozone - DO IT.mp3 ]
# ...


# Example: Add tracks to the crate and save it as a new crate
crate.add_tracks(["/Users/Username/Music/Dubstep/Raaket - ILL.mp3"])
crate.save("/Users/Username/Music/_Serato_/Subcrates/New Crate.crate")

# Example: Start an empty crate (Crate("...") raises FileNotFoundError for a file that doesn't exist)
empty = Crate.new("/Users/Username/Music/_Serato_/Subcrates/Empty Crate.crate")
empty.add_tracks(["/Users/Username/Music/Dubstep/Raaket - ILL.mp3"])
empty.save()

Smart Crate details

from serato_tools.smart_crate import SmartCrate

s_crate = SmartCrate("/Users/Username/Music/_Serato_/SmartCrates/Dubstep.scrate")
print(s_crate)

Reordering crates

CrateOrder reads and writes Serato's crate order file, neworder.pref. Its crates lists the crates and smart crates in the order Serato shows them, each name including its parents': %% (Crate.SUBCRATE_SEPARATOR) separates a regular crate's (e.g. Bass%%DnB), ≫≫ (SmartCrate.SUBCRATE_SEPARATOR) a smart crate's. split_crate_name (serato_tools.library) splits either kind's name into its parts (["Bass", "DnB"]).

from serato_tools.library import split_crate_name
from serato_tools.pref_files import CrateOrder

order = CrateOrder()  # the default library's; or pass a path
# sorted by each name's parts, so a crate's subcrates stay right after it
order.crates.sort(key=lambda name: split_crate_name(name.casefold()))
order.save()  # or save(path) to write it elsewhere

CollapsedCrates reads and writes which crates Serato's sidebar shows collapsed, collapsed.pref, the same way: change its crates and save().

To check them, serato_pref_files prints the library's crate order and collapsed crates.

Track Tags

Original writeup on Serato GEOB tag discoveries: blog post

GEOB Tag Contents Script File
Serato Analysis Serato version information
Serato Autotags BPM and Gain values track_autotags.py
Serato BeatGrid Beatgrid Markers track_beatgrid.py
Serato Markers2 Hotcues, Saved Loops, etc.
(The main one used in newer versions of Serato)
track_cues_v2.py
Serato Markers_ Hotcues, Saved Loops, etc.
(Old, not used in newer versions of Serato)
track_cues_v1.py
Serato Overview Waveform data track_waveform.py
Serato Offsets_ ??? -

What's still unknown in these formats — including the rare, mostly undecoded Serato Offsets_ tag — is collected in docs/MYSTERIES.md.

The different file/tag formats that Serato uses to store the information are documented in docs/fileformats.md, a script to dump the tag data can be found at track_tagdump.py.

Sources

Contributing

If you want a new feature, or have a bug fix, please put in a PR! For anything bigger, or if you're not sure about an approach, feel free to open an issue to discuss it first.

Please contribute here rather than publishing your own fork. One maintained package keeps fixes and format discoveries in one place, instead of splitting them across copies that drift apart.

License

MIT: free to use, modify, and include in your own projects, personal or commercial.

Metadata

Release files for serato-tools 6.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for serato-tools 6.3.0
File Size Uploaded Provenance Actions
serato_tools-6.3.0.tar.gz 130.1 kB With provenance Details for serato_tools-6.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for serato-tools 6.3.0
File Interpreter ABI Platform Actions
serato_tools-6.3.0-py3-none-any.whl Python 3 none any Details for serato_tools-6.3.0-py3-none-any.whl

Total release size: 222.2 kB

Release files / serato_tools-6.3.0.tar.gz

Download URL serato_tools-6.3.0.tar.gz
Size 130.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2aa6508adb7b8ec0ddcba3f363cf81f6865b1fba8a47109fb1870ac1542a6f0d
BLAKE2b-256 checksum
How to use checksums
2a570e7b1b83be3f7952e1190efe84cea88b7187f09c5d5697bf28f66e873352
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.

Transparency log

Release files / serato_tools-6.3.0-py3-none-any.whl

Download URL serato_tools-6.3.0-py3-none-any.whl
Size 92.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
22d3f8e2dec6283d6b76701362cae0546dd7fb8523756745dc5b2fae62d54e48
BLAKE2b-256 checksum
How to use checksums
8a9e8733ce27a3af366b05a433f3b0e9cecbda5250af31c9865337defa4d80ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.

Transparency log

Security for serato-tools 6.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for serato_tools-6.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

6.3.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page