propresenter-client 0.1.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.
- propresenter_client-0.1.0/.github/workflows/ci.yml +34 -0
- propresenter_client-0.1.0/.github/workflows/publish.yml +56 -0
- propresenter_client-0.1.0/.gitignore +134 -0
- propresenter_client-0.1.0/Claude.md +106 -0
- propresenter_client-0.1.0/LICENSE +21 -0
- propresenter_client-0.1.0/PKG-INFO +156 -0
- propresenter_client-0.1.0/README.md +128 -0
- propresenter_client-0.1.0/pyproject.toml +51 -0
- propresenter_client-0.1.0/setup.cfg +4 -0
- propresenter_client-0.1.0/src/propresenter_client/__init__.py +10 -0
- propresenter_client-0.1.0/src/propresenter_client/main.py +583 -0
- propresenter_client-0.1.0/src/propresenter_client.egg-info/PKG-INFO +156 -0
- propresenter_client-0.1.0/src/propresenter_client.egg-info/SOURCES.txt +19 -0
- propresenter_client-0.1.0/src/propresenter_client.egg-info/dependency_links.txt +1 -0
- propresenter_client-0.1.0/src/propresenter_client.egg-info/entry_points.txt +2 -0
- propresenter_client-0.1.0/src/propresenter_client.egg-info/requires.txt +6 -0
- propresenter_client-0.1.0/src/propresenter_client.egg-info/scm_file_list.json +15 -0
- propresenter_client-0.1.0/src/propresenter_client.egg-info/scm_version.json +8 -0
- propresenter_client-0.1.0/src/propresenter_client.egg-info/top_level.txt +1 -0
- propresenter_client-0.1.0/tests/__init__.py +0 -0
- propresenter_client-0.1.0/tests/test_propresenter_controller.py +456 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
fail-fast: false
|
|
14
|
+
matrix:
|
|
15
|
+
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
with:
|
|
20
|
+
fetch-depth: 0
|
|
21
|
+
|
|
22
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
23
|
+
uses: actions/setup-python@v5
|
|
24
|
+
with:
|
|
25
|
+
python-version: ${{ matrix.python-version }}
|
|
26
|
+
cache: pip
|
|
27
|
+
|
|
28
|
+
- name: Install package with dev dependencies
|
|
29
|
+
run: |
|
|
30
|
+
python -m pip install --upgrade pip
|
|
31
|
+
pip install -e ".[dev]"
|
|
32
|
+
|
|
33
|
+
- name: Run tests
|
|
34
|
+
run: pytest --cov=propresenter_client --cov-report=term-missing
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
name: Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
with:
|
|
14
|
+
# Full history + tags are required for setuptools_scm to derive
|
|
15
|
+
# the version from the pushed tag.
|
|
16
|
+
fetch-depth: 0
|
|
17
|
+
|
|
18
|
+
- name: Set up Python
|
|
19
|
+
uses: actions/setup-python@v5
|
|
20
|
+
with:
|
|
21
|
+
python-version: "3.12"
|
|
22
|
+
|
|
23
|
+
- name: Build distributions
|
|
24
|
+
run: |
|
|
25
|
+
python -m pip install --upgrade pip build
|
|
26
|
+
python -m build
|
|
27
|
+
|
|
28
|
+
- name: Check distributions
|
|
29
|
+
run: |
|
|
30
|
+
pip install twine
|
|
31
|
+
twine check dist/*
|
|
32
|
+
|
|
33
|
+
- name: Upload build artifacts
|
|
34
|
+
uses: actions/upload-artifact@v4
|
|
35
|
+
with:
|
|
36
|
+
name: dist
|
|
37
|
+
path: dist/
|
|
38
|
+
|
|
39
|
+
publish:
|
|
40
|
+
needs: build
|
|
41
|
+
runs-on: ubuntu-latest
|
|
42
|
+
environment:
|
|
43
|
+
name: pypi
|
|
44
|
+
url: https://pypi.org/p/propresenter-client
|
|
45
|
+
permissions:
|
|
46
|
+
# Required for PyPI Trusted Publishing (OIDC). No API token needed.
|
|
47
|
+
id-token: write
|
|
48
|
+
steps:
|
|
49
|
+
- name: Download build artifacts
|
|
50
|
+
uses: actions/download-artifact@v4
|
|
51
|
+
with:
|
|
52
|
+
name: dist
|
|
53
|
+
path: dist/
|
|
54
|
+
|
|
55
|
+
- name: Publish to PyPI
|
|
56
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
pip-wheel-metadata/
|
|
24
|
+
share/python-wheels/
|
|
25
|
+
*.egg-info/
|
|
26
|
+
.installed.cfg
|
|
27
|
+
*.egg
|
|
28
|
+
MANIFEST
|
|
29
|
+
|
|
30
|
+
# PyInstaller
|
|
31
|
+
*.manifest
|
|
32
|
+
*.spec
|
|
33
|
+
|
|
34
|
+
# Installer logs
|
|
35
|
+
pip-log.txt
|
|
36
|
+
pip-delete-this-directory.txt
|
|
37
|
+
|
|
38
|
+
# Unit test / coverage reports
|
|
39
|
+
htmlcov/
|
|
40
|
+
.tox/
|
|
41
|
+
.nox/
|
|
42
|
+
.coverage
|
|
43
|
+
.coverage.*
|
|
44
|
+
.cache
|
|
45
|
+
nosetests.xml
|
|
46
|
+
coverage.xml
|
|
47
|
+
*.cover
|
|
48
|
+
*.py,cover
|
|
49
|
+
.hypothesis/
|
|
50
|
+
.pytest_cache/
|
|
51
|
+
|
|
52
|
+
# Translations
|
|
53
|
+
*.mo
|
|
54
|
+
*.pot
|
|
55
|
+
|
|
56
|
+
# Django stuff:
|
|
57
|
+
*.log
|
|
58
|
+
local_settings.py
|
|
59
|
+
db.sqlite3
|
|
60
|
+
db.sqlite3-journal
|
|
61
|
+
|
|
62
|
+
# Flask stuff:
|
|
63
|
+
instance/
|
|
64
|
+
.webassets-cache
|
|
65
|
+
|
|
66
|
+
# Scrapy stuff:
|
|
67
|
+
.scrapy
|
|
68
|
+
|
|
69
|
+
# Sphinx documentation
|
|
70
|
+
docs/_build/
|
|
71
|
+
|
|
72
|
+
# PyBuilder
|
|
73
|
+
target/
|
|
74
|
+
|
|
75
|
+
# Jupyter Notebook
|
|
76
|
+
.ipynb_checkpoints
|
|
77
|
+
|
|
78
|
+
# IPython
|
|
79
|
+
profile_default/
|
|
80
|
+
ipython_config.py
|
|
81
|
+
|
|
82
|
+
# pyenv
|
|
83
|
+
.python-version
|
|
84
|
+
|
|
85
|
+
# pipenv
|
|
86
|
+
Pipfile.lock
|
|
87
|
+
|
|
88
|
+
# PEP 582
|
|
89
|
+
__pypackages__/
|
|
90
|
+
|
|
91
|
+
# Celery stuff
|
|
92
|
+
celerybeat-schedule
|
|
93
|
+
celerybeat.pid
|
|
94
|
+
|
|
95
|
+
# SageMath parsed files
|
|
96
|
+
*.sage.py
|
|
97
|
+
|
|
98
|
+
# Environments
|
|
99
|
+
.env
|
|
100
|
+
.venv
|
|
101
|
+
env/
|
|
102
|
+
venv/
|
|
103
|
+
ENV/
|
|
104
|
+
env.bak/
|
|
105
|
+
venv.bak/
|
|
106
|
+
|
|
107
|
+
# Spyder project settings
|
|
108
|
+
.spyderproject
|
|
109
|
+
.spyproject
|
|
110
|
+
|
|
111
|
+
# Rope project settings
|
|
112
|
+
.ropeproject
|
|
113
|
+
|
|
114
|
+
# mkdocs documentation
|
|
115
|
+
/site
|
|
116
|
+
|
|
117
|
+
# mypy
|
|
118
|
+
.mypy_cache/
|
|
119
|
+
.dmypy.json
|
|
120
|
+
dmypy.json
|
|
121
|
+
|
|
122
|
+
# Pyre type checker
|
|
123
|
+
.pyre/
|
|
124
|
+
|
|
125
|
+
# IDE
|
|
126
|
+
.vscode/
|
|
127
|
+
.idea/
|
|
128
|
+
*.swp
|
|
129
|
+
*.swo
|
|
130
|
+
*~
|
|
131
|
+
|
|
132
|
+
# OS
|
|
133
|
+
.DS_Store
|
|
134
|
+
Thumbs.db
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Claude.md - Project Context for AI Assistance
|
|
2
|
+
|
|
3
|
+
## Project Overview
|
|
4
|
+
|
|
5
|
+
**propresenter-client** is a general-purpose Python client and CLI for the ProPresenter REST API. It exposes a `ProPresenterController` class for programmatic access to any ProPresenter endpoint, and ships an interactive **presentation mode** CLI as a built-in usage example. New modes can be added over time alongside presentation mode.
|
|
6
|
+
|
|
7
|
+
## Key Structure
|
|
8
|
+
|
|
9
|
+
- **src/propresenter_client/main.py** - Main module containing:
|
|
10
|
+
- `ProPresenterController` - API client class for ProPresenter communication
|
|
11
|
+
- `_get_command()` - Raw terminal input helper for single-keypress commands
|
|
12
|
+
- `interactive_prompt()` - CLI interactive loop for user commands
|
|
13
|
+
- `main()` - CLI entry point with argument parsing
|
|
14
|
+
|
|
15
|
+
- **pyproject.toml** - Poetry configuration with console script entry point
|
|
16
|
+
- **README.md** - Project documentation with installation and usage instructions
|
|
17
|
+
|
|
18
|
+
## Core Functionality
|
|
19
|
+
|
|
20
|
+
### ProPresenterController Methods
|
|
21
|
+
- `next_slide()` - Advance to next slide (GET v1/presentation/active/next/trigger)
|
|
22
|
+
- `previous_slide()` - Go to previous slide (GET v1/presentation/active/previous/trigger)
|
|
23
|
+
- `go_to_slide(slide_index)` - Jump to specific slide by number (1-indexed)
|
|
24
|
+
- `get_status()` - Fetch current slide status (GET v1/status/slide)
|
|
25
|
+
- `get_slide_position()` - Get current slide position and total slide count
|
|
26
|
+
- `get_active_presentation()` - Get currently active presentation details
|
|
27
|
+
- `get_library(library_name)` - Get a named library's contents
|
|
28
|
+
- `get_library_default()` - Get Default library contents (GET v1/library/Default)
|
|
29
|
+
- `find_presentation_uuid_by_name(presentation_name, library_data)` - Find presentation UUID by name in library
|
|
30
|
+
- `get_presentation_details(uuid)` - Fetch full details for a presentation by UUID (GET v1/presentation/{uuid})
|
|
31
|
+
- `activate_presentation(uuid)` - Activate presentation by UUID (GET v1/presentation/{uuid}/trigger)
|
|
32
|
+
- `activate_first_library_presentation(library_name)` - Activate first presentation in library (GET v1/library/{library}/0/trigger)
|
|
33
|
+
- `_request()` - Generic HTTP request handler
|
|
34
|
+
|
|
35
|
+
### CLI Arguments
|
|
36
|
+
- `--host` - ProPresenter host/IP address (default: localhost)
|
|
37
|
+
- `--port` - ProPresenter port (default: 1025)
|
|
38
|
+
- `--timeout` - Request timeout in seconds (default: 5)
|
|
39
|
+
- `--library` - Library name to use for presentation lookup and default activation (default: Default)
|
|
40
|
+
- `--presentation` - Presentation title to activate from configured library before interactive mode
|
|
41
|
+
- `--list-details` - Print full JSON details for the specified presentation and exit (requires `--presentation`)
|
|
42
|
+
- `--log-level` - Set logging verbosity for request diagnostics (default: WARNING)
|
|
43
|
+
|
|
44
|
+
### CLI Commands
|
|
45
|
+
- `n` - Next slide (fires immediately, no Enter needed)
|
|
46
|
+
- `b` - Previous slide / back (fires immediately, no Enter needed)
|
|
47
|
+
- `q` - Quit (fires immediately, no Enter needed)
|
|
48
|
+
- `<number>` + Enter - Go to specific slide number (1-indexed, so 1 = first slide)
|
|
49
|
+
- `Escape` - Cancel a partially typed slide number
|
|
50
|
+
|
|
51
|
+
Input uses raw terminal mode (`tty`/`termios`) on Unix/macOS so single-char commands register on keypress. Falls back to `input()` on unsupported platforms. The `_get_command()` helper in `main.py` handles this logic.
|
|
52
|
+
|
|
53
|
+
## Common Tasks
|
|
54
|
+
|
|
55
|
+
### Adding New API Endpoints
|
|
56
|
+
1. Add method to `ProPresenterController` class
|
|
57
|
+
2. Use `self._request()` for HTTP calls
|
|
58
|
+
3. Return boolean for success or dict for data
|
|
59
|
+
4. Add corresponding command to `interactive_prompt()` if user-facing
|
|
60
|
+
|
|
61
|
+
### Adding Presentation Activation
|
|
62
|
+
1. Add method to query library: `GET v1/library/{library_name}`
|
|
63
|
+
2. Add method to find presentation by name in library response
|
|
64
|
+
3. Add method to activate presentation: `GET v1/presentation/{uuid}/trigger`
|
|
65
|
+
4. Add CLI argument and logic in `main()` to handle activation before interactive mode
|
|
66
|
+
|
|
67
|
+
### Modifying CLI Arguments
|
|
68
|
+
Edit the argparse section in `main()` to add/modify command-line flags.
|
|
69
|
+
|
|
70
|
+
### Installation & Development
|
|
71
|
+
```bash
|
|
72
|
+
poetry install
|
|
73
|
+
poetry run propresenter-client --host=<host>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Running Tests
|
|
77
|
+
```bash
|
|
78
|
+
# Run all tests
|
|
79
|
+
poetry run pytest
|
|
80
|
+
|
|
81
|
+
# Run specific test file
|
|
82
|
+
poetry run pytest tests/test_propresenter_controller.py -v
|
|
83
|
+
|
|
84
|
+
# Run specific test class
|
|
85
|
+
poetry run pytest tests/test_propresenter_controller.py::TestProPresenterController -v
|
|
86
|
+
|
|
87
|
+
# Run individual test
|
|
88
|
+
poetry run pytest tests/test_propresenter_controller.py::TestProPresenterController::test_get_status_success -v
|
|
89
|
+
|
|
90
|
+
# Run tests matching a pattern
|
|
91
|
+
poetry run pytest -k "test_get" -v
|
|
92
|
+
|
|
93
|
+
# Run with coverage report
|
|
94
|
+
poetry run pytest --cov=propresenter_client
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Development Notes
|
|
98
|
+
|
|
99
|
+
- Uses requests library for HTTP communication
|
|
100
|
+
- Base API URL: `http://{host}:{port}` (endpoints start with v1/)
|
|
101
|
+
- Defaults: localhost:1025 with 5-second timeout
|
|
102
|
+
- Connection verified on startup before entering interactive mode
|
|
103
|
+
- Default behavior: activates first presentation in configured library
|
|
104
|
+
- `--library` option: searches specified library for matching presentation name, then activates it (default: Default); also used for first-presentation activation if no presentation specified
|
|
105
|
+
- `go_to_slide` uses 1-indexed slide numbers for presentation navigation
|
|
106
|
+
- All slide control requests use GET method with /trigger endpoints
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026
|
|
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.
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: propresenter-client
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Python client for the ProPresenter REST API
|
|
5
|
+
Author-email: scaperothian <scaperoth@berkeley.edu>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/scaperothian/propresenter-client
|
|
8
|
+
Project-URL: Repository, https://github.com/scaperothian/propresenter-client.git
|
|
9
|
+
Project-URL: Issues, https://github.com/scaperothian/propresenter-client/issues
|
|
10
|
+
Keywords: propresenter,api,client,presentation,slides
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Requires-Python: >=3.10
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
Requires-Dist: requests>=2.31
|
|
23
|
+
Provides-Extra: dev
|
|
24
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
25
|
+
Requires-Dist: pytest-cov>=4.0; extra == "dev"
|
|
26
|
+
Requires-Dist: build>=1.0; extra == "dev"
|
|
27
|
+
Dynamic: license-file
|
|
28
|
+
|
|
29
|
+
# propresenter-client
|
|
30
|
+
|
|
31
|
+
[](https://github.com/scaperothian/propresenter-client/actions/workflows/ci.yml)
|
|
32
|
+
[](https://pypi.org/project/propresenter-client/)
|
|
33
|
+
|
|
34
|
+
Python client for the ProPresenter REST API.
|
|
35
|
+
|
|
36
|
+
## Description
|
|
37
|
+
|
|
38
|
+
A Python library and CLI for interacting with ProPresenter's REST API. Provides a `ProPresenterController` class for programmatic access to any ProPresenter API endpoint, plus an interactive **presentation mode** CLI for live slide control.
|
|
39
|
+
|
|
40
|
+
## Features
|
|
41
|
+
|
|
42
|
+
- `ProPresenterController` class covering common ProPresenter API endpoints
|
|
43
|
+
- Interactive presentation mode for live slide navigation
|
|
44
|
+
- Extensible design — add new API endpoints as methods over time
|
|
45
|
+
|
|
46
|
+
## Installation
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
pip install propresenter-client
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Development Setup
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# Create a virtual environment and install the package with dev dependencies
|
|
56
|
+
python -m venv .venv
|
|
57
|
+
source .venv/bin/activate
|
|
58
|
+
pip install -e ".[dev]"
|
|
59
|
+
|
|
60
|
+
# Run the CLI
|
|
61
|
+
propresenter-client --host=<your-host>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Quick Start
|
|
65
|
+
|
|
66
|
+
```python
|
|
67
|
+
from propresenter_client import ProPresenterController
|
|
68
|
+
|
|
69
|
+
controller = ProPresenterController(host="localhost", port=1025)
|
|
70
|
+
|
|
71
|
+
# Slide control
|
|
72
|
+
controller.next_slide()
|
|
73
|
+
controller.previous_slide()
|
|
74
|
+
controller.go_to_slide(1) # 1-indexed
|
|
75
|
+
|
|
76
|
+
# Presentations
|
|
77
|
+
controller.activate_presentation("92B5E6E2-5E99-4F54-BAD3-6FBD7D2EE675")
|
|
78
|
+
controller.get_presentation_details("92B5E6E2-5E99-4F54-BAD3-6FBD7D2EE675")
|
|
79
|
+
controller.activate_first_library_presentation("Default")
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Interactive Presentation Mode
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
# Default: activates first presentation in Default library
|
|
86
|
+
propresenter-client --host=192.168.1.100
|
|
87
|
+
|
|
88
|
+
# Activate a specific presentation by name before entering interactive mode
|
|
89
|
+
propresenter-client --host=192.168.1.100 --presentation="Amazing Grace"
|
|
90
|
+
|
|
91
|
+
# Print presentation details and exit (no interactive mode)
|
|
92
|
+
propresenter-client --host=192.168.1.100 --presentation="Amazing Grace" --list-details
|
|
93
|
+
|
|
94
|
+
# Use a different library
|
|
95
|
+
propresenter-client --host=192.168.1.100 --library="Worship"
|
|
96
|
+
|
|
97
|
+
# Enable request diagnostics
|
|
98
|
+
propresenter-client --host=192.168.1.100 --log-level=DEBUG
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Interactive commands (no Enter required for single-key commands):
|
|
102
|
+
- `n` — Next slide
|
|
103
|
+
- `b` — Back to previous slide
|
|
104
|
+
- `q` — Quit
|
|
105
|
+
- `1`, `2`, `3`, … — Go to specific slide (1-indexed, press Enter to confirm)
|
|
106
|
+
- `Escape` — Cancel a partially typed slide number
|
|
107
|
+
|
|
108
|
+
## Testing
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
# Run all tests
|
|
112
|
+
pytest
|
|
113
|
+
|
|
114
|
+
# Run specific test file
|
|
115
|
+
pytest tests/test_propresenter_controller.py -v
|
|
116
|
+
|
|
117
|
+
# Run specific test class
|
|
118
|
+
pytest tests/test_propresenter_controller.py::TestProPresenterController -v
|
|
119
|
+
|
|
120
|
+
# Run individual test
|
|
121
|
+
pytest tests/test_propresenter_controller.py::TestProPresenterController::test_get_status_success -v
|
|
122
|
+
|
|
123
|
+
# Run tests matching a pattern
|
|
124
|
+
pytest -k "test_get" -v
|
|
125
|
+
|
|
126
|
+
# Generate coverage report
|
|
127
|
+
pytest --cov=propresenter_client
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Releasing
|
|
131
|
+
|
|
132
|
+
Releases are published to [PyPI](https://pypi.org/project/propresenter-client/)
|
|
133
|
+
automatically by the `Publish` GitHub Actions workflow when a version tag is
|
|
134
|
+
pushed. The version number is derived from the git tag via `setuptools_scm`.
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
git tag v1.2.3
|
|
138
|
+
git push origin v1.2.3
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Publishing uses [PyPI Trusted Publishing (OIDC)](https://docs.pypi.org/trusted-publishers/),
|
|
142
|
+
so no API tokens are stored in the repository. One-time setup on PyPI:
|
|
143
|
+
|
|
144
|
+
1. Create the project's pending publisher at
|
|
145
|
+
<https://pypi.org/manage/account/publishing/>.
|
|
146
|
+
2. Owner: `scaperothian`, repository: `propresenter-client`,
|
|
147
|
+
workflow: `publish.yml`, environment: `pypi`.
|
|
148
|
+
|
|
149
|
+
## Requirements
|
|
150
|
+
|
|
151
|
+
- Python 3.10+
|
|
152
|
+
- requests
|
|
153
|
+
|
|
154
|
+
## License
|
|
155
|
+
|
|
156
|
+
MIT
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# propresenter-client
|
|
2
|
+
|
|
3
|
+
[](https://github.com/scaperothian/propresenter-client/actions/workflows/ci.yml)
|
|
4
|
+
[](https://pypi.org/project/propresenter-client/)
|
|
5
|
+
|
|
6
|
+
Python client for the ProPresenter REST API.
|
|
7
|
+
|
|
8
|
+
## Description
|
|
9
|
+
|
|
10
|
+
A Python library and CLI for interacting with ProPresenter's REST API. Provides a `ProPresenterController` class for programmatic access to any ProPresenter API endpoint, plus an interactive **presentation mode** CLI for live slide control.
|
|
11
|
+
|
|
12
|
+
## Features
|
|
13
|
+
|
|
14
|
+
- `ProPresenterController` class covering common ProPresenter API endpoints
|
|
15
|
+
- Interactive presentation mode for live slide navigation
|
|
16
|
+
- Extensible design — add new API endpoints as methods over time
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pip install propresenter-client
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Development Setup
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# Create a virtual environment and install the package with dev dependencies
|
|
28
|
+
python -m venv .venv
|
|
29
|
+
source .venv/bin/activate
|
|
30
|
+
pip install -e ".[dev]"
|
|
31
|
+
|
|
32
|
+
# Run the CLI
|
|
33
|
+
propresenter-client --host=<your-host>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Quick Start
|
|
37
|
+
|
|
38
|
+
```python
|
|
39
|
+
from propresenter_client import ProPresenterController
|
|
40
|
+
|
|
41
|
+
controller = ProPresenterController(host="localhost", port=1025)
|
|
42
|
+
|
|
43
|
+
# Slide control
|
|
44
|
+
controller.next_slide()
|
|
45
|
+
controller.previous_slide()
|
|
46
|
+
controller.go_to_slide(1) # 1-indexed
|
|
47
|
+
|
|
48
|
+
# Presentations
|
|
49
|
+
controller.activate_presentation("92B5E6E2-5E99-4F54-BAD3-6FBD7D2EE675")
|
|
50
|
+
controller.get_presentation_details("92B5E6E2-5E99-4F54-BAD3-6FBD7D2EE675")
|
|
51
|
+
controller.activate_first_library_presentation("Default")
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Interactive Presentation Mode
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# Default: activates first presentation in Default library
|
|
58
|
+
propresenter-client --host=192.168.1.100
|
|
59
|
+
|
|
60
|
+
# Activate a specific presentation by name before entering interactive mode
|
|
61
|
+
propresenter-client --host=192.168.1.100 --presentation="Amazing Grace"
|
|
62
|
+
|
|
63
|
+
# Print presentation details and exit (no interactive mode)
|
|
64
|
+
propresenter-client --host=192.168.1.100 --presentation="Amazing Grace" --list-details
|
|
65
|
+
|
|
66
|
+
# Use a different library
|
|
67
|
+
propresenter-client --host=192.168.1.100 --library="Worship"
|
|
68
|
+
|
|
69
|
+
# Enable request diagnostics
|
|
70
|
+
propresenter-client --host=192.168.1.100 --log-level=DEBUG
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Interactive commands (no Enter required for single-key commands):
|
|
74
|
+
- `n` — Next slide
|
|
75
|
+
- `b` — Back to previous slide
|
|
76
|
+
- `q` — Quit
|
|
77
|
+
- `1`, `2`, `3`, … — Go to specific slide (1-indexed, press Enter to confirm)
|
|
78
|
+
- `Escape` — Cancel a partially typed slide number
|
|
79
|
+
|
|
80
|
+
## Testing
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# Run all tests
|
|
84
|
+
pytest
|
|
85
|
+
|
|
86
|
+
# Run specific test file
|
|
87
|
+
pytest tests/test_propresenter_controller.py -v
|
|
88
|
+
|
|
89
|
+
# Run specific test class
|
|
90
|
+
pytest tests/test_propresenter_controller.py::TestProPresenterController -v
|
|
91
|
+
|
|
92
|
+
# Run individual test
|
|
93
|
+
pytest tests/test_propresenter_controller.py::TestProPresenterController::test_get_status_success -v
|
|
94
|
+
|
|
95
|
+
# Run tests matching a pattern
|
|
96
|
+
pytest -k "test_get" -v
|
|
97
|
+
|
|
98
|
+
# Generate coverage report
|
|
99
|
+
pytest --cov=propresenter_client
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Releasing
|
|
103
|
+
|
|
104
|
+
Releases are published to [PyPI](https://pypi.org/project/propresenter-client/)
|
|
105
|
+
automatically by the `Publish` GitHub Actions workflow when a version tag is
|
|
106
|
+
pushed. The version number is derived from the git tag via `setuptools_scm`.
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
git tag v1.2.3
|
|
110
|
+
git push origin v1.2.3
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Publishing uses [PyPI Trusted Publishing (OIDC)](https://docs.pypi.org/trusted-publishers/),
|
|
114
|
+
so no API tokens are stored in the repository. One-time setup on PyPI:
|
|
115
|
+
|
|
116
|
+
1. Create the project's pending publisher at
|
|
117
|
+
<https://pypi.org/manage/account/publishing/>.
|
|
118
|
+
2. Owner: `scaperothian`, repository: `propresenter-client`,
|
|
119
|
+
workflow: `publish.yml`, environment: `pypi`.
|
|
120
|
+
|
|
121
|
+
## Requirements
|
|
122
|
+
|
|
123
|
+
- Python 3.10+
|
|
124
|
+
- requests
|
|
125
|
+
|
|
126
|
+
## License
|
|
127
|
+
|
|
128
|
+
MIT
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61", "wheel", "setuptools_scm[toml]>=6.2"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "propresenter-client"
|
|
7
|
+
description = "Python client for the ProPresenter REST API"
|
|
8
|
+
readme = "README.md"
|
|
9
|
+
requires-python = ">=3.10"
|
|
10
|
+
license = {text = "MIT"}
|
|
11
|
+
authors = [
|
|
12
|
+
{name = "scaperothian", email = "scaperoth@berkeley.edu"},
|
|
13
|
+
]
|
|
14
|
+
keywords = ["propresenter", "api", "client", "presentation", "slides"]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Development Status :: 3 - Alpha",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
"License :: OSI Approved :: MIT License",
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"Programming Language :: Python :: 3.10",
|
|
21
|
+
"Programming Language :: Python :: 3.11",
|
|
22
|
+
"Programming Language :: Python :: 3.12",
|
|
23
|
+
"Programming Language :: Python :: 3.13",
|
|
24
|
+
]
|
|
25
|
+
dynamic = ["version"]
|
|
26
|
+
dependencies = [
|
|
27
|
+
"requests>=2.31",
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
[project.optional-dependencies]
|
|
31
|
+
dev = [
|
|
32
|
+
"pytest>=7.0",
|
|
33
|
+
"pytest-cov>=4.0",
|
|
34
|
+
"build>=1.0",
|
|
35
|
+
]
|
|
36
|
+
|
|
37
|
+
[project.urls]
|
|
38
|
+
Homepage = "https://github.com/scaperothian/propresenter-client"
|
|
39
|
+
Repository = "https://github.com/scaperothian/propresenter-client.git"
|
|
40
|
+
Issues = "https://github.com/scaperothian/propresenter-client/issues"
|
|
41
|
+
|
|
42
|
+
[project.scripts]
|
|
43
|
+
propresenter-client = "propresenter_client.main:main"
|
|
44
|
+
|
|
45
|
+
[tool.setuptools]
|
|
46
|
+
packages = ["propresenter_client"]
|
|
47
|
+
|
|
48
|
+
[tool.setuptools.package-dir]
|
|
49
|
+
"" = "src"
|
|
50
|
+
|
|
51
|
+
[tool.setuptools_scm]
|