lexicon-python 0.5.1__py3-none-any.whl → 0.5.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.
- lexicon/client.py +5 -2
- lexicon/resources/control_types.py +59 -3
- {lexicon_python-0.5.1.dist-info → lexicon_python-0.5.2.dist-info}/METADATA +46 -19
- {lexicon_python-0.5.1.dist-info → lexicon_python-0.5.2.dist-info}/RECORD +7 -7
- {lexicon_python-0.5.1.dist-info → lexicon_python-0.5.2.dist-info}/WHEEL +0 -0
- {lexicon_python-0.5.1.dist-info → lexicon_python-0.5.2.dist-info}/licenses/LICENSE +0 -0
- {lexicon_python-0.5.1.dist-info → lexicon_python-0.5.2.dist-info}/top_level.txt +0 -0
lexicon/client.py
CHANGED
|
@@ -388,8 +388,11 @@ class Lexicon:
|
|
|
388
388
|
target is missing, such as a hotkey for the selected tracks with nothing
|
|
389
389
|
selected, or ``MusicPlayer_Load`` without ``id``.
|
|
390
390
|
|
|
391
|
-
``ControlAction`` follows the newest spec,
|
|
392
|
-
|
|
391
|
+
``ControlAction`` follows the newest spec, plus the Lexicon 1.11
|
|
392
|
+
``Direct2Cdj_*`` names of the ten ``DeckConnect_*`` load actions, so it
|
|
393
|
+
can name actions that the running Lexicon rejects: 1.12 rejects the
|
|
394
|
+
``Direct2Cdj_*`` names, and an older release does not know actions the
|
|
395
|
+
spec added later. See ``docs/api-issues.md``.
|
|
393
396
|
"""
|
|
394
397
|
if validation != "off" and action not in CONTROL_ACTIONS:
|
|
395
398
|
if validation == "strict":
|
|
@@ -5,9 +5,9 @@ from __future__ import annotations
|
|
|
5
5
|
from typing import Literal, get_args
|
|
6
6
|
|
|
7
7
|
# Generated from the Control Actions enum in docs/lexicon-api-docs.yaml by
|
|
8
|
-
# scripts/update_control_actions.py, plus the
|
|
9
|
-
# spec's
|
|
10
|
-
# so a name here can be one the running Lexicon rejects; see docs/api-issues.md.
|
|
8
|
+
# scripts/update_control_actions.py, plus the Direct2Cdj_* names Lexicon 1.11 uses for ten of
|
|
9
|
+
# the spec's DeckConnect_* actions. Do not edit by hand. The list covers several Lexicon
|
|
10
|
+
# versions, so a name here can be one the running Lexicon rejects; see docs/api-issues.md.
|
|
11
11
|
ControlAction = Literal[
|
|
12
12
|
"Appearance_ToggleTheme",
|
|
13
13
|
"Appearance_ToggleCuey",
|
|
@@ -157,6 +157,8 @@ ControlAction = Literal[
|
|
|
157
157
|
"MusicPlayer_Previous",
|
|
158
158
|
"MusicPlayer_TogglePlay",
|
|
159
159
|
"MusicPlayer_Eject",
|
|
160
|
+
"MusicPlayer_PreviewSelected",
|
|
161
|
+
"MusicPlayer_StopPreview",
|
|
160
162
|
"MusicPlayer_ToggleQuantize",
|
|
161
163
|
"MusicPlayer_ToggleActiveLoops",
|
|
162
164
|
"MusicPlayer_Cue",
|
|
@@ -315,6 +317,23 @@ ControlAction = Literal[
|
|
|
315
317
|
"MusicPlayer_AddAndApplyCueTemplate14",
|
|
316
318
|
"MusicPlayer_AddAndApplyCueTemplate15",
|
|
317
319
|
"MusicPlayer_AddAndApplyCueTemplate16",
|
|
320
|
+
"MusicPlayer_ResetCueWithCueTemplate",
|
|
321
|
+
"MusicPlayer_ResetCueWithCueTemplate1",
|
|
322
|
+
"MusicPlayer_ResetCueWithCueTemplate2",
|
|
323
|
+
"MusicPlayer_ResetCueWithCueTemplate3",
|
|
324
|
+
"MusicPlayer_ResetCueWithCueTemplate4",
|
|
325
|
+
"MusicPlayer_ResetCueWithCueTemplate5",
|
|
326
|
+
"MusicPlayer_ResetCueWithCueTemplate6",
|
|
327
|
+
"MusicPlayer_ResetCueWithCueTemplate7",
|
|
328
|
+
"MusicPlayer_ResetCueWithCueTemplate8",
|
|
329
|
+
"MusicPlayer_ResetCueWithCueTemplate9",
|
|
330
|
+
"MusicPlayer_ResetCueWithCueTemplate10",
|
|
331
|
+
"MusicPlayer_ResetCueWithCueTemplate11",
|
|
332
|
+
"MusicPlayer_ResetCueWithCueTemplate12",
|
|
333
|
+
"MusicPlayer_ResetCueWithCueTemplate13",
|
|
334
|
+
"MusicPlayer_ResetCueWithCueTemplate14",
|
|
335
|
+
"MusicPlayer_ResetCueWithCueTemplate15",
|
|
336
|
+
"MusicPlayer_ResetCueWithCueTemplate16",
|
|
318
337
|
"MusicPlayer_LoopDouble",
|
|
319
338
|
"MusicPlayer_LoopHalve",
|
|
320
339
|
"MusicPlayer_LoopCreate",
|
|
@@ -350,6 +369,34 @@ ControlAction = Literal[
|
|
|
350
369
|
"TrackBrowser_TagLookup",
|
|
351
370
|
"TrackBrowser_TagWriter",
|
|
352
371
|
"TrackBrowser_MixableTracks",
|
|
372
|
+
"GhostCurator_ToggleFollow",
|
|
373
|
+
"GhostCurator_ToggleOverlay",
|
|
374
|
+
"GhostCurator_UseSuggestion1",
|
|
375
|
+
"GhostCurator_UseSuggestion2",
|
|
376
|
+
"GhostCurator_UseSuggestion3",
|
|
377
|
+
"GhostCurator_RollDice",
|
|
378
|
+
"GhostCurator_SelectDeck",
|
|
379
|
+
"GhostCurator_SelectDeck1",
|
|
380
|
+
"GhostCurator_SelectDeck2",
|
|
381
|
+
"GhostCurator_SelectDeck3",
|
|
382
|
+
"GhostCurator_SelectDeck4",
|
|
383
|
+
"GhostCurator_NextDeck",
|
|
384
|
+
"GhostCurator_PreviousDeck",
|
|
385
|
+
"GhostCurator_SetEnergyDirection",
|
|
386
|
+
"GhostCurator_SetEnergyDirection_Up",
|
|
387
|
+
"GhostCurator_SetEnergyDirection_Flat",
|
|
388
|
+
"GhostCurator_SetEnergyDirection_Down",
|
|
389
|
+
"GhostCurator_SetEnergyDirection_Any",
|
|
390
|
+
"GhostCurator_SetMinRating",
|
|
391
|
+
"GhostCurator_SetMinRating0",
|
|
392
|
+
"GhostCurator_SetMinRating1",
|
|
393
|
+
"GhostCurator_SetMinRating2",
|
|
394
|
+
"GhostCurator_SetMinRating3",
|
|
395
|
+
"GhostCurator_SetMinRating4",
|
|
396
|
+
"GhostCurator_SetMinRating5",
|
|
397
|
+
"GhostCurator_SwitchMode",
|
|
398
|
+
"GhostCurator_ToggleQuickTag",
|
|
399
|
+
"GhostCurator_LoadSuggestion",
|
|
353
400
|
"TrackBrowser_Relocate",
|
|
354
401
|
"TrackBrowser_OpenFolder",
|
|
355
402
|
"TrackBrowser_SendToNewPlaylist",
|
|
@@ -444,6 +491,15 @@ ControlAction = Literal[
|
|
|
444
491
|
"DeckConnect_LoadDeck7",
|
|
445
492
|
"Direct2Cdj_LoadDeck8",
|
|
446
493
|
"DeckConnect_LoadDeck8",
|
|
494
|
+
"DeckConnect_FindDeckTrack",
|
|
495
|
+
"DeckConnect_FindDeckTrack1",
|
|
496
|
+
"DeckConnect_FindDeckTrack2",
|
|
497
|
+
"DeckConnect_FindDeckTrack3",
|
|
498
|
+
"DeckConnect_FindDeckTrack4",
|
|
499
|
+
"DeckConnect_FindDeckTrack5",
|
|
500
|
+
"DeckConnect_FindDeckTrack6",
|
|
501
|
+
"DeckConnect_FindDeckTrack7",
|
|
502
|
+
"DeckConnect_FindDeckTrack8",
|
|
447
503
|
"AudioAnalyzer_Analyze",
|
|
448
504
|
"PluginRunActionByName",
|
|
449
505
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lexicon-python
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.2
|
|
4
4
|
Summary: Python client for the Lexicon DJ API
|
|
5
5
|
Author-email: Garrison Burger <burgerga123@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -399,14 +399,16 @@ queue = lex.player.queue() # the tracks after the loaded one
|
|
|
399
399
|
lex.control("MusicPlayer_TogglePlay")
|
|
400
400
|
lex.control("MusicPlayer_Load", id=123)
|
|
401
401
|
lex.control("MusicPlayer_Seek", seconds=30)
|
|
402
|
+
lex.control("GhostCurator_LoadSuggestion", index=0, deckNumber=2)
|
|
402
403
|
```
|
|
403
404
|
|
|
404
405
|
It returns `True` when Lexicon accepts the request. Lexicon does not wait for the action to finish and has no completion
|
|
405
406
|
signal, and it accepts an action whose target is missing, such as one for the selected tracks with nothing selected.
|
|
406
|
-
Names are checked against the `ControlAction` list; pass `validation="off"` for one that is not listed. The list
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
407
|
+
Names are checked against the `ControlAction` list; pass `validation="off"` for one that is not listed. The list follows
|
|
408
|
+
the newest API spec, so it can hold actions an older Lexicon does not know, such as `MusicPlayer_PreviewSelected` and
|
|
409
|
+
`DeckConnect_FindDeckTrack`, which the spec published with v1.12.5 added. It also keeps `Direct2Cdj_LoadDeck`,
|
|
410
|
+
`Direct2Cdj_LoadDeck1` to `8`, and `Direct2Cdj_LoadEmptyDeck`, the v1.11 names of the `DeckConnect_*` load actions;
|
|
411
|
+
v1.12 rejects them.
|
|
410
412
|
|
|
411
413
|
## Tools
|
|
412
414
|
|
|
@@ -473,7 +475,7 @@ v1.11 answers differently:
|
|
|
473
475
|
| `playlists.update(position=)` | inserts, others shift | stores the number, positions can overlap |
|
|
474
476
|
| `tags.categories.update(tags=, position=)` | yes | accepted but ignored |
|
|
475
477
|
| Cue `activeLoop` | sent as `true`/`false` | not tested with booleans |
|
|
476
|
-
| DeckConnect actions | `DeckConnect_*` | `Direct2Cdj_*`
|
|
478
|
+
| DeckConnect actions | `DeckConnect_*` | `Direct2Cdj_*` for the ten load actions |
|
|
477
479
|
|
|
478
480
|
## Type Hints
|
|
479
481
|
|
|
@@ -514,19 +516,43 @@ The lockfile (`uv.lock`) is checked in to ensure reproducible installs.
|
|
|
514
516
|
### Running Tests
|
|
515
517
|
|
|
516
518
|
```bash
|
|
517
|
-
#
|
|
518
|
-
make run-tests
|
|
519
|
-
|
|
520
|
-
# Integration tests (requires Lexicon running)
|
|
521
|
-
# Note: Integration tests enforce an empty library state to avoid destructive edits on existing libraries.
|
|
522
|
-
# The fixture setup will back up the existing library, clear it for testing, and restore it afterward.
|
|
523
|
-
make run-integration-tests
|
|
519
|
+
make run-tests # unit tests, no Lexicon needed
|
|
520
|
+
make run-integration-tests # integration tests, against Lexicon with an empty test library open (see below)
|
|
524
521
|
```
|
|
525
522
|
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
523
|
+
#### Integration tests
|
|
524
|
+
|
|
525
|
+
The integration tests add, edit and delete tracks, playlists and tags in the library Lexicon has open, and several of
|
|
526
|
+
them delete every track in it. They run only on an empty library made for them, so they need Lexicon v1.12 or newer with
|
|
527
|
+
Multi Library and the Local API turned on.
|
|
528
|
+
|
|
529
|
+
CI cannot run them, because they need the Lexicon app. Run them yourself when a change touches what the client sends to
|
|
530
|
+
Lexicon or reads back, and after a new Lexicon release.
|
|
531
|
+
|
|
532
|
+
One-time setup:
|
|
533
|
+
|
|
534
|
+
1. In the Lexicon settings, under `Advanced`, turn on `Multi Library` and restart Lexicon when asked.
|
|
535
|
+
2. Go to `File` > `Library` > `Manage libraries`, click `Add library`, enter a `Library name` (for example
|
|
536
|
+
`lexicon-python tests`) and click `Create library`. Leave it empty.
|
|
537
|
+
|
|
538
|
+
Each run:
|
|
539
|
+
|
|
540
|
+
1. Switch Lexicon to the test library in `File` > `Library`. Lexicon restarts to open it.
|
|
541
|
+
2. Run `make run-integration-tests`.
|
|
542
|
+
3. Switch back to your own library (`Main Library`, unless you renamed it) the same way.
|
|
543
|
+
|
|
544
|
+
The first run shows Lexicon's popup asking to allow the app "lexicon-python integration tests"; allow it. The tests wait
|
|
545
|
+
up to a minute for the answer. Lexicon keeps approvals outside the libraries, so later runs do not ask again.
|
|
546
|
+
|
|
547
|
+
Before the first test, the harness checks that the open library has no tracks, archived ones included. If it finds any,
|
|
548
|
+
cannot reach Lexicon, or cannot complete the check, it stops the run with one message that says what it found, and
|
|
549
|
+
nothing is written. It never switches libraries, quits or launches Lexicon, or touches Lexicon's files.
|
|
550
|
+
|
|
551
|
+
The harness deletes the playlists, tags and tag categories the tests create, found by name (playlists and tags starting
|
|
552
|
+
with `IntTest`, tag categories starting with `Integration`), before the first test and again after the last one. After
|
|
553
|
+
the last one it also deletes every track. The end cleanup runs when tests fail or the run is interrupted with Ctrl-C; if
|
|
554
|
+
it fails, the run ends with an error that lists what was left. A run that is killed outright can leave tracks behind,
|
|
555
|
+
and the next run then refuses to start: delete them in Lexicon, in the test library.
|
|
530
556
|
|
|
531
557
|
### Linting and Formatting
|
|
532
558
|
|
|
@@ -573,10 +599,11 @@ The ruff version is pinned in `.pre-commit-config.yaml`; bump it when CI bumps t
|
|
|
573
599
|
|
|
574
600
|
GitHub Actions runs on every push to `main` and on pull requests targeting those branches. The pipeline includes:
|
|
575
601
|
|
|
576
|
-
- **
|
|
602
|
+
- **Unit tests** across Python 3.10, 3.11, 3.12, 3.13, and 3.14
|
|
577
603
|
- **Lint and format checks** via ruff on Python 3.12
|
|
578
604
|
|
|
579
|
-
Before opening a PR, make sure `make test` passes locally
|
|
605
|
+
CI does not run the integration tests. Before opening a PR, make sure `make test` passes locally, and run the
|
|
606
|
+
[integration tests](#integration-tests) if the change touches what the client sends to Lexicon or reads back.
|
|
580
607
|
|
|
581
608
|
### Pull Requests
|
|
582
609
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
lexicon/__init__.py,sha256=Jels1Jj_rgyhe_LdiuperEIXVOl7gcDrL30xbFwJ5ng,1232
|
|
2
|
-
lexicon/client.py,sha256=
|
|
2
|
+
lexicon/client.py,sha256=kddTx-YPPc5FqUBJMB2qSzAHdo-rYgQtr3tAtt71zvM,19643
|
|
3
3
|
lexicon/colors.py,sha256=xbw6Z926xkwXOeHF9OSO3lW2zau0FBj3M0LQcaxGL6o,977
|
|
4
4
|
lexicon/utils.py,sha256=cLMW_Dbi_fI_HPWICXOtjptiokTVI9JiB_FRbRaEfUU,428
|
|
5
5
|
lexicon/resources/__init__.py,sha256=R8JvEZbzFLeDG7H_NPNAv-6OltIgT0511CO-leTx9Cw,343
|
|
6
6
|
lexicon/resources/_common_types.py,sha256=2hVb6s7GWLrYuMLH8f7gfjM-ydRN6jK-AE4fF5XplgI,6653
|
|
7
7
|
lexicon/resources/base.py,sha256=cjsGZFUrWUvy0FZbHjAqg-XZFsgOSApccHWMw0qPRAE,1990
|
|
8
|
-
lexicon/resources/control_types.py,sha256=
|
|
8
|
+
lexicon/resources/control_types.py,sha256=eoeIbwlwJUtZbbogPiMA3bPCqi_9LW7LLcnYo5BMynM,18209
|
|
9
9
|
lexicon/resources/player.py,sha256=UExYP71w5WJIDFrhZ-oJWaYZ0AUVhT50HbkpbIEJvXc,3306
|
|
10
10
|
lexicon/resources/player_types.py,sha256=mQfZifiBFbhsluoeM_LzuYpx3QUVDRBTyTMyWADrrfQ,1568
|
|
11
11
|
lexicon/resources/playlist_tracks.py,sha256=3LKuOGcx_nd_rPJAHF0PGpYdQ7GwphEFPg1RaJfCN2U,11079
|
|
@@ -22,8 +22,8 @@ lexicon/tools/__init__.py,sha256=jniJDnb9RFx36H6ANreGwV9bibSZB3ADQimEsaXJ2Tw,44
|
|
|
22
22
|
lexicon/tools/playlists.py,sha256=WfrlTnQ8h5emhtVSXvnPEQBeCuKLG4MdSjZe_CXFNHY,5374
|
|
23
23
|
lexicon/tools/tempo.py,sha256=D4SnNHu-NqbvP6QLEQzAifhkRy2phzos6TwGMfQLeQ0,2684
|
|
24
24
|
lexicon/tools/tracks.py,sha256=ySFf9wV17NIcmoW_N3fzFgaHzSjMl69ObeDdkrfswMw,4141
|
|
25
|
-
lexicon_python-0.5.
|
|
26
|
-
lexicon_python-0.5.
|
|
27
|
-
lexicon_python-0.5.
|
|
28
|
-
lexicon_python-0.5.
|
|
29
|
-
lexicon_python-0.5.
|
|
25
|
+
lexicon_python-0.5.2.dist-info/licenses/LICENSE,sha256=SnZvUu04t9ENhnrmuLMoz2E6pAYcEIX8UGBl0P4D43c,1072
|
|
26
|
+
lexicon_python-0.5.2.dist-info/METADATA,sha256=OEJK6Ahxh63aPChhBDA4oKQngHR48Dra94EHoDSWTTA,26439
|
|
27
|
+
lexicon_python-0.5.2.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
28
|
+
lexicon_python-0.5.2.dist-info/top_level.txt,sha256=Ry_712VYZowp819R6r0kTIdSPW_kSEKdC_k6MVSYvYo,8
|
|
29
|
+
lexicon_python-0.5.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|