pyrekordbox.config#

Configuration handling for pyrekordbox.

Contains all the path and settings handling of the Rekordbox installation(s) on the users machine.

exception pyrekordbox.config.InvalidApplicationDirname[source]#

Bases: Exception

pyrekordbox.config.get_pioneer_install_dir(path=None)[source]#

Returns the path of the Pioneer program installation directory.

On Windows, the Pioneer program data is stored in /ProgramFiles/Pioneer. For rekordbox version 7 this has changed to /ProgramFiles/rekordbox. On macOS the program data is somewhere in /Applications/.

Parameters:
pathstr or Path, optional

If a path is given it will only be checked for validity. Otherwise, the default Pioneer directory will be constructed and checked.

Returns:
pioneer_pathPath

The path to the Pioneer program installation data.

pyrekordbox.config.get_pioneer_app_dir(path=None)[source]#

Returns the path of the Pioneer application data directory.

On Windows, the Pioneer application data is stored in /Users/user/AppData/Roaming On macOS the application data is somewhere in ~/Libary/Application Support.

Parameters:
pathstr or Path, optional

If a path is given it will only be checked for validity. Otherwise, the default Pioneer directory will be constructed and checked.

Returns:
pioneer_pathPath

The path to the Pioneer application data.

pyrekordbox.config.read_rekordbox_settings(rekordbox_app_dir)[source]#

Finds and parses the ‘rekordbox3.settings’ file in the Rekordbox 5 or 6 app-dir.

The settings file usually is called ‘rekordbox3.settings’ and is located in the application data directory of the corresponding Rekordbox (major) version.

Parameters:
rekordbox_app_dirstr or Path

The path of the application-data directory of Rekordbox 5 or 6.

Returns:
settingsdict

The parsed Rekordbox settings data.

pyrekordbox.config.read_rekordbox6_options(pioneer_app_dir)[source]#

Finds and parses the Rekordbox 6 options.json file with additional settings.

The options file contains additional settings used by Rekordbox 6, for example the path of the new master.db database. It also contains some data nedded to open the database, which is encrypted using SQLCipher.

Parameters:
pioneer_app_dirstr or Path, optional

The path of the Pioneer application data.

Returns:
optionsdict

The parsed rekordbox 6 options data.

pyrekordbox.config.update_config(pioneer_install_dir=None, pioneer_app_dir=None, rb5_install_dirname='', rb6_install_dirname='', rb7_install_dirname='')[source]#

Update the pyrekordbox configuration.

This method scans the system for the Rekordbox installation and application data directories and extracts the reuired file locations. For this the default Pioneer directories (installation and application data) are used. If the method fails to find the directories they can be supplied as parameters. If no Rekordbox installation is found the fileds are left unchanged. On import configuration with the default locations is loaded.

Parameters:
pioneer_install_dirstr or Path, optional

The path to the Pioneer installation directory. This is where the program files of Pioneer applications are stored. By default, the normal location of Pioneer programs is used.

pioneer_app_dirstr or Path, optional

The path to the Pioneer application directory. This is where the application user data of Pioneer programs is stored. By default, the normal location of the Pioneer application data is used.

rb5_install_dirnamestr, optional

The name of the Rekordbox 5 installation directory. By default, the normal directory name is used (Windows: ‘rekordbox 5.x.x’, macOS: ‘rekordbox 5.app’).

rb6_install_dirnamestr, optional

The name of the Rekordbox 6 installation directory. By default, the normal directory name is used (Windows: ‘rekordbox 6.x.x’, macOS: ‘rekordbox 6.app’).

rb7_install_dirnamestr, optional

The name of the Rekordbox 7 installation directory. By default, the normal directory name is used (Windows: ‘rekordbox 7.x.x’, macOS: ‘rekordbox 7.app’).

pyrekordbox.config.get_config(section, key=None)[source]#

Gets a section or value of the pyrekordbox configuration.

Parameters:
sectionstr

The name of the section.

keystr, optional

The name of the specific value to return. If not given all values of the section are returned as dictionary.

Returns:
datastr or Path or dict

The data of a section or a specific configuration value.

pyrekordbox.config.pformat_config(indent='   ', hw=14, delim=' = ')[source]#

Returns a formatted string of the pyrekordbox configurations.

pyrekordbox.config.show_config()[source]#

Prints a formatted string of the pyrekordbox configurations.