pyrekordbox 0.3.2__py3-none-any.whl → 0.4.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. pyrekordbox/__init__.py +8 -8
  2. pyrekordbox/__main__.py +3 -2
  3. pyrekordbox/_version.py +2 -2
  4. pyrekordbox/anlz/__init__.py +3 -2
  5. pyrekordbox/anlz/file.py +4 -2
  6. pyrekordbox/anlz/tags.py +3 -1
  7. pyrekordbox/config.py +79 -23
  8. pyrekordbox/db6/__init__.py +2 -2
  9. pyrekordbox/db6/aux_files.py +3 -2
  10. pyrekordbox/db6/database.py +101 -111
  11. pyrekordbox/db6/registry.py +1 -0
  12. pyrekordbox/db6/smartlist.py +7 -6
  13. pyrekordbox/db6/tables.py +44 -16
  14. pyrekordbox/logger.py +0 -1
  15. pyrekordbox/mysettings/__init__.py +5 -4
  16. pyrekordbox/mysettings/file.py +3 -1
  17. pyrekordbox/rbxml.py +5 -3
  18. pyrekordbox/utils.py +4 -3
  19. {pyrekordbox-0.3.2.dist-info → pyrekordbox-0.4.0.dist-info}/METADATA +21 -41
  20. pyrekordbox-0.4.0.dist-info/RECORD +25 -0
  21. {pyrekordbox-0.3.2.dist-info → pyrekordbox-0.4.0.dist-info}/WHEEL +1 -1
  22. {pyrekordbox-0.3.2.dist-info → pyrekordbox-0.4.0.dist-info}/top_level.txt +0 -2
  23. docs/Makefile +0 -20
  24. docs/make.bat +0 -35
  25. docs/source/_static/images/anlz_beat.svg +0 -53
  26. docs/source/_static/images/anlz_file.svg +0 -204
  27. docs/source/_static/images/anlz_pco2.svg +0 -138
  28. docs/source/_static/images/anlz_pcob.svg +0 -148
  29. docs/source/_static/images/anlz_pcp2.svg +0 -398
  30. docs/source/_static/images/anlz_pcpt.svg +0 -263
  31. docs/source/_static/images/anlz_ppth.svg +0 -123
  32. docs/source/_static/images/anlz_pqt2.svg +0 -324
  33. docs/source/_static/images/anlz_pqt2_2.svg +0 -253
  34. docs/source/_static/images/anlz_pqtz.svg +0 -140
  35. docs/source/_static/images/anlz_pssi.svg +0 -192
  36. docs/source/_static/images/anlz_pssi_entry.svg +0 -191
  37. docs/source/_static/images/anlz_pvbr.svg +0 -125
  38. docs/source/_static/images/anlz_pwav.svg +0 -130
  39. docs/source/_static/images/anlz_pwv3.svg +0 -139
  40. docs/source/_static/images/anlz_pwv4.svg +0 -139
  41. docs/source/_static/images/anlz_pwv5.svg +0 -139
  42. docs/source/_static/images/anlz_pwv5_entry.svg +0 -100
  43. docs/source/_static/images/anlz_pwv6.svg +0 -130
  44. docs/source/_static/images/anlz_pwv7.svg +0 -139
  45. docs/source/_static/images/anlz_pwvc.svg +0 -125
  46. docs/source/_static/images/anlz_tag.svg +0 -110
  47. docs/source/_static/images/x64dbg_rb_key.png +0 -0
  48. docs/source/_static/logos/dark/logo_primary.svg +0 -75
  49. docs/source/_static/logos/light/logo_primary.svg +0 -75
  50. docs/source/_static/logos/mid/logo_primary.svg +0 -75
  51. docs/source/_templates/apidoc/module.rst_t +0 -8
  52. docs/source/_templates/apidoc/package.rst_t +0 -57
  53. docs/source/_templates/apidoc/toc.rst_t +0 -7
  54. docs/source/_templates/autosummary/class.rst +0 -32
  55. docs/source/_templates/autosummary/module.rst +0 -55
  56. docs/source/api.md +0 -18
  57. docs/source/conf.py +0 -178
  58. docs/source/development/changes.md +0 -3
  59. docs/source/development/contributing.md +0 -3
  60. docs/source/formats/anlz.md +0 -634
  61. docs/source/formats/db6.md +0 -1233
  62. docs/source/formats/mysetting.md +0 -392
  63. docs/source/formats/xml.md +0 -376
  64. docs/source/index.md +0 -103
  65. docs/source/installation.md +0 -271
  66. docs/source/key.md +0 -103
  67. docs/source/quickstart.md +0 -189
  68. docs/source/requirements.txt +0 -7
  69. docs/source/tutorial/anlz.md +0 -7
  70. docs/source/tutorial/configuration.md +0 -66
  71. docs/source/tutorial/db6.md +0 -178
  72. docs/source/tutorial/index.md +0 -20
  73. docs/source/tutorial/mysetting.md +0 -124
  74. docs/source/tutorial/xml.md +0 -140
  75. pyrekordbox/xml.py +0 -8
  76. pyrekordbox-0.3.2.dist-info/RECORD +0 -84
  77. tests/__init__.py +0 -3
  78. tests/test_anlz.py +0 -206
  79. tests/test_config.py +0 -175
  80. tests/test_db6.py +0 -1193
  81. tests/test_mysetting.py +0 -203
  82. tests/test_xml.py +0 -629
  83. {pyrekordbox-0.3.2.dist-info → pyrekordbox-0.4.0.dist-info}/LICENSE +0 -0
@@ -1,271 +0,0 @@
1
- # Installation
2
-
3
- Pyrekordbox is available on [PyPI]:
4
-
5
- ```sh
6
- $ pip install pyrekordbox
7
- ```
8
-
9
- Alternatively, it can be installed via [GitHub]:
10
-
11
- ```sh
12
- $ pip install git+https://github.com/dylanljones/pyrekordbox.git@VERSION
13
- ```
14
-
15
- where `VERSION` is a branch, tag or release. The project can also be cloned/forked
16
- and installed via
17
-
18
- ```sh
19
- $ pip install .
20
- ```
21
-
22
-
23
- ## Installing SQLCipher
24
-
25
- Unlocking the new Rekordbox 6 `master.db` database file requires [SQLCipher][sqlcipher].
26
- Pyrekordbox makes no attempt to download/install SQLCipher, as it is a
27
- pure Python package - whereas the SQLCipher/sqlcipher3 installation is
28
- platform-dependent and can not be installed easily via ``pip``.
29
-
30
- [sqlcipher3] can either be built with the system [SQLCipher][sqlcipher] or built against
31
- a statically linked amalgamation of the SQLite3 source code.
32
-
33
- ### Windows
34
-
35
- #### SQLCipher Amalagamation
36
-
37
- The easiest method to install SQLCipher on Windows is to build [sqlcipher3]
38
- against an amalgamation of the SQLite3 source code.
39
-
40
- 1. **Install [Visual Studio Community Edition][VS]**
41
-
42
- Make sure to select all the GCC options (VC++, C++, etc) in the installation process.
43
- The following workloads under ``Desktop & Mobile`` should be sufficient:
44
- - Desktop Development with C++
45
- - .NET desktop development
46
-
47
-
48
- 2. **Install a prebuilt [OpenSSL binary][OpenSSL]**
49
-
50
- Choose the latest Win32/Win64 version. Make sure to download the full version,
51
- not the light version.
52
-
53
-
54
- 3. **Confirm that the `OPENSSL_CONF` environment variable is set properly in environment variables**
55
-
56
- This should not be root openssl path (ex: `C:/Program Files/openssl-Win64`),
57
- but instead should be the path to the config file, for example:
58
- - 32-bit: ``C:/Program Files (x86)/openssl-Win32/bin/openssl.cfg``
59
- - 64-bit: ``C:/Program Files/openssl-Win64/bin/openssl.cfg``
60
-
61
- ```{note}
62
- The library names of OpenSSL have changed in version 1.1.0 (see [this](https://stackoverflow.com/questions/65345077/unable-to-build-sqlcipher3-on-windows) discussion).
63
- If you are using a newer version, you can set an environment variable
64
- ``OPENSSL_LIBNAME`` to the name of the library, e.g. ``libcrypto.lib``.
65
- Alternatively, you can modify the ``setup.py`` script (see step 8 below).
66
-
67
- You might have to restart Windows for the changes to take effect.
68
- ```
69
-
70
- 4. **Copy the openssl folder to the Microsoft Visual Studio 14 VC include directory**
71
-
72
- The openssl folder can be found here:
73
- - 32-bit: `C:/Program Files (x86)/OpenSSL-Win32/include/openssl`
74
- - 64-bit: `C:/Program Files/OpenSSL-Win64/include/openssl`
75
-
76
- The VC include directory can be found in the
77
- Visual Studio 14 installation directory:
78
-
79
- > C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include
80
-
81
- In newer versions it might aso be in
82
-
83
- > C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/[version]/include
84
-
85
- Confirm the following path exists `.../include/openssl/aes.h`
86
-
87
-
88
- 5. **Download / compile the SQLCipher 3 amalgamation files**
89
-
90
- Pre-built SQLCipher amalgamation files can be downloaded from [this repo][amalgamation]:
91
- ````shell
92
- git clone https://github.com/geekbrother/sqlcipher-amalgamation
93
- ````
94
- To compile the amalgamation files on your own, follow [this tutorial](http://www.jerryrw.com/howtocompile.php).
95
-
96
-
97
- 6. **Clone [sqlcipher3] into any directory**
98
-
99
- ````shell
100
- git clone https://github.com/coleifer/sqlcipher3
101
- ````
102
-
103
-
104
- 7. **Copy amalgamation files to the `sqlcipher3` directory**
105
-
106
- Copy files ``sqlite3.c`` and ``sqlite3.h`` from the amalgamation directory from step 5
107
- to the root of the ``sqlcipher3`` directory from step 6.
108
- ````shell
109
- Copy-Item -Path 'sqlcipher-amalgamation/src/sqlite3.c' -Destination "sqlcipher3/"
110
- Copy-Item -Path 'sqlcipher-amalgamation/src/sqlite3.h' -Destination "sqlcipher3/"
111
- ````
112
-
113
-
114
- 8. **Modify the ``sqlcipher3/setup.py`` script (optional)**
115
-
116
- If building the amalgamation fails and you haven't set the ``OPENSSL_LIBNAME``
117
- environment variable in step 3, you have to modify the ``setup.py`` script. Change
118
- ````python
119
- openssl_libname = os.environ.get('OPENSSL_LIBNAME') or 'libeay32.lib'
120
- ````
121
- to
122
- ````python
123
- openssl_libname = os.environ.get('OPENSSL_LIBNAME') or 'libcrypto.lib'
124
- ````
125
-
126
-
127
- 9. **Build using the amalgamation and install**
128
-
129
- ``cd`` into the ``sqlcipher3`` directory and run
130
- ````shell
131
- python setup.py build_static build
132
- python setup.py install
133
- ````
134
-
135
-
136
- You now should have a working ``sqlcipher3`` installation! The directory of the
137
- cloned ``sqlcipher3`` repo can be deleted after installing the package.
138
-
139
- Steps 5-9 can be automated using the CLI of ``pyrekordbox``:
140
-
141
- > python3 -m pyrekordbox install-sqlcipher --help
142
- usage: pyrekordbox install-sqlcipher [-h] [-t TMPDIR] [-l CRYPTOLIB] [-q] [-b]
143
-
144
- -t TMPDIR, --tmpdir TMPDIR
145
- Path for storing temporary data (default: '.tmp')
146
- -l CRYPTOLIB, --cryptolib CRYPTOLIB
147
- The name of the OpenSSl crypto libary (default: 'libcrypto.lib')
148
- -b, --buildonly Don't install sqlcipher3, only build the amalgamation
149
-
150
-
151
- ##### Troubleshooting
152
-
153
- - **Microsoft Visual C++ error**
154
-
155
- If you are getting an error like
156
- ````shell
157
- error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools"``
158
- ````
159
- and have Visual Studio installed, you might not have all the necessary C/C++ components.
160
-
161
- - **LINK error**
162
-
163
- If you are getting an error like
164
- ````shell
165
- LINK : fatal error LNK1158: cannot run 'rc.exe'
166
- ````
167
- or
168
- ````shell
169
- LINK : fatal error LNK1327: failure during running rc.exe
170
- ````
171
- make sure all the necessary C/C++ components are installed and that you have selected
172
- the latest Win 10/11 SDK in the Visual Studio installer. If you are still getting the error,
173
- follow the suggestions in this [StackOverflow post](https://stackoverflow.com/questions/14372706/visual-studio-cant-build-due-to-rc-exe).
174
-
175
-
176
- ### MacOS
177
-
178
-
179
- #### System SQLCipher
180
-
181
- For building [sqlcipher3] against the system SQLCipher installation on MacOS follow these steps:
182
-
183
- 1) Install [Homebrew](https://brew.sh) if you do not have it on your machine.
184
- 2) Install SQLCipher with `brew install SQLCipher`.
185
- 3) With the python environment you are using to run pyrekordbox active execute the following:
186
- ```shell
187
- git clone https://github.com/coleifer/sqlcipher3
188
- cd sqlcipher3
189
- SQLCIPHER_PATH=$(brew info sqlcipher | awk 'NR==4 {print $1; exit}'); C_INCLUDE_PATH="$SQLCIPHER_PATH"/include LIBRARY_PATH="$SQLCIPHER_PATH"/lib python setup.py build
190
- SQLCIPHER_PATH=$(brew info sqlcipher | awk 'NR==4 {print $1; exit}'); C_INCLUDE_PATH="$SQLCIPHER_PATH"/include LIBRARY_PATH="$SQLCIPHER_PATH"/lib python setup.py install
191
- ```
192
- Make sure the `C_INCLUDE` and `LIBRARY_PATH` point to the installed SQLCipher path. It may differ on your machine.
193
-
194
- ````{note}
195
- If you are having issues building sqlcipher on M1 Macs you might have to add some symlinks:
196
- ```shell
197
- ln -s /opt/homebrew/lib/libsqlcipher.a /usr/local/lib/libsqlcipher.a
198
- ln -s /opt/homebrew/include/sqlcipher /usr/local/include/sqlcipher
199
- ```
200
- ````
201
- #### SQLCipher Amalagamation
202
-
203
- You can also build [sqlcipher3] against an amalgamation on MacOS.
204
-
205
- 1. **Download / compile the SQLCipher amalgamation files**
206
-
207
- Pre-built SQLCipher amalgamation files can be downloaded from [this repo][amalgamation]:
208
- ````shell
209
- git clone https://github.com/geekbrother/sqlcipher-amalgamation
210
- ````
211
- You can also build the amalagamtion files on your own.
212
-
213
-
214
- 2. **Clone [sqlcipher3] into any directory**
215
-
216
- ````shell
217
- git clone https://github.com/coleifer/sqlcipher3
218
- ````
219
-
220
-
221
- 3. **Copy amalgamation files to the `sqlcipher3` directory**
222
-
223
- Copy files ``sqlite3.c`` and ``sqlite3.h`` from the amalgamation directory from step 1
224
- to the root of the ``sqlcipher3`` directory from step 2.
225
- ````shell
226
- cp sqlcipher-amalgamation/src/sqlite3.[ch] sqlcipher3/
227
- ````
228
-
229
- 4. **Build using the amalgamation and install**
230
-
231
- ``cd`` into the ``sqlcipher3`` directory and run
232
- ````shell
233
- python setup.py build_static build
234
- python setup.py install
235
- ````
236
-
237
- The steps above can be automated using the CLI of ``pyrekordbox``
238
-
239
- > python3 -m pyrekordbox install-sqlcipher --help
240
- usage: pyrekordbox install-sqlcipher [-h] [-t TMPDIR] [-l CRYPTOLIB] [-q] [-b]
241
-
242
- -t TMPDIR, --tmpdir TMPDIR
243
- Path for storing temporary data (default: '.tmp')
244
- -b, --buildonly Don't install sqlcipher3, only build the amalgamation
245
-
246
-
247
- ```{note}
248
- The `CRYPTOLIB` argument is only used on Windows
249
- ```
250
-
251
-
252
- ### Using SQLCipher
253
-
254
- After the installation SQLCipher-databases can be unlocked via the `sqlcipher3` package:
255
- ````python
256
- from sqlcipher3 import dbapi2 as sqlite3
257
-
258
- conn = sqlite3.connect('test.db')
259
- c = conn.cursor()
260
- c.execute("PRAGMA key='password'")
261
- ````
262
-
263
-
264
-
265
- [VS]: https://visualstudio.microsoft.com/de/vs/community/
266
- [OpenSSL]: https://slproweb.com/products/Win32OpenSSL.html
267
- [sqlcipher3]: https://github.com/coleifer/sqlcipher3
268
- [amalgamation]: https://github.com/geekbrother/sqlcipher-amalgamation
269
- [Pypi]: https://pypi.org/project/pyrekordbox/
270
- [GitHub]: https://github.com/dylanljones/pyrekordbox
271
- [sqlcipher]: https://www.zetetic.net/sqlcipher/open-source/
docs/source/key.md DELETED
@@ -1,103 +0,0 @@
1
- # Database key
2
-
3
- If the automatic key extraction fails the command line interface of ``pyrekordbox``
4
- provides a command for downloading the key from known sources and writing it to the
5
- cache file:
6
- ````shell
7
- python -m pyrekordbox download-key
8
- ````
9
- Once the key is cached the database can be opened without providing the key.
10
- if you obtained the key from another source, you can also pass it to the database handler
11
- ````python
12
- db = Rekordbox6Database(key="<insert key here>")
13
- ````
14
- or write it to the cache file manually:
15
- ````python
16
- from pyrekordbox.config import write_db6_key_cache
17
-
18
- write_db6_key_cache("<insert key here>") # call once
19
- db = Rekordbox6Database()
20
- ````
21
-
22
- ## Alternative methods
23
-
24
- The key can be extracted manually from the users machine. After the key is obtained
25
- it can be writen to the cache file as described above.
26
- The method varies depending on the operating system.
27
-
28
- ### Windows
29
-
30
- On Windows, the key can be extracted from the Rekordbox executable using a debugger:
31
-
32
- 1. Download [x64dbg] and run it.
33
-
34
- 2. Options -> Preferences. Make sure "Entry Breakpoint" is set in the Events tab.
35
-
36
- 3. File -> Open... `rekordbox.exe` (the main application executable)
37
-
38
- 4. Look at the status bar. It should have a yellow "Paused" icon followed by some status text.
39
- Right now it should say "System breakpoint reached!"
40
-
41
- 5. Hit F9 or press the Run button in the top bar. The status text should change to
42
- "INT3 breakpoint 'entry breakpoint' at <rekordbox.EntryPoint>".
43
-
44
- 6. Click in the disassembly window, then press Ctrl+G to open the Go To Expression box,
45
- and search for `sqlite3_key_v2` and press OK. This should jump you to the code for
46
- that function, which typically starts with `mov dword ptr ss:[rsp+xx], r9d` or similar.
47
-
48
- 7. Without clicking anywhere on the disassembly window, press F2 to toggle breakpoint.
49
- The top instruction's address should turn red.
50
-
51
- 8. Hit F9 or press the Run button in the top bar. The status text will start changing
52
- a bunch, while the program starts up. Wait until the status bar goes back to "Paused"
53
- in yellow. If the status text says something like "First chance exception on..."
54
- press F9 again.
55
-
56
- 9. The status bar should go to "Paused" in yellow again, this time with status text
57
- that says "INT3 breakpoint at <sqlite3.sqlite3_key_v2>". This means our breakpoint
58
- has been hit.
59
-
60
- 10. Click the register panel (top right, where RAX, RBX, RCX, etc. are listed) so
61
- it updates. Right click the red address next to R8, and click "Follow in dump".
62
-
63
- 11. The dump at the bottom left will move to that address. Right click the dump panel
64
- and select Text -> ASCII at the bottom. You should now see the key as a string.
65
- You can drag-select it, then right click to copy selected line.
66
-
67
- 12. Go to Debug -> Close to close the process, then close x64dbg.
68
-
69
-
70
- ```{figure} /_static/images/x64dbg_rb_key.png
71
- :align: center
72
- :scale: 60
73
- ```
74
-
75
-
76
- ### MacOS
77
-
78
- On MacOS, the key can be extracted using the [RekordLocksmith] tool:
79
-
80
- 1. Install LLDB:
81
- - LLDB can be installed with Xcode on macOS via the App Store or xcode-cli-commands.
82
- - Ensure LLDB is accessible from the terminal by running `lldb` in the terminal.
83
-
84
- 2. Disable SIP:
85
- - Restart your Mac and hold down `Command-R` as it boots to enter Recovery Mode.
86
- - Open the Terminal from the Utilities menu.
87
- - Type `csrutil disable` and press Enter.
88
- - Restart your Mac.
89
-
90
- 3. Download RekordLocksmith:
91
- - Clone or download the [RekordLocksmith] repository from GitHub.
92
-
93
- 4. Run RekordLocksmith:
94
- - Use the terminal to navigate to the folder containing `rekordlocksmith.py`.
95
- - Run the script:
96
- ````shell
97
- python3 rekordlocksmith.py /Applications/rekordbox\ 6/rekordbox.app/Contents/MacOS/rekordbox
98
- ````
99
- The tool will output the database key to the terminal and save it to a file named `rekordbox_db_pass.txt` in the current directory.
100
-
101
-
102
- [x64dbg]: https://x64dbg.com/
103
- [RekordLocksmith]: https://github.com/Bide-UK/rekordlocksmith#rekordlocksmith
docs/source/quickstart.md DELETED
@@ -1,189 +0,0 @@
1
- # Quick-Start
2
-
3
-
4
- Pyrekordbox can be installed via:
5
- ````shell
6
- $ pip install pyrekordbox
7
- ````
8
-
9
- See the {doc}`Installation</installation>` section for more details.
10
-
11
- ```{attention}
12
- Please make sure to back up your Rekordbox collection before making
13
- any changes with pyrekordbox or developing/testing new features.
14
-
15
- The backup dialog can be found under "File" > "Library" > "Backup Library"
16
- ```
17
-
18
-
19
- ## Configuration
20
-
21
- Pyrekordbox looks for installed Rekordbox versions and sets up the configuration
22
- automatically. The configuration can be checked by calling:
23
- ````python
24
- from pyrekordbox import show_config
25
-
26
- show_config()
27
- ````
28
- If for some reason the configuration fails the values can be updated by providing the
29
- paths to the directory where Pioneer applications are installed (`pioneer_install_dir`)
30
- and to the directory where Pioneer stores the application data (`pioneer_app_dir`)
31
- ````python
32
- from pyrekordbox.config import update_config
33
-
34
- update_config("<pioneer_install_dir>", "<pioneer_app_dir>")
35
- ````
36
- Alternatively the two paths can be specified in a configuration file under the section
37
- `rekordbox`. Supported configuration files are pyproject.toml, setup.cfg, pyrekordbox.toml,
38
- pyrekordbox.cfg and pyrekordbox.yaml.
39
-
40
-
41
- ## Rekordbox 6 database
42
-
43
- Rekordbox 6 now uses a SQLite database for storing the collection content.
44
- Unfortunatly, the new `master.db` SQLite database is encrypted using
45
- [SQLCipher][sqlcipher], which means it can't be used without the encryption key.
46
- However, since your data is stored and used locally, the key must be present on the
47
- machine running Rekordbox.
48
-
49
- Pyrekordbox can unlock the new Rekordbox `master.db` SQLite database and provides
50
- an easy interface for accessing the data stored in it:
51
-
52
- ````python
53
- from pyrekordbox import Rekordbox6Database
54
-
55
- db = Rekordbox6Database()
56
-
57
- for content in db.get_content():
58
- print(content.Title, content.Artist.Name)
59
-
60
- playlist = db.get_playlist()[0]
61
- for song in playlist.Songs:
62
- content = song.Content
63
- print(content.Title, content.Artist.Name)
64
- ````
65
- Fields in the Rekordbox database that are stored without linking to other tables
66
- can be changed via the corresponding property of the object:
67
- ````python
68
- content = db.get_content()[0]
69
- content.Title = "New Title"
70
- ````
71
- Some fields are stored as references to other tables, for example the artist of a track.
72
- Check the [documentation](#db6-format) of the corresponding object for more information.
73
- So far only a few tables support adding or deleting entries:
74
- - ``DjmdPlaylist``: Playlists/Playlist Folders
75
- - ``DjmdSongPlaylist``: Songs in a playlist
76
- - ``DjmdAlbum``: Albums
77
- - ``DjmdArtist``: Artists
78
- - ``DjmdGenre``: Genres
79
- - ``DjmdLabel``: Labels
80
-
81
- ````{important}
82
- Starting from Rekordbox version ``6.6.5`` Pioneer obfuscated the ``app.asar`` file
83
- contents, breaking the key extraction (see [this discussion](https://github.com/dylanljones/pyrekordbox/discussions/97) for more details).
84
- If you are using a later version of Rekorbox and have no cached key from a previous
85
- version, the database can not be unlocked automatically.
86
- The command line interface of ``pyrekordbox`` provides a command for downloading
87
- the key from known sources and writing it to the cache file:
88
- ```shell
89
- python -m pyrekordbox download-key
90
- ```
91
- Once the key is cached the database can be opened without providing the key.
92
- The key can also be provided manually:
93
- ```python
94
- db = Rekordbox6Database(key="<insert key here>")
95
- ```
96
- ````
97
-
98
-
99
- ## Rekordbox XML
100
-
101
- The Rekordbox XML database is used for importing (and exporting) Rekordbox collections
102
- including track metadata and playlists. They can also be used to share playlists
103
- between two databases.
104
-
105
- Pyrekordbox can read and write Rekordbox XML databases.
106
-
107
- ````python
108
- from pyrekordbox.rbxml import RekordboxXml
109
-
110
- xml = RekordboxXml("database.xml")
111
-
112
- track = xml.get_track(0) # Get track by index (or TrackID)
113
- track_id = track.TrackID # Access via attribute
114
- name = track["Name"] # or dictionary syntax
115
-
116
- path = "/path/to/file.mp3"
117
- track = xml.add_track(path) # Add new track
118
- track["Name"] = "Title" # Add attributes to new track
119
- track["TrackID"] = 10 # Types are handled automatically
120
-
121
- # Get playlist (folder) by path
122
- pl = xml.get_playlist("Folder", "Sub Playlist")
123
- keys = pl.get_tracks() # Get keys of tracks in playlist
124
- ktype = pl.key_type # Key can either be TrackID or Location
125
-
126
- # Add tracks and sub-playlists (folders)
127
- pl.add_track(track.TrackID)
128
- pl.add_playlist("Sub Sub Playlist")
129
- ````
130
-
131
- ## Rekordbox ANLZ files
132
-
133
- Rekordbox stores analysis information of the tracks in the collection in specific files,
134
- which also get exported to decives used by Pioneer professional DJ equipment. The files
135
- have names like `ANLZ0000` and come with the extensions `.DAT`, `.EXT` or `.2EX`.
136
- They include waveforms, beat grids (information about the precise time at which
137
- each beat occurs), time indices to allow efficient seeking to specific positions
138
- inside variable bit-rate audio streams, and lists of memory cues and loop points.
139
-
140
- Pyrekordbox can parse all three analysis files, although not all the information of
141
- the tracks can be extracted yet.
142
-
143
- ````python
144
- from pyrekordbox.anlz import AnlzFile
145
-
146
- anlz = AnlzFile.parse_file("ANLZ0000.DAT")
147
- beat_grid = anlz.get("beat_grid")
148
- path_tags = anlz.getall_tags("path")
149
- ````
150
-
151
- Changing and creating the Rekordbox analysis files is planned as well, but for that the
152
- full structure of the analysis files has to be understood.
153
-
154
-
155
- ```{note}
156
- Some ANLZ tags are still unsupported:
157
- - PCOB
158
- - PCO2
159
- - PSSI
160
- - PWV6
161
- - PWV7
162
- - PWVC
163
- ```
164
-
165
-
166
- ## Rekordbox My-Settings
167
-
168
- Rekordbox stores the user settings in `*SETTING.DAT` files, which get exported to USB
169
- devices. These files are either in the `PIONEER`directory of a USB drive
170
- (device exports), but are also present for on local installations of Rekordbox 6.
171
- The setting files store the settings found on the "DJ System" > "My Settings" page of
172
- the Rekordbox preferences. These include language, LCD brightness, tempo fader range,
173
- crossfader curve and other settings for Pioneer professional DJ equipment.
174
-
175
- Pyrekordbox supports both parsing and writing My-Setting files.
176
-
177
- ````python
178
- from pyrekordbox.mysettings import read_mysetting_file
179
-
180
- mysett = read_mysetting_file("MYSETTINGS.DAT")
181
- sync = mysett.get("sync")
182
- quant = mysett.get("quantize")
183
- ````
184
-
185
- ```{note}
186
- The `DEVSETTING.DAT` file is still not supported
187
- ```
188
-
189
- [sqlcipher]: https://www.zetetic.net/sqlcipher/open-source/
@@ -1,7 +0,0 @@
1
- sphinx==7.2.3
2
- sphinx_copybutton==0.5.2
3
- numpydoc==1.5.0
4
- furo==2023.09.10
5
- myst-parser==2.0.0
6
- docutils==0.19
7
- matplotlib
@@ -1,7 +0,0 @@
1
- # Analysis Files
2
-
3
- Coming soon!
4
-
5
- ```{seealso}
6
- See the {ref}`Analysis Files Format<Analysis Files Format>` documentation for more information.
7
- ```
@@ -1,66 +0,0 @@
1
- # Configuration
2
-
3
- Pyrekordbox looks for installed Rekordbox versions and sets up the configuration
4
- automatically. The configuration can be checked by calling:
5
- ````python
6
- from pyrekordbox import show_config
7
-
8
- show_config()
9
- ````
10
-
11
- which, for example, will print
12
- ````
13
- Pioneer:
14
- app_dir = C:\Users\user\AppData\Roaming\Pioneer
15
- install_dir = C:\Program Files\Pioneer
16
- Rekordbox 5:
17
- app_dir = C:\Users\user\AppData\Roaming\Pioneer\rekordbox
18
- db_dir = C:\Users\user\AppData\Roaming\Pioneer\rekordbox
19
- db_path = C:\Users\user\AppData\Roaming\Pioneer\rekordbox\datafile.edb
20
- install_dir = C:\Program Files\Pioneer\rekordbox 5.8.6
21
- version = 5.8.6
22
- Rekordbox 6:
23
- app_dir = C:\Users\user\AppData\Roaming\Pioneer\rekordbox6
24
- db_dir = C:\Users\user\AppData\Roaming\Pioneer\rekordbox
25
- db_path = C:\Users\user\AppData\Roaming\Pioneer\rekordbox\master.db
26
- dp = FJ9s0iA+hiPZg...
27
- install_dir = C:\Program Files\Pioneer\rekordbox 6.5.3
28
- version = 6.5.3
29
- ````
30
-
31
- If for some reason the configuration fails the values can be updated by providing the
32
- paths to the directory where Pioneer applications are installed (`pioneer_install_dir`)
33
- and to the directory where Pioneer stores the application data (`pioneer_app_dir`)
34
- ````python
35
- from pyrekordbox.config import update_config
36
-
37
- update_config(pioneer_install_dir, pioneer_app_dir)
38
- ````
39
-
40
- ## Configuration files
41
- Alternatively the two paths can be specified in a configuration file under the section
42
- `rekordbox`. Supported configuration files are pyproject.toml, setup.cfg, rekordbox.toml,
43
- rekordbox.cfg and rekordbox.yml.
44
-
45
- **pyproject.toml** / **pyrekordbox.toml**
46
- `````toml
47
- [rekordbox]
48
- pioneer-install-dir = "C:/Program Files/Pioneer"
49
- pioneer-app-dir = "C:/Users/user/AppData/Roaming/Pioneer"
50
- `````
51
-
52
-
53
- **setup.cfg** / **pyrekordbox.cfg**
54
- `````ini
55
- [rekordbox]
56
- pioneer-install-dir = C:/Program Files/Pioneer
57
- pioneer-app-dir = C:/Users/user/AppData/Roaming/Pioneer
58
- `````
59
-
60
-
61
- **pyrekordbox.yml**
62
- ````yaml
63
- rekordbox:
64
- pioneer-install-dir: C:/Program Files/Pioneer
65
- pioneer-app-dir: C:/Users/user/AppData/Roaming/Pioneer
66
- ````