mdl-cli 0.3.0__tar.gz

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 (55) hide show
  1. mdl_cli-0.3.0/.github/workflows/ci.yml +70 -0
  2. mdl_cli-0.3.0/.github/workflows/release.yml +38 -0
  3. mdl_cli-0.3.0/.gitignore +35 -0
  4. mdl_cli-0.3.0/CHANGELOG.md +43 -0
  5. mdl_cli-0.3.0/LICENSE +21 -0
  6. mdl_cli-0.3.0/PKG-INFO +100 -0
  7. mdl_cli-0.3.0/README.md +51 -0
  8. mdl_cli-0.3.0/docs/installation.md +131 -0
  9. mdl_cli-0.3.0/docs/usage.md +240 -0
  10. mdl_cli-0.3.0/mdl/__init__.py +8 -0
  11. mdl_cli-0.3.0/mdl/app.py +50 -0
  12. mdl_cli-0.3.0/mdl/builders/__init__.py +0 -0
  13. mdl_cli-0.3.0/mdl/builders/yt_dlp_audio.py +48 -0
  14. mdl_cli-0.3.0/mdl/builders/yt_dlp_common.py +27 -0
  15. mdl_cli-0.3.0/mdl/builders/yt_dlp_info.py +18 -0
  16. mdl_cli-0.3.0/mdl/builders/yt_dlp_video.py +44 -0
  17. mdl_cli-0.3.0/mdl/cli.py +169 -0
  18. mdl_cli-0.3.0/mdl/commands/__init__.py +13 -0
  19. mdl_cli-0.3.0/mdl/commands/audio.py +8 -0
  20. mdl_cli-0.3.0/mdl/commands/info.py +8 -0
  21. mdl_cli-0.3.0/mdl/commands/settings.py +60 -0
  22. mdl_cli-0.3.0/mdl/commands/smoke.py +8 -0
  23. mdl_cli-0.3.0/mdl/commands/video.py +8 -0
  24. mdl_cli-0.3.0/mdl/core/__init__.py +11 -0
  25. mdl_cli-0.3.0/mdl/core/config.py +90 -0
  26. mdl_cli-0.3.0/mdl/core/config_store.py +175 -0
  27. mdl_cli-0.3.0/mdl/core/options.py +86 -0
  28. mdl_cli-0.3.0/mdl/core/playlist.py +35 -0
  29. mdl_cli-0.3.0/mdl/core/resolve.py +73 -0
  30. mdl_cli-0.3.0/mdl/infra/__init__.py +3 -0
  31. mdl_cli-0.3.0/mdl/infra/runner.py +60 -0
  32. mdl_cli-0.3.0/mdl/services/__init__.py +15 -0
  33. mdl_cli-0.3.0/mdl/services/download_service.py +60 -0
  34. mdl_cli-0.3.0/mdl_cli.egg-info/PKG-INFO +100 -0
  35. mdl_cli-0.3.0/mdl_cli.egg-info/SOURCES.txt +53 -0
  36. mdl_cli-0.3.0/mdl_cli.egg-info/dependency_links.txt +1 -0
  37. mdl_cli-0.3.0/mdl_cli.egg-info/entry_points.txt +2 -0
  38. mdl_cli-0.3.0/mdl_cli.egg-info/requires.txt +7 -0
  39. mdl_cli-0.3.0/mdl_cli.egg-info/top_level.txt +1 -0
  40. mdl_cli-0.3.0/pyproject.toml +56 -0
  41. mdl_cli-0.3.0/setup.cfg +4 -0
  42. mdl_cli-0.3.0/tests/conftest.py +91 -0
  43. mdl_cli-0.3.0/tests/test_app.py +78 -0
  44. mdl_cli-0.3.0/tests/test_builders.py +174 -0
  45. mdl_cli-0.3.0/tests/test_builders_common.py +36 -0
  46. mdl_cli-0.3.0/tests/test_cli.py +116 -0
  47. mdl_cli-0.3.0/tests/test_commands_settings.py +95 -0
  48. mdl_cli-0.3.0/tests/test_commands_wrappers.py +26 -0
  49. mdl_cli-0.3.0/tests/test_core_config.py +67 -0
  50. mdl_cli-0.3.0/tests/test_core_config_store.py +192 -0
  51. mdl_cli-0.3.0/tests/test_core_options.py +59 -0
  52. mdl_cli-0.3.0/tests/test_core_playlist.py +21 -0
  53. mdl_cli-0.3.0/tests/test_core_resolve.py +114 -0
  54. mdl_cli-0.3.0/tests/test_infra_runner.py +72 -0
  55. mdl_cli-0.3.0/tests/test_services_download_service.py +161 -0
@@ -0,0 +1,70 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+
7
+ jobs:
8
+ test:
9
+ runs-on: ${{ matrix.os }}
10
+
11
+ strategy:
12
+ matrix:
13
+ os: [ubuntu-latest, windows-latest, macos-latest]
14
+ python-version: ["3.10", "3.11", "3.12"]
15
+
16
+ steps:
17
+ - name: Checkout
18
+ uses: actions/checkout@v4
19
+ with:
20
+ fetch-depth: 0
21
+
22
+ - name: Setup Python
23
+ uses: actions/setup-python@v5
24
+ with:
25
+ python-version: ${{ matrix.python-version }}
26
+
27
+ # ─────────────────────────────
28
+ # ffmpeg
29
+ # ─────────────────────────────
30
+ - name: Install ffmpeg (Linux)
31
+ if: runner.os == 'Linux'
32
+ run: sudo apt update && sudo apt install -y ffmpeg
33
+
34
+ - name: Install ffmpeg (macOS)
35
+ if: runner.os == 'macOS'
36
+ run: brew install ffmpeg
37
+
38
+ - name: Install ffmpeg (Windows)
39
+ if: runner.os == 'Windows'
40
+ run: choco install ffmpeg
41
+
42
+ # ─────────────────────────────
43
+ # Install project
44
+ # ─────────────────────────────
45
+ - name: Install project
46
+ run: |
47
+ python -m pip install -U pip
48
+ pip install -e ".[dev]"
49
+
50
+ # ─────────────────────────────
51
+ # Tests
52
+ # ─────────────────────────────
53
+ - name: Run tests
54
+ run: python -m pytest -q
55
+
56
+ # ─────────────────────────────
57
+ # CLI real
58
+ # ─────────────────────────────
59
+ - name: CLI check
60
+ run: |
61
+ mdl --help
62
+ mdl --version
63
+
64
+ # ─────────────────────────────
65
+ # Smoke tests
66
+ # ─────────────────────────────
67
+ - name: Smoke test
68
+ run: |
69
+ mdl smoke audio --print
70
+ mdl smoke video --print
@@ -0,0 +1,38 @@
1
+ name: Release to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ jobs:
9
+ publish:
10
+ runs-on: ubuntu-latest
11
+
12
+ permissions:
13
+ contents: read
14
+
15
+ steps:
16
+ - name: Checkout
17
+ uses: actions/checkout@v4
18
+ with:
19
+ fetch-depth: 0
20
+
21
+ - name: Set up Python
22
+ uses: actions/setup-python@v5
23
+ with:
24
+ python-version: "3.12"
25
+
26
+ - name: Install build tools
27
+ run: |
28
+ python -m pip install --upgrade pip
29
+ pip install build twine
30
+
31
+ - name: Build package
32
+ run: python -m build
33
+
34
+ - name: Publish to PyPI
35
+ env:
36
+ TWINE_USERNAME: __token__
37
+ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
38
+ run: twine upload dist/*
@@ -0,0 +1,35 @@
1
+ # Python
2
+ __pycache__/
3
+ *.pyc
4
+ *.pyo
5
+ *.pyd
6
+
7
+ # Virtualenvs
8
+ .venv/
9
+ venv/
10
+
11
+ # OS
12
+ .DS_Store
13
+
14
+ # Editors
15
+ .vscode/
16
+ .idea/
17
+
18
+ # Local logs/output
19
+ *.log
20
+
21
+ # Packaging / build
22
+ build/
23
+ dist/
24
+ *.egg-info/
25
+ .eggs/
26
+
27
+ # Test cache
28
+ .pytest_cache/
29
+ .coverage
30
+ htmlcov/
31
+
32
+ # Envs / tooling
33
+ .env
34
+ .env.*
35
+
@@ -0,0 +1,43 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ## [0.3.0] - 2026-04-13
6
+
7
+ ### Added
8
+ - PyPI packaging support (`pip install` / `pipx install mdl-cli`)
9
+ - Cross-platform CI (Linux, macOS, Windows)
10
+ - Development dependencies (`.[dev]` extras)
11
+
12
+ ## [0.2.0] - 2026-02-17
13
+
14
+ ### Added
15
+ - New `mdl config` command to print the effective persistent configuration as JSON.
16
+ - Added `--mode {auto,album,flat}` to `audio` command to control playlist layout behavior.
17
+ - Playlist downloads now automatically strip a leading `Album - ` prefix from `playlist_title`.
18
+
19
+ ### Changed
20
+ - `mdl info` no longer accepts `--print`; it now always executes `yt-dlp -F`.
21
+ - Audio playlist layout now prefers the primary artist (`artists.0`) to prevent album fragmentation when tracks contain collaborators.
22
+ - Default playlist layout mode for audio is now `auto` (`OLAK...` playlists → album layout, others → flat layout).
23
+ - Video playlists now always use flat single-folder layout.
24
+
25
+ ## [0.1.1] - 2026-02-16
26
+
27
+ ### Fixed
28
+ - Handle `None` correctly in `smoke_kind` conversion.
29
+
30
+ ### Added
31
+ - Unit test suite across core modules (builders, config store, resolve, CLI, services).
32
+ - Coverage reporting via `pytest-cov`.
33
+
34
+ ## [0.1.0] - 2026-02-15
35
+
36
+ ### Added
37
+ - Initial alpha release of mdl-cli
38
+ - `audio`, `video`, `info`, and `smoke` commands
39
+ - Persistent configuration system
40
+ - Safe and fast presets
41
+ - Configurable output directory
42
+ - Optional thumbnail embedding
43
+ - Robust default download flags
mdl_cli-0.3.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Tomás Ezequiel Aguirre
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
mdl_cli-0.3.0/PKG-INFO ADDED
@@ -0,0 +1,100 @@
1
+ Metadata-Version: 2.4
2
+ Name: mdl-cli
3
+ Version: 0.3.0
4
+ Summary: A human-friendly wrapper over yt-dlp.
5
+ Author: Tomás Ezequiel Aguirre
6
+ License: MIT License
7
+
8
+ Copyright (c) 2026 Tomás Ezequiel Aguirre
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Repository, https://github.com/tomieaguirre/mdl-cli
29
+ Keywords: yt-dlp,downloader,cli,audio,video
30
+ Classifier: Development Status :: 3 - Alpha
31
+ Classifier: Environment :: Console
32
+ Classifier: Intended Audience :: End Users/Desktop
33
+ Classifier: License :: OSI Approved :: MIT License
34
+ Classifier: Operating System :: OS Independent
35
+ Classifier: Programming Language :: Python :: 3
36
+ Classifier: Programming Language :: Python :: 3.10
37
+ Classifier: Programming Language :: Python :: 3.11
38
+ Classifier: Programming Language :: Python :: 3.12
39
+ Requires-Python: >=3.10
40
+ Description-Content-Type: text/markdown
41
+ License-File: LICENSE
42
+ Requires-Dist: yt-dlp>=2024.0
43
+ Provides-Extra: dev
44
+ Requires-Dist: pytest>=7; extra == "dev"
45
+ Requires-Dist: pytest-cov>=4; extra == "dev"
46
+ Requires-Dist: ruff>=0.4; extra == "dev"
47
+ Requires-Dist: black>=24.0; extra == "dev"
48
+ Dynamic: license-file
49
+
50
+ [![Python](https://img.shields.io/badge/python-3.10%2B-blue)](https://www.python.org/)
51
+ [![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)
52
+ [![CI](https://github.com/tomieaguirre/mdl-cli/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/tomieaguirre/mdl-cli/actions/workflows/ci.yml?query=branch%3Amain)
53
+
54
+ # mdl-cli
55
+
56
+ `mdl` is a cross-platform CLI wrapper around `yt-dlp` with safer defaults and a simpler command surface.
57
+
58
+ ## Requirements
59
+
60
+ - Python `>=3.10`
61
+ - `ffmpeg` available in `PATH`
62
+
63
+ `mdl` executes `yt-dlp` under the hood. Ensure `yt-dlp` is installed and available in `PATH`.
64
+
65
+ ## Installation
66
+
67
+ Recommended (isolated app install):
68
+
69
+ ```bash
70
+ pipx install mdl-cli
71
+ ```
72
+
73
+ Alternative (standard Python environment):
74
+
75
+ ```bash
76
+ pip install mdl-cli
77
+ ```
78
+
79
+ For OS-specific setup (Python, `ffmpeg`, `yt-dlp`, and verification), see the [Installation Guide](docs/installation.md).
80
+
81
+ ## Basic Usage
82
+
83
+ ```bash
84
+ mdl audio "URL"
85
+ mdl video "URL"
86
+ mdl info "URL"
87
+ mdl --help
88
+ ```
89
+
90
+ Supported platforms: Linux, macOS, and Windows.
91
+
92
+ ## Documentation
93
+
94
+ Full command reference and advanced configuration:
95
+ - [Installation Guide](docs/installation.md)
96
+ - [Usage Guide](docs/usage.md)
97
+
98
+ ## License
99
+
100
+ MIT (see [License](LICENSE))
@@ -0,0 +1,51 @@
1
+ [![Python](https://img.shields.io/badge/python-3.10%2B-blue)](https://www.python.org/)
2
+ [![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)
3
+ [![CI](https://github.com/tomieaguirre/mdl-cli/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/tomieaguirre/mdl-cli/actions/workflows/ci.yml?query=branch%3Amain)
4
+
5
+ # mdl-cli
6
+
7
+ `mdl` is a cross-platform CLI wrapper around `yt-dlp` with safer defaults and a simpler command surface.
8
+
9
+ ## Requirements
10
+
11
+ - Python `>=3.10`
12
+ - `ffmpeg` available in `PATH`
13
+
14
+ `mdl` executes `yt-dlp` under the hood. Ensure `yt-dlp` is installed and available in `PATH`.
15
+
16
+ ## Installation
17
+
18
+ Recommended (isolated app install):
19
+
20
+ ```bash
21
+ pipx install mdl-cli
22
+ ```
23
+
24
+ Alternative (standard Python environment):
25
+
26
+ ```bash
27
+ pip install mdl-cli
28
+ ```
29
+
30
+ For OS-specific setup (Python, `ffmpeg`, `yt-dlp`, and verification), see the [Installation Guide](docs/installation.md).
31
+
32
+ ## Basic Usage
33
+
34
+ ```bash
35
+ mdl audio "URL"
36
+ mdl video "URL"
37
+ mdl info "URL"
38
+ mdl --help
39
+ ```
40
+
41
+ Supported platforms: Linux, macOS, and Windows.
42
+
43
+ ## Documentation
44
+
45
+ Full command reference and advanced configuration:
46
+ - [Installation Guide](docs/installation.md)
47
+ - [Usage Guide](docs/usage.md)
48
+
49
+ ## License
50
+
51
+ MIT (see [License](LICENSE))
@@ -0,0 +1,131 @@
1
+ # Installation
2
+
3
+ ## Requirements
4
+
5
+ - Python 3.10+
6
+ - `ffmpeg` (required for some features)
7
+ - `yt-dlp` available in `PATH`
8
+
9
+ ---
10
+
11
+ ## Install Python
12
+
13
+ ### Linux
14
+
15
+ Use your distribution package manager. Example (Debian/Ubuntu):
16
+
17
+ ```bash
18
+ sudo apt update
19
+ sudo apt install -y python3 python3-pip python3-venv
20
+ ```
21
+
22
+ ### macOS
23
+
24
+ ```bash
25
+ brew install python
26
+ ```
27
+
28
+ ### Windows
29
+
30
+ PowerShell:
31
+
32
+ ```powershell
33
+ winget install -e --id Python.Python.3.12
34
+ ```
35
+
36
+ Manual installer:
37
+ - https://www.python.org/downloads/windows/
38
+
39
+ ---
40
+
41
+ ## Install mdl-cli
42
+
43
+ ### Install pipx (if needed)
44
+
45
+ Linux (Debian/Ubuntu):
46
+
47
+ ```bash
48
+ sudo apt install pipx
49
+ pipx ensurepath
50
+ ```
51
+
52
+ macOS:
53
+
54
+ ```bash
55
+ python3 -m pip install --user pipx
56
+ python3 -m pipx ensurepath
57
+ ```
58
+
59
+ Windows (PowerShell):
60
+
61
+ ```powershell
62
+ py -m pip install --user pipx
63
+ py -m pipx ensurepath
64
+ ```
65
+
66
+ Open a new terminal after `ensurepath`.
67
+
68
+ ### Recommended (pipx)
69
+
70
+ ```bash
71
+ pipx install mdl-cli
72
+ ```
73
+
74
+ ### Alternative (pip)
75
+
76
+ ```bash
77
+ pip install mdl-cli
78
+ ```
79
+
80
+ ---
81
+
82
+ ## Install ffmpeg
83
+
84
+ ### Linux
85
+
86
+ ```bash
87
+ sudo apt install ffmpeg
88
+ ```
89
+
90
+ ### macOS
91
+
92
+ ```bash
93
+ brew install ffmpeg
94
+ ```
95
+
96
+ ### Windows
97
+
98
+ PowerShell:
99
+
100
+ ```powershell
101
+ winget install -e --id Gyan.FFmpeg
102
+ ```
103
+
104
+ Manual install:
105
+ - https://ffmpeg.org/download.html
106
+
107
+ ---
108
+
109
+ ## Install yt-dlp
110
+
111
+ ```bash
112
+ pipx install yt-dlp
113
+ ```
114
+
115
+ If you prefer `pip`:
116
+
117
+ ```bash
118
+ pip install yt-dlp
119
+ ```
120
+
121
+ ---
122
+
123
+ ## Verify Installation
124
+
125
+ ```bash
126
+ python --version
127
+ yt-dlp --version
128
+ ffmpeg -version
129
+ mdl --version
130
+ mdl smoke audio
131
+ ```