TonieToolbox 0.3.0__py3-none-any.whl → 0.4.1__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: TonieToolbox
3
- Version: 0.3.0
3
+ Version: 0.4.1
4
4
  Summary: Convert audio files to Tonie box compatible format
5
5
  Home-page: https://github.com/Quentendo64/TonieToolbox
6
6
  Author: Quentendo64
@@ -20,6 +20,7 @@ Requires-Python: >=3.6
20
20
  Description-Content-Type: text/markdown
21
21
  License-File: LICENSE.md
22
22
  Requires-Dist: protobuf<=3.19.0
23
+ Requires-Dist: mutagen>=1.47.0
23
24
  Dynamic: author
24
25
  Dynamic: home-page
25
26
  Dynamic: license-file
@@ -42,12 +43,15 @@ A Python tool for converting audio files to Tonie box compatible format (TAF - T
42
43
  - [Installation](#installation)
43
44
  - [Install from PyPI (Recommended)](#install-from-pypi-recommended)
44
45
  - [Install from Source](#install-from-source)
46
+ - [Using Docker](#using-docker)
45
47
  - [Usage](#usage)
46
48
  - [Basic Usage](#basic-usage)
49
+ - [Docker Usage](#docker-usage)
47
50
  - [Advanced Options](#advanced-options)
48
51
  - [Common Usage Examples](#common-usage-examples)
49
52
  - [Media Tags](#media-tags)
50
53
  - [TeddyCloud Upload](#teddycloud-upload)
54
+ - [Real-World Use Cases](#real-world-use-cases)
51
55
  - [Technical Details](#technical-details)
52
56
  - [TAF File Structure](#taf-tonie-audio-format-file-structure)
53
57
  - [File Analysis](#file-analysis)
@@ -105,6 +109,32 @@ cd TonieToolbox
105
109
  pip install protobuf
106
110
  ```
107
111
 
112
+ ### Using Docker
113
+
114
+ TonieToolbox is available as a Docker image, which comes with all dependencies pre-installed.
115
+
116
+ #### Pull the Docker Image
117
+
118
+ ```
119
+ # From Docker Hub
120
+ docker pull quentendo64/tonietoolbox:latest
121
+
122
+ # From GitHub Packages
123
+ docker pull ghcr.io/quentendo64/tonietoolbox:latest
124
+ ```
125
+
126
+ #### Build the Docker Image Locally
127
+
128
+ ```
129
+ docker build -t tonietoolbox .
130
+ ```
131
+
132
+ Or using docker-compose:
133
+
134
+ ```
135
+ docker-compose build
136
+ ```
137
+
108
138
  ## Usage
109
139
 
110
140
  ### Basic Usage
@@ -161,6 +191,41 @@ By default, all generated TAF files are saved in the `.\output` directory. If yo
161
191
  tonietoolbox --recursive --output-to-source "Music/Albums"
162
192
  ```
163
193
 
194
+ ### Docker Usage
195
+
196
+ Using TonieToolbox with Docker simplifies the setup process as all dependencies (FFmpeg and opus-tools) are pre-installed.
197
+
198
+ **Convert a single audio file to Tonie format:**
199
+
200
+ ```bash
201
+ # Use docker run
202
+ docker run --rm -v "$(pwd)/input:/tonietoolbox/input" -v "$(pwd)/output:/tonietoolbox/output" quentendo64/tonietoolbox input/my-audio-file.mp3
203
+
204
+ # Or using docker-compose
205
+ docker-compose run --rm tonietoolbox input/my-audio-file.mp3
206
+ ```
207
+
208
+ **Process folders recursively:**
209
+
210
+ ```bash
211
+ # Use docker run
212
+ docker run --rm -v "$(pwd)/input:/tonietoolbox/input" -v "$(pwd)/output:/tonietoolbox/output" quentendo64/tonietoolbox --recursive input/folder
213
+
214
+ ```
215
+
216
+ **Advanced options with Docker:**
217
+
218
+ ```bash
219
+ # Convert with custom settings
220
+ docker run --rm -v "$(pwd)/input:/tonietoolbox/input" -v "$(pwd)/output:/tonietoolbox/output" quentendo64/tonietoolbox --recursive --use-media-tags --name-template "{album} - {artist}" --bitrate 128 input/folder
221
+ ```
222
+
223
+ **Upload to TeddyCloud with Docker:**
224
+
225
+ ```bash
226
+ docker run --rm -v "$(pwd)/input:/tonietoolbox/input" -v "$(pwd)/output:/tonietoolbox/output" quentendo64/tonietoolbox input/my-audio-file.mp3 --upload https://teddycloud.example.com --include-artwork
227
+ ```
228
+
164
229
  ### Advanced Options
165
230
 
166
231
  Run the following command to see all available options:
@@ -175,10 +240,10 @@ usage: TonieToolbox.py [-h] [-v] [--upload URL] [--include-artwork] [--get-tags
175
240
  [--ignore-ssl-verify] [--special-folder FOLDER] [--path PATH]
176
241
  [--show-progress] [--connection-timeout SECONDS]
177
242
  [--read-timeout SECONDS] [--max-retries RETRIES]
178
- [--retry-delay SECONDS] [-t TIMESTAMP] [-f FFMPEG] [-o OPUSENC]
179
- [-b BITRATE] [-c] [-a TAG] [-n] [-i] [-s] [-r] [-O]
180
- [-A] [-k] [-C FILE2] [-D] [-m] [--name-template TEMPLATE]
181
- [--show-tags] [-d] [-T] [-q] [-Q]
243
+ [--retry-delay SECONDS] [--create-custom-json] [-t TIMESTAMP] [-f FFMPEG]
244
+ [-o OPUSENC] [-b BITRATE] [-c] [-a TAG] [-n] [-i] [-s] [-r] [-O]
245
+ [-A] [-k] [-u] [-C FILE2] [-D] [-m] [--name-template TEMPLATE]
246
+ [--show-tags] [-S] [-F] [-X] [-d] [-T] [-q] [-Q]
182
247
  SOURCE [TARGET]
183
248
 
184
249
  Create Tonie compatible file from Ogg opus file(s).
@@ -204,6 +269,7 @@ TeddyCloud Options:
204
269
  Maximum number of retry attempts (default: 3)
205
270
  --retry-delay SECONDS
206
271
  Delay between retry attempts in seconds (default: 5)
272
+ --create-custom-json Fetch and update custom Tonies JSON data
207
273
 
208
274
  optional arguments:
209
275
  -h, --help show this help message and exit
@@ -224,10 +290,10 @@ optional arguments:
224
290
  Save output files in the source directory instead of output directory
225
291
  -A, --auto-download Automatically download FFmpeg and opusenc if needed
226
292
  -k, --keep-temp Keep temporary opus files in a temp folder for testing
293
+ -u, --use-legacy-tags Use legacy hardcoded tags instead of dynamic TonieToolbox tags (DEPRECATED)
227
294
  -C, --compare FILE2 Compare input file with another .taf file for debugging
228
295
  -D, --detailed-compare
229
296
  Show detailed OGG page differences when comparing files
230
-
231
297
  Media Tag Options:
232
298
  -m, --use-media-tags Use media tags from audio files for naming
233
299
  --name-template TEMPLATE
@@ -247,6 +313,7 @@ Logging Options:
247
313
  -T, --trace Enable trace logging (very verbose)
248
314
  -q, --quiet Show only warnings and errors
249
315
  -Q, --silent Show only errors
316
+ --log-file Save logs to a timestamped file in .tonietoolbox folder
250
317
  ```
251
318
 
252
319
  ### Common Usage Examples
@@ -291,6 +358,29 @@ tonietoolbox input.mp3 --timestamp ./reference.taf # Reference TAF for extracti
291
358
  tonietoolbox input.mp3 --bitrate 128
292
359
  ```
293
360
 
361
+ #### Constant bitrate encoding:
362
+
363
+ For more predictable file sizes and consistent quality, use constant bitrate (CBR) encoding:
364
+
365
+ ```
366
+ # Encode with constant bitrate at 96 kbps (default)
367
+ tonietoolbox input.mp3 --cbr
368
+
369
+ # Encode with constant bitrate at 128 kbps
370
+ tonietoolbox input.mp3 --cbr --bitrate 128
371
+ ```
372
+
373
+ #### Append Tonie tag:
374
+
375
+ You can append a hexadecimal tag to the filename, which is useful for organizing Tonie files:
376
+
377
+ ```
378
+ # Add an 8-character hex tag to filename
379
+ tonietoolbox input.mp3 --append-tonie-tag 7F8A6B2E
380
+
381
+ # The output will be named "input-7F8A6B2E.taf"
382
+ ```
383
+
294
384
  #### Process a complex folder structure:
295
385
 
296
386
  Process an audiobook series with multiple folders:
@@ -302,7 +392,128 @@ tonietoolbox --recursive "\Hörspiele\Die drei Fragezeichen\Folgen"
302
392
  Process a music collection with nested album folders and save TAF files alongside the source directories:
303
393
 
304
394
  ```
305
- tonietoolbox --recursive --output-to-source "\Hörspiele\"
395
+ tonietoolbox --recursive --output-to-source "\Hörspiele\"
396
+ ```
397
+
398
+ #### Automatic dependency download:
399
+
400
+ If FFmpeg or opusenc are not found in your PATH, TonieToolbox can automatically download them:
401
+
402
+ ```
403
+ # Automatically download dependencies when needed
404
+ tonietoolbox input.mp3 --auto-download
405
+
406
+ # Specify custom FFmpeg or opusenc locations
407
+ tonietoolbox input.mp3 --ffmpeg "C:\path\to\ffmpeg.exe" --opusenc "C:\path\to\opusenc.exe"
408
+ ```
409
+
410
+ #### Keep temporary files:
411
+
412
+ When troubleshooting or debugging, you can keep the temporary opus files:
413
+
414
+ ```
415
+ # Keep temporary opus files in the temp folder
416
+ tonietoolbox input.mp3 --keep-temp
417
+
418
+ ```
419
+
420
+ #### Working with list files:
421
+
422
+ Create a text file (.lst) with paths to audio files for batch processing:
423
+
424
+ ```
425
+ # Contents of playlist.lst:
426
+ C:\Music\song1.mp3
427
+ "C:\Music\song2.flac"
428
+ C:\Music\song3.wav
429
+ "C:\Music Path With Spaces\song2.flac"
430
+
431
+ # Process the list file
432
+ tonietoolbox playlist.lst my_playlist.taf
433
+ ```
434
+
435
+ #### TeddyCloud advanced options:
436
+
437
+ Customize your TeddyCloud uploads with connection options:
438
+
439
+ ```
440
+ # Upload with custom timeouts and retry parameters
441
+ tonietoolbox my_tonie.taf --upload https://teddycloud.example.com --connection-timeout 20 --read-timeout 600 --max-retries 5 --retry-delay 10
442
+
443
+ # Disable progress bar during upload
444
+ tonietoolbox my_tonie.taf --upload https://teddycloud.example.com --show-progress=False
445
+
446
+ # Upload to a special folder in TeddyCloud
447
+ tonietoolbox my_tonie.taf --upload https://teddycloud.example.com --special-folder library
448
+ ```
449
+
450
+ #### Get available tags from TeddyCloud:
451
+
452
+ To see which tags you can use with your TeddyCloud server:
453
+
454
+ ```
455
+ tonietoolbox --get-tags https://teddycloud.example.com
456
+ ```
457
+
458
+ #### Version checking and updates:
459
+
460
+ TonieToolbox can check for newer versions and notify you when there are updates available:
461
+
462
+ ```
463
+ # Skip checking for updates if you're offline or want faster startup
464
+ tonietoolbox input.mp3 --skip-update-check
465
+
466
+ # Force refresh of version information from PyPI
467
+ tonietoolbox input.mp3 --force-refresh-cache
468
+
469
+ # Clear cached version information
470
+ tonietoolbox --clear-version-cache
471
+ ```
472
+
473
+ #### Legacy tag options:
474
+
475
+ Use legacy hardcoded tags instead of dynamic TonieToolbox tags:
476
+
477
+ ```
478
+ tonietoolbox input.mp3 --use-legacy-tags
479
+ ```
480
+
481
+ #### Create custom JSON data:
482
+
483
+ When uploading to TeddyCloud, you can also update the custom Tonies JSON data with information about the uploaded file:
484
+
485
+ ```
486
+ tonietoolbox input.mp3 --upload https://teddycloud.example.com --create-custom-json
487
+ ```
488
+
489
+ This will fetch and update the custom Tonies JSON data in the TeddyCloud server with information from your audio files.
490
+
491
+ #### Logging and Troubleshooting:
492
+
493
+ Control the verbosity of console output with different logging levels:
494
+
495
+ ```
496
+ # Enable detailed debug information (useful for troubleshooting)
497
+ tonietoolbox input.mp3 --debug
498
+
499
+ # Enable extremely verbose trace logging (developer level)
500
+ tonietoolbox input.mp3 --trace
501
+
502
+ # Reduce output to show only warnings and errors
503
+ tonietoolbox input.mp3 --quiet
504
+
505
+ # Show only critical errors (minimal output)
506
+ tonietoolbox input.mp3 --silent
507
+ ```
508
+
509
+ You can combine logging options with other commands:
510
+
511
+ ```
512
+ # Debug mode while splitting a TAF file
513
+ tonietoolbox --split my_tonie.taf --debug
514
+
515
+ # Quiet mode while batch processing
516
+ tonietoolbox --recursive "Music/Collection/" --quiet
306
517
  ```
307
518
 
308
519
  ### Media Tags
@@ -410,6 +621,52 @@ tonietoolbox my_tonie.taf --upload https://teddycloud.example.com --ignore-ssl-v
410
621
 
411
622
  Use this option if the TeddyCloud server uses a self-signed certificate.
412
623
 
624
+ ## Real-World Use Cases
625
+
626
+ ### Converting an Audiobook Series
627
+
628
+ To convert an entire audiobook series with proper metadata and upload to TeddyCloud:
629
+
630
+ ```
631
+ tonietoolbox --recursive --use-media-tags --name-template "{YEAR} - {ALBUMARTIST} - {ALBUM}" --bitrate 128 --upload https://teddycloud.example.com --include-artwork "C:\Hörspiele\Die Drei Fragezeichen"
632
+ ```
633
+
634
+ This command will:
635
+ 1. Recursively process the Die Drei Fragezeichen audioplays directory
636
+ 2. Use a naming template based on source metadata
637
+ 3. Encode at 128 kbps
638
+ 4. Upload both audio files and cover art to TeddyCloud
639
+
640
+ ### Creating Children's Story Collections
641
+
642
+ For a custom children's story collection with chapters:
643
+
644
+ ```
645
+ tonietoolbox story_collection.lst kids_stories.taf --bitrate 96 --cbr --auto-download --use-media-tags --name-template "{title} Stories" --debug
646
+ ```
647
+
648
+ This command:
649
+ 1. Processes a list of story audio files
650
+ 2. Names the output based on metadata
651
+ 3. Uses constant bitrate encoding for consistent quality
652
+ 4. Automatically downloads dependencies if needed
653
+ 5. Shows detailed debug information during the process
654
+
655
+
656
+ ### Advanced Media Tag Usage
657
+
658
+ For complex media tag processing:
659
+
660
+ ```
661
+ # First check available tags
662
+ tonietoolbox --show-tags "C:\Music\Classical\Bach"
663
+
664
+ # Then use a sophisticated naming template
665
+ tonietoolbox "C:\Music\Classical\Bach" --use-media-tags --name-template "{composer} - {opus} in {key} ({conductor}, {orchestra})"
666
+ ```
667
+
668
+ The first command shows what tags are available, allowing you to create precise naming templates for classical music collections as example.
669
+
413
670
  ## Technical Details
414
671
 
415
672
  ### TAF (Tonie Audio Format) File Structure
@@ -0,0 +1,24 @@
1
+ TonieToolbox/__init__.py,sha256=J5dz_xd-IvgNUuHuz0CdoFGZceDpI0_ESj_3jo_OAKo,96
2
+ TonieToolbox/__main__.py,sha256=71HjJZFNfdflCbwuL28xHpKkwLIKAXW6sVpGX9TQRII,37202
3
+ TonieToolbox/audio_conversion.py,sha256=nV87LTzuxeJQughu-esxTq2aZq-BvaTURj-pvBqygQs,13075
4
+ TonieToolbox/constants.py,sha256=BQ6eUNvT3eXgsz8KFYMrqpn5vRPXrp2d6folxP6H03E,4374
5
+ TonieToolbox/dependency_manager.py,sha256=EvVUO4T1CrhUXlrVk9HBgCRDER3b1BRNdgkZLSpCTho,27921
6
+ TonieToolbox/filename_generator.py,sha256=RqQHyGTKakuWR01yMSnFVMU_HfLw3rqFxKhXNIHdTlg,3441
7
+ TonieToolbox/logger.py,sha256=eZoQj4xICKEZ645GhIfZhAPAjgbgjnnfTXZ_soPjyDg,3017
8
+ TonieToolbox/media_tags.py,sha256=PnvdHh_1RV3Fi-Wkqz5DMDjSksLsmWPrApv-6BA82jE,23206
9
+ TonieToolbox/ogg_page.py,sha256=-ViaIRBgh5ayfwmyplL8QmmRr5P36X8W0DdHkSFUYUU,21948
10
+ TonieToolbox/opus_packet.py,sha256=OcHXEe3I_K4mWPUD55prpG42sZxJsEeAxqSbFxBmb0c,7895
11
+ TonieToolbox/recursive_processor.py,sha256=m70-oJ4MRXvI9OMy14sC9UsQIxwVEnEoA3hhLGdHhL4,13457
12
+ TonieToolbox/teddycloud.py,sha256=ATfCLKecjBZRwIzhPkNcOKELRSbnmIyeQh-1imuTe9A,27281
13
+ TonieToolbox/tonie_analysis.py,sha256=kp4Wx4cTDddtF2AlS6IX4xs1vQ-mpZ0gsAy4-UdRAAM,23287
14
+ TonieToolbox/tonie_file.py,sha256=_LyIsUp2NmpkUVViiLY7EhXitrY4S27xKG5lvZdECJE,21031
15
+ TonieToolbox/tonie_header.proto,sha256=WaWfwO4VrwGtscK2ujfDRKtpeBpaVPoZhI8iMmR-C0U,202
16
+ TonieToolbox/tonie_header_pb2.py,sha256=s5bp4ULTEekgq6T61z9fDkRavyPM-3eREs20f_Pxxe8,3665
17
+ TonieToolbox/tonies_json.py,sha256=AAYPTDTVZg4sm5AAnUKPPAifTM1iLh6Oa96ic84K2m0,20673
18
+ TonieToolbox/version_handler.py,sha256=7Zx-pgzAUhz6jMplvNal1wHyxidodVxaNcAV0EMph5k,9778
19
+ tonietoolbox-0.4.1.dist-info/licenses/LICENSE.md,sha256=rGoga9ZAgNco9fBapVFpWf6ri7HOBp1KRnt1uIruXMk,35190
20
+ tonietoolbox-0.4.1.dist-info/METADATA,sha256=qveJ2gYUaso5-UsLJevMumuiHNsbh75m13piICWknSg,24105
21
+ tonietoolbox-0.4.1.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
22
+ tonietoolbox-0.4.1.dist-info/entry_points.txt,sha256=oqpeyBxel7aScg35Xr4gZKnf486S5KW9okqeBwyJxxc,60
23
+ tonietoolbox-0.4.1.dist-info/top_level.txt,sha256=Wkkm-2p7I3ENfS7ZbYtYUB2g-xwHrXVlERHfonsOPuE,13
24
+ tonietoolbox-0.4.1.dist-info/RECORD,,
@@ -1,23 +0,0 @@
1
- TonieToolbox/__init__.py,sha256=1DGgQLdpAkK84simgtWndHZBKXuXCb-jPnMK_wvNOWc,96
2
- TonieToolbox/__main__.py,sha256=Y6-gjbjNbKhpEvV6wi8BpZSUXXezxfgZT5g8HfMeO4E,34078
3
- TonieToolbox/audio_conversion.py,sha256=ra72qsE8j2GEP_4kqDT9m6aKlnnREZhZAlpf7y83pA0,11202
4
- TonieToolbox/constants.py,sha256=QQWQpnCI65GByLlXLOkt2n8nALLu4m6BWp0zuhI3M04,2021
5
- TonieToolbox/dependency_manager.py,sha256=EvVUO4T1CrhUXlrVk9HBgCRDER3b1BRNdgkZLSpCTho,27921
6
- TonieToolbox/filename_generator.py,sha256=RqQHyGTKakuWR01yMSnFVMU_HfLw3rqFxKhXNIHdTlg,3441
7
- TonieToolbox/logger.py,sha256=Up9fBVkOZwkY61_645bX4tienCpyVSkap-FeTV0v730,1441
8
- TonieToolbox/media_tags.py,sha256=XzCuBcaqBPiSCBip8rWrJ3hTHDwEEN1flyPywM7CMsg,22250
9
- TonieToolbox/ogg_page.py,sha256=-ViaIRBgh5ayfwmyplL8QmmRr5P36X8W0DdHkSFUYUU,21948
10
- TonieToolbox/opus_packet.py,sha256=OcHXEe3I_K4mWPUD55prpG42sZxJsEeAxqSbFxBmb0c,7895
11
- TonieToolbox/recursive_processor.py,sha256=m70-oJ4MRXvI9OMy14sC9UsQIxwVEnEoA3hhLGdHhL4,13457
12
- TonieToolbox/teddycloud.py,sha256=YRgOU3f1qVDSoV05mCCDHb4pd00aI_oD8HViIotvez4,23366
13
- TonieToolbox/tonie_analysis.py,sha256=kp4Wx4cTDddtF2AlS6IX4xs1vQ-mpZ0gsAy4-UdRAAM,23287
14
- TonieToolbox/tonie_file.py,sha256=vY0s8X4ln35ZXpdpGmBcIxgpTJAjduiVvBh34WObyrw,19647
15
- TonieToolbox/tonie_header.proto,sha256=WaWfwO4VrwGtscK2ujfDRKtpeBpaVPoZhI8iMmR-C0U,202
16
- TonieToolbox/tonie_header_pb2.py,sha256=s5bp4ULTEekgq6T61z9fDkRavyPM-3eREs20f_Pxxe8,3665
17
- TonieToolbox/version_handler.py,sha256=7Zx-pgzAUhz6jMplvNal1wHyxidodVxaNcAV0EMph5k,9778
18
- tonietoolbox-0.3.0.dist-info/licenses/LICENSE.md,sha256=rGoga9ZAgNco9fBapVFpWf6ri7HOBp1KRnt1uIruXMk,35190
19
- tonietoolbox-0.3.0.dist-info/METADATA,sha256=17k_CP3FXVhfO60HrS3CWP1bfN-pGNwNFwtfd9QzQj4,16695
20
- tonietoolbox-0.3.0.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
21
- tonietoolbox-0.3.0.dist-info/entry_points.txt,sha256=oqpeyBxel7aScg35Xr4gZKnf486S5KW9okqeBwyJxxc,60
22
- tonietoolbox-0.3.0.dist-info/top_level.txt,sha256=Wkkm-2p7I3ENfS7ZbYtYUB2g-xwHrXVlERHfonsOPuE,13
23
- tonietoolbox-0.3.0.dist-info/RECORD,,