pyrekordbox 0.2.0__py3-none-any.whl → 0.2.2__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 (69) hide show
  1. docs/Makefile +20 -0
  2. docs/make.bat +35 -0
  3. docs/source/_static/images/anlz_beat.svg +53 -0
  4. docs/source/_static/images/anlz_file.svg +204 -0
  5. docs/source/_static/images/anlz_pco2.svg +138 -0
  6. docs/source/_static/images/anlz_pcob.svg +148 -0
  7. docs/source/_static/images/anlz_pcp2.svg +398 -0
  8. docs/source/_static/images/anlz_pcpt.svg +263 -0
  9. docs/source/_static/images/anlz_ppth.svg +123 -0
  10. docs/source/_static/images/anlz_pqt2.svg +324 -0
  11. docs/source/_static/images/anlz_pqt2_2.svg +253 -0
  12. docs/source/_static/images/anlz_pqtz.svg +140 -0
  13. docs/source/_static/images/anlz_pssi.svg +192 -0
  14. docs/source/_static/images/anlz_pssi_entry.svg +191 -0
  15. docs/source/_static/images/anlz_pvbr.svg +125 -0
  16. docs/source/_static/images/anlz_pwav.svg +130 -0
  17. docs/source/_static/images/anlz_pwv3.svg +139 -0
  18. docs/source/_static/images/anlz_pwv4.svg +139 -0
  19. docs/source/_static/images/anlz_pwv5.svg +139 -0
  20. docs/source/_static/images/anlz_pwv5_entry.svg +100 -0
  21. docs/source/_static/images/anlz_pwv6.svg +130 -0
  22. docs/source/_static/images/anlz_pwv7.svg +139 -0
  23. docs/source/_static/images/anlz_pwvc.svg +125 -0
  24. docs/source/_static/images/anlz_tag.svg +110 -0
  25. docs/source/_static/logos/dark/logo_primary.svg +75 -0
  26. docs/source/_static/logos/light/logo_primary.svg +75 -0
  27. docs/source/_static/logos/mid/logo_primary.svg +75 -0
  28. docs/source/_templates/apidoc/module.rst_t +8 -0
  29. docs/source/_templates/apidoc/package.rst_t +57 -0
  30. docs/source/_templates/apidoc/toc.rst_t +7 -0
  31. docs/source/_templates/autosummary/class.rst +32 -0
  32. docs/source/_templates/autosummary/module.rst +55 -0
  33. docs/source/api.md +18 -0
  34. docs/source/conf.py +178 -0
  35. docs/source/development/changes.md +3 -0
  36. docs/source/development/contributing.md +3 -0
  37. docs/source/formats/anlz.md +634 -0
  38. docs/source/formats/db6.md +1233 -0
  39. docs/source/formats/mysetting.md +392 -0
  40. docs/source/formats/xml.md +376 -0
  41. docs/source/index.md +105 -0
  42. docs/source/installation.md +3 -0
  43. docs/source/quickstart.md +185 -0
  44. docs/source/requirements.txt +7 -0
  45. docs/source/tutorial/anlz.md +7 -0
  46. docs/source/tutorial/configuration.md +66 -0
  47. docs/source/tutorial/db6.md +179 -0
  48. docs/source/tutorial/index.md +20 -0
  49. docs/source/tutorial/mysetting.md +124 -0
  50. docs/source/tutorial/xml.md +140 -0
  51. pyrekordbox/__init__.py +1 -1
  52. pyrekordbox/__main__.py +16 -37
  53. pyrekordbox/_version.py +2 -2
  54. pyrekordbox/anlz/file.py +39 -0
  55. pyrekordbox/anlz/structs.py +3 -5
  56. pyrekordbox/config.py +71 -27
  57. pyrekordbox/db6/database.py +290 -61
  58. pyrekordbox/db6/registry.py +24 -0
  59. pyrekordbox/db6/tables.py +501 -340
  60. pyrekordbox/mysettings/file.py +0 -25
  61. pyrekordbox/utils.py +1 -1
  62. {pyrekordbox-0.2.0.dist-info → pyrekordbox-0.2.2.dist-info}/METADATA +42 -20
  63. pyrekordbox-0.2.2.dist-info/RECORD +80 -0
  64. {pyrekordbox-0.2.0.dist-info → pyrekordbox-0.2.2.dist-info}/top_level.txt +1 -0
  65. tests/test_config.py +175 -0
  66. tests/test_db6.py +95 -0
  67. pyrekordbox-0.2.0.dist-info/RECORD +0 -29
  68. {pyrekordbox-0.2.0.dist-info → pyrekordbox-0.2.2.dist-info}/LICENSE +0 -0
  69. {pyrekordbox-0.2.0.dist-info → pyrekordbox-0.2.2.dist-info}/WHEEL +0 -0
@@ -0,0 +1,376 @@
1
+ # XML Database Format
2
+
3
+ The Rekordbox XML format is well documented by Pioneer in [^footnote-1] and [^footnote-2].
4
+
5
+ The first entry of the XML file should be displayed as follows:
6
+
7
+ ```xml
8
+ <?xml version="1.0" encoding="UTF-8" ?>
9
+ ```
10
+
11
+ ```{warning}
12
+ In order to save playlists and their information to Rekordbox, all rows from the
13
+ second row and beyond must follow a format which rekordbox supports.
14
+ ```
15
+
16
+ ## General structure
17
+
18
+ The general structure of the Rekordbox XML file is as follows:
19
+
20
+ ```xml
21
+ <?xml version="1.0" encoding="UTF-8" ?>
22
+
23
+ <DJ_PLAYLISTS Version="1.0.0">
24
+ <PRODUCT Name="rekordbox" Version="5.4.3" Company="Pioneer DJ"/>
25
+ <COLLECTION Entries="1234">
26
+ <TRACK TrackID="1" Name="NOISE" Artist="" Composer="" Album="" Grouping=""
27
+ Genre="" Kind="WAV File" Size="1382226" TotalTime="5" DiscNumber="0"
28
+ TrackNumber="0" Year="0" AverageBpm="0.00" DateAdded="2017-09-07"
29
+ BitRate="2116" SampleRate="44100" Comments="" PlayCount="0" Rating="0"
30
+ Location="file://localhost/C:/Users/user/Music/PioneerDJ/Sampler/OSC_SAMPLER/PRESET%20ONESHOT/NOISE.wav"
31
+ Remixer="" Tonality="" Label="" Mix=""/>
32
+ <TRACK TrackID="2" Name="SINEWAVE" Artist="" Composer="" Album="" Grouping=""
33
+ Genre="" Kind="WAV File" Size="1515258" TotalTime="5" DiscNumber="0"
34
+ TrackNumber="0" Year="0" AverageBpm="0.00" DateAdded="2017-09-07"
35
+ BitRate="2116" SampleRate="44100" Comments="" PlayCount="0" Rating="0"
36
+ Location="file://localhost/C:/Users/user/Music/PioneerDJ/Sampler/OSC_SAMPLER/PRESET%20ONESHOT/SINEWAVE.wav"
37
+ Remixer="" Tonality="" Label="" Mix="">
38
+ <TEMPO Inizio="0.232" Bpm="172.00" Metro="4/4" Battito="1"/>
39
+ <POSITION_MARK Name="" Type="0" Start="0.232" Num="-1"/>
40
+ ...
41
+ </TRACK>
42
+ ...
43
+ </COLLECTION>
44
+ <PLAYLISTS>
45
+ <NODE Type="0" Name="ROOT" Count="11">
46
+ <NODE Name="Favourites" Type="1" KeyType="0" Entries="56">
47
+ <TRACK Key="1"/>
48
+ <TRACK Key="2"/>
49
+ ...
50
+ </NODE>
51
+ </NODE>
52
+ ...
53
+ </PLAYLISTS>
54
+ </DJ_PLAYLISTS>
55
+ ```
56
+
57
+ ## Supported Elements and Attributes
58
+
59
+ ```{eval-rst}
60
+ .. list-table:: Supported Rekordbox XML elements and attributes
61
+ :widths: 1 1 1 1
62
+ :header-rows: 1
63
+
64
+ * - Element
65
+ - Description
66
+ - Type
67
+ - Notes
68
+ * - **DJ_PLAYLIST**
69
+ -
70
+ -
71
+ -
72
+ * - *Version*
73
+ - Version of XML format
74
+ - utf-8
75
+ - The latest version is 1.0.0
76
+ * - **PRODUCT**
77
+ -
78
+ -
79
+ -
80
+ * - *Name*
81
+ - Name of product
82
+ - utf-8
83
+ - This name will be displayed in each application software.
84
+ * - *Version*
85
+ - Version of application
86
+ - utf-8
87
+ -
88
+ * - *Company*
89
+ - Name of company
90
+ - utf-8
91
+ -
92
+ * - **COLLECTION**
93
+ -
94
+ -
95
+ -
96
+ * - *Entries*
97
+ - Number of TRACK in COLLECTION
98
+ - sint32
99
+ -
100
+ * - **TRACK**
101
+ -
102
+ -
103
+ - "Location" is essential for each track
104
+ * - *TrackID*
105
+ - Identification of track
106
+ - utf-8
107
+ -
108
+ * - *Name*
109
+ - Name of track
110
+ - utf-8
111
+ -
112
+ * - *Artist*
113
+ - Name of artist
114
+ - utf-8
115
+ -
116
+ * - *Composer*
117
+ - Name of composer (or producer)
118
+ - utf-8
119
+ -
120
+ * - *Album*
121
+ - Name of album
122
+ - utf-8
123
+ -
124
+ * - *Grouping*
125
+ - Name of group
126
+ - utf-8
127
+ -
128
+ * - *Genre*
129
+ - Name of genre
130
+ - utf-8
131
+ -
132
+ * - *Kind*
133
+ - Type of audio file
134
+ - utf-8
135
+ -
136
+ * - *Size*
137
+ - Size of audio file
138
+ - sint64
139
+ - Unit: Octet
140
+ * - *TotalTime*
141
+ - Duration of track
142
+ - float64
143
+ - Unit: Second (without decimal numbers)
144
+ * - *DiscNumber*
145
+ - Number of the disc of the album
146
+ - sint32
147
+ -
148
+ * - *TrackNumber*
149
+ - Number of the track of the album
150
+ - sint32
151
+ -
152
+ * - *Year*
153
+ - Year of release
154
+ - sint32
155
+ -
156
+ * - *AverageBpm*
157
+ - Value of average BPM
158
+ - float64
159
+ - Unit: Second (with decimal numbers)
160
+ * - *DateModified*
161
+ - Date of last modification
162
+ - utf-8
163
+ - Format: yyyy-mm-dd; ex.: 2010-08-21
164
+ * - *DateAdded*
165
+ - Date of addition
166
+ - utf-8
167
+ - Format: yyyy-mm-dd; ex.: 2010-08-21
168
+ * - *BitRate*
169
+ - Encoding bit rate
170
+ - sint32
171
+ - Unit: Kbps
172
+ * - *SampleRate*
173
+ - Frequency of sampling
174
+ - float64
175
+ - Unit: Hertz
176
+ * - *Comments*
177
+ - Comments
178
+ - utf-8
179
+ -
180
+ * - *PlayCount*
181
+ - Play count of the track
182
+ - sint32
183
+ -
184
+ * - *LastPlayed*
185
+ - Date of last playing
186
+ - utf-8
187
+ - Format: yyyy-mm-dd; ex.: 2010-08-21
188
+ * - *Rating*
189
+ - Rating of the track
190
+ - sint32
191
+ - 0="0", 1="51", 2="102", 3="153", 4="204", 5="255"
192
+ * - *Location*
193
+ - Location of the file
194
+ - utf-8 (URI)
195
+ - includes the file name
196
+ * - *Remixer*
197
+ - Name of remixer
198
+ - utf-8
199
+ -
200
+ * - *Tonality*
201
+ - Tonality (Kind of musical key)
202
+ - utf-8
203
+ -
204
+ * - *Label*
205
+ - Name of record label
206
+ - utf-8
207
+ -
208
+ * - *Mix*
209
+ - Name of mix
210
+ - utf-8
211
+ -
212
+ * - *Colour*
213
+ - Colour for track grouping
214
+ - utf-8
215
+ - RGB format (3 bytes)
216
+ * - **TEMPO**
217
+ -
218
+ -
219
+ - BeatGrid; More than two "TEMPO" can exist for each track
220
+ * - *Inizio*
221
+ - Start position of BeatGrid
222
+ - float64
223
+ - Unit: Second (with decimal numbers)
224
+ * - *Bpm*
225
+ - Value of BPM
226
+ - float64
227
+ - Unit: Second (with decimal numbers)
228
+ * - *Metro*
229
+ - Kind of musical meter
230
+ - utf-8
231
+ - ex. 3/4, 4/4, 7/8 ...
232
+ * - *Battito*
233
+ - Beat number in the bar
234
+ - sint32
235
+ - If "Metro" is 4/4, the value should be 1, 2, 3 or 4
236
+ * - **POSITION_MARK**
237
+ -
238
+ -
239
+ - More than two "POSITION MARK" can exist for each track
240
+ * - *Name*
241
+ - Name of position mark
242
+ - utf-8
243
+ -
244
+ * - *Type*
245
+ - Type of position mark
246
+ - sint32
247
+ - Cue="0", Fade-In="1", Fade-Out="2", Load="3", Loop="4"
248
+ * - *Start*
249
+ - Start position of position mark
250
+ - float64
251
+ - Unit: Second (with decimal numbers)
252
+ * - *End*
253
+ - End position of position mark
254
+ - float64
255
+ - Unit: Second (with decimal numbers)
256
+ * - *Num*
257
+ - Number of the position mark
258
+ - sint32
259
+ - Hot Cue: A="0", B="1", C="2"; Memory Cue: "-1"
260
+
261
+ ```
262
+
263
+ Playlists are a bit more complex since they are nested:
264
+
265
+ ```{eval-rst}
266
+ .. list-table:: Supported Rekordbox XML playlist elements and attributes
267
+ :widths: 1 1 1 1
268
+ :header-rows: 1
269
+
270
+ * - Element
271
+ - Description
272
+ - Type
273
+ - Notes
274
+ * - **NODE**
275
+ -
276
+ -
277
+ -
278
+ * - *Type*
279
+ - Type of NODE
280
+ - sint32
281
+ - "0" (FOLDER)
282
+ * - *Name*
283
+ - Name of NODE
284
+ - utf-8
285
+ - ("ROOT")
286
+ * - *Count*
287
+ - Number of items in the NODE
288
+ - sint32
289
+ -
290
+ * - **NODE**
291
+ -
292
+ -
293
+ -
294
+ * - *Type*
295
+ - Type of NODE
296
+ - sint32
297
+ - "0" (FOLDER)
298
+ * - *Name*
299
+ - Name of NODE
300
+ - utf-8
301
+ - ("ROOT")
302
+ * - (if "Type" == "1")
303
+ -
304
+ -
305
+ - Node is a PLAYLIST
306
+ * - *Entries*
307
+ - Number of TRACK in PLAYLIST
308
+ - sint32
309
+ -
310
+ * - *KeyType*
311
+ - Kind of identification
312
+ - sint32
313
+ - "0" (Track ID) or "1"(Location)
314
+ * - **TRACK**
315
+ -
316
+ -
317
+ -
318
+ * - *Key*
319
+ - Identification of track
320
+ - sint32/utf-8
321
+ -
322
+ * - (if "Type" == "0")
323
+ -
324
+ -
325
+ - Node is a FOLDER
326
+ * - *Count*
327
+ - Number of items in the NODE
328
+ - sint32
329
+ -
330
+
331
+ ```
332
+
333
+ Rekordbox track colors:
334
+
335
+ ```{eval-rst}
336
+ .. list-table:: Rekordbox group colors
337
+ :widths: 1 1 1
338
+ :header-rows: 1
339
+
340
+ * - Name
341
+ - Hex
342
+ - RGB
343
+ * - Rose
344
+ - 0xFF007F
345
+ - 255, 0, 127
346
+ * - Red
347
+ - 0xFF0000
348
+ - 255, 0, 0
349
+ * - Orange
350
+ - 0xFFA500
351
+ - 255, 165, 0
352
+ * - Lemon
353
+ - 0xFFFF00
354
+ - 255, 255, 0
355
+ * - Green
356
+ - 0x00FF00
357
+ - 0, 255, 0
358
+ * - Turquoise
359
+ - 0x25FDE9
360
+ - 37, 253, 233
361
+ * - Blue
362
+ - 0x0000FF
363
+ - 0, 0, 255
364
+ * - Violet
365
+ - 0x660099
366
+ - 102, 0, 153
367
+
368
+ ```
369
+
370
+ ## References
371
+
372
+ [^footnote-1]: Rekordbox for developers.
373
+ <https://rekordbox.com/en/support/developer/>
374
+
375
+ [^footnote-2]: Rekordbox XML format
376
+ <https://cdn.rekordbox.com/files/20200410160904/xml_format_list.pdf>
docs/source/index.md ADDED
@@ -0,0 +1,105 @@
1
+ <!--
2
+ pyrekordbox documentation master file, created by
3
+ sphinx-quickstart on Thu Apr 7 15:06:50 2022.
4
+ -->
5
+
6
+ # Pyrekordbox documentation
7
+
8
+ [![Tests][tests-badge]][tests-link]
9
+ [![Codecov][codecov-badge]][codecov-link]
10
+ [![Version][pypi-badge]][pypi-link]
11
+ [![Python][python-badge+]][pypi-link]
12
+ [![Platform][platform-badge]][pypi-link]
13
+ [![license: MIT][license-badge]][license-link]
14
+ [![style: black][black-badge]][black-link]
15
+
16
+ ```{admonition} Disclaimer
17
+ This project is not affiliated with Pioneer Corp. or its related companies
18
+ in any way or form and has been written independently! Pyrekordbox is licensed
19
+ under the [MIT license][license-link].
20
+ The maintainers of the project are not liable for any damages to your Rekordbox library.
21
+ ```
22
+
23
+ Pyrekordbox is a Python package for interacting with the library and export data of
24
+ Pioneer's Rekordbox DJ Software. It currently supports
25
+
26
+ - Rekordbox 6 `master.db` database
27
+ - Rekordbox XML database
28
+ - Analysis files (ANLZ)
29
+ - My-Settings files
30
+
31
+ Tested Rekordbox versions: `5.8.6 | 6.5.3 | 6.7.7`
32
+
33
+ ```{warning}
34
+ This project is still under development and might contain bugs or
35
+ have breaking API changes in the future.
36
+ ```
37
+
38
+ ## Contents
39
+
40
+ ```{toctree}
41
+ ---
42
+ maxdepth: 2
43
+ caption: User Guide
44
+ ---
45
+
46
+ quickstart
47
+ installation
48
+ tutorial/index
49
+ api
50
+ ```
51
+
52
+ ```{toctree}
53
+ ---
54
+ maxdepth: 2
55
+ caption: File formats
56
+ ---
57
+
58
+ formats/db6
59
+ formats/xml
60
+ formats/anlz
61
+ formats/mysetting
62
+ ```
63
+
64
+ ```{toctree}
65
+ ---
66
+ maxdepth: 1
67
+ caption: Development
68
+ ---
69
+
70
+ development/contributing
71
+ development/changes
72
+ ```
73
+
74
+ ```{toctree}
75
+ ---
76
+ hidden:
77
+ caption: Project Links
78
+ ---
79
+
80
+ GitHub <https://github.com/dylanljones/pyrekordbox>
81
+ PyPI <https://pypi.org/project/pyrekordbox/>
82
+ ```
83
+
84
+ # Indices and tables
85
+
86
+ - {ref}`genindex`
87
+ - {ref}`search`
88
+
89
+
90
+ [tests-badge]: https://img.shields.io/github/actions/workflow/status/dylanljones/pyrekordbox/tests.yml?branch=master&label=tests&logo=github&style=flat
91
+ [codecov-badge]: https://codecov.io/gh/dylanljones/pyrekordbox/branch/master/graph/badge.svg?token=5Z2KVGL7N3
92
+ [python-badge]: https://img.shields.io/pypi/pyversions/pyrekordbox?style=flat
93
+ [python-badge+]: https://img.shields.io/badge/python-3.7+-blue.svg
94
+ [platform-badge]: https://img.shields.io/badge/platform-win%20%7C%20osx-blue?style=flat
95
+ [pypi-badge]: https://img.shields.io/pypi/v/pyrekordbox?style=flat
96
+ [license-badge]: https://img.shields.io/pypi/l/pyrekordbox?color=lightgrey
97
+ [black-badge]: https://img.shields.io/badge/code%20style-black-000000?style=flat
98
+
99
+ [pypi-link]: https://pypi.org/project/pyrekordbox/
100
+ [license-link]: https://github.com/dylanljones/pyrekordbox/blob/master/LICENSE
101
+ [tests-link]: https://github.com/dylanljones/pyrekordbox/actions/workflows/tests.yml
102
+ [black-link]: https://github.com/psf/black
103
+ [codecov-link]: https://app.codecov.io/gh/dylanljones/pyrekordbox/tree/master
104
+
105
+ [issue]: https://github.com/dylanljones/pyrekordbox/issues/64
@@ -0,0 +1,3 @@
1
+ ```{include} ../../INSTALLATION.md
2
+
3
+ ```
@@ -0,0 +1,185 @@
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
+
77
+ ````{important}
78
+ Starting from Rekordbox version ``6.6.5`` Pioneer obfuscated the ``app.asar`` file
79
+ contents, breaking the key extraction (see [this discussion](https://github.com/dylanljones/pyrekordbox/discussions/97) for more details).
80
+ If you are using a later version of Rekorbox and have no cached key from a previous
81
+ version, the database can not be unlocked automatically.
82
+ The command line interface of ``pyrekordbox`` provides a command for downloading
83
+ the key from known sources and writing it to the cache file:
84
+ ```shell
85
+ python -m pyrekordbox download-key
86
+ ```
87
+ Once the key is cached the database can be opened without providing the key.
88
+ The key can also be provided manually:
89
+ ```python
90
+ db = Rekordbox6Database(key="<insert key here>")
91
+ ```
92
+ ````
93
+
94
+
95
+ ## Rekordbox XML
96
+
97
+ The Rekordbox XML database is used for importing (and exporting) Rekordbox collections
98
+ including track metadata and playlists. They can also be used to share playlists
99
+ between two databases.
100
+
101
+ Pyrekordbox can read and write Rekordbox XML databases.
102
+
103
+ ````python
104
+ from pyrekordbox.xml import RekordboxXml
105
+
106
+ xml = RekordboxXml("database.xml")
107
+
108
+ track = xml.get_track(0) # Get track by index (or TrackID)
109
+ track_id = track.TrackID # Access via attribute
110
+ name = track["Name"] # or dictionary syntax
111
+
112
+ path = "/path/to/file.mp3"
113
+ track = xml.add_track(path) # Add new track
114
+ track["Name"] = "Title" # Add attributes to new track
115
+ track["TrackID"] = 10 # Types are handled automatically
116
+
117
+ # Get playlist (folder) by path
118
+ pl = xml.get_playlist("Folder", "Sub Playlist")
119
+ keys = pl.get_tracks() # Get keys of tracks in playlist
120
+ ktype = pl.key_type # Key can either be TrackID or Location
121
+
122
+ # Add tracks and sub-playlists (folders)
123
+ pl.add_track(track.TrackID)
124
+ pl.add_playlist("Sub Sub Playlist")
125
+ ````
126
+
127
+ ## Rekordbox ANLZ files
128
+
129
+ Rekordbox stores analysis information of the tracks in the collection in specific files,
130
+ which also get exported to decives used by Pioneer professional DJ equipment. The files
131
+ have names like `ANLZ0000` and come with the extensions `.DAT`, `.EXT` or `.2EX`.
132
+ They include waveforms, beat grids (information about the precise time at which
133
+ each beat occurs), time indices to allow efficient seeking to specific positions
134
+ inside variable bit-rate audio streams, and lists of memory cues and loop points.
135
+
136
+ Pyrekordbox can parse all three analysis files, although not all the information of
137
+ the tracks can be extracted yet.
138
+
139
+ ````python
140
+ from pyrekordbox.anlz import AnlzFile
141
+
142
+ anlz = AnlzFile.parse_file("ANLZ0000.DAT")
143
+ beat_grid = anlz.get("beat_grid")
144
+ path_tags = anlz.getall_tags("path")
145
+ ````
146
+
147
+ Changing and creating the Rekordbox analysis files is planned as well, but for that the
148
+ full structure of the analysis files has to be understood.
149
+
150
+
151
+ ```{note}
152
+ Some ANLZ tags are still unsupported:
153
+ - PCOB
154
+ - PCO2
155
+ - PSSI
156
+ - PWV6
157
+ - PWV7
158
+ - PWVC
159
+ ```
160
+
161
+
162
+ ## Rekordbox My-Settings
163
+
164
+ Rekordbox stores the user settings in `*SETTING.DAT` files, which get exported to USB
165
+ devices. These files are either in the `PIONEER`directory of a USB drive
166
+ (device exports), but are also present for on local installations of Rekordbox 6.
167
+ The setting files store the settings found on the "DJ System" > "My Settings" page of
168
+ the Rekordbox preferences. These include language, LCD brightness, tempo fader range,
169
+ crossfader curve and other settings for Pioneer professional DJ equipment.
170
+
171
+ Pyrekordbox supports both parsing and writing My-Setting files.
172
+
173
+ ````python
174
+ from pyrekordbox.mysettings import read_mysetting_file
175
+
176
+ mysett = read_mysetting_file("MYSETTINGS.DAT")
177
+ sync = mysett.get("sync")
178
+ quant = mysett.get("quantize")
179
+ ````
180
+
181
+ ```{note}
182
+ The `DEVSETTING.DAT` file is still not supported
183
+ ```
184
+
185
+ [sqlcipher]: https://www.zetetic.net/sqlcipher/open-source/
@@ -0,0 +1,7 @@
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
@@ -0,0 +1,7 @@
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
+ ```