streamo 0.2.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 (88) hide show
  1. streamo-0.2.0/.gitignore +221 -0
  2. streamo-0.2.0/.python-version +1 -0
  3. streamo-0.2.0/LICENSE +21 -0
  4. streamo-0.2.0/PKG-INFO +46 -0
  5. streamo-0.2.0/README.md +26 -0
  6. streamo-0.2.0/conftest.py +1 -0
  7. streamo-0.2.0/doc/handover.md +32 -0
  8. streamo-0.2.0/doc/streamo.md +791 -0
  9. streamo-0.2.0/examples/generic-rtmps.toml +34 -0
  10. streamo-0.2.0/examples/icecast.toml +27 -0
  11. streamo-0.2.0/examples/twitch.toml +38 -0
  12. streamo-0.2.0/plan/features.md +76 -0
  13. streamo-0.2.0/pyproject.toml +57 -0
  14. streamo-0.2.0/scripts/auto_loop.py +140 -0
  15. streamo-0.2.0/scripts/copy-server.sh +23 -0
  16. streamo-0.2.0/scripts/loop_videos.py +101 -0
  17. streamo-0.2.0/scripts/media_output.py +15 -0
  18. streamo-0.2.0/scripts/preview_loops.py +197 -0
  19. streamo-0.2.0/scripts/reencode_videos.py +145 -0
  20. streamo-0.2.0/scripts/render.py +534 -0
  21. streamo-0.2.0/scripts/render_plan.py +236 -0
  22. streamo-0.2.0/scripts/set-secret.sh +63 -0
  23. streamo-0.2.0/scripts/title_card.py +158 -0
  24. streamo-0.2.0/streamo/__init__.py +1 -0
  25. streamo-0.2.0/streamo/__main__.py +20 -0
  26. streamo-0.2.0/streamo/audio.py +160 -0
  27. streamo-0.2.0/streamo/auth.py +204 -0
  28. streamo-0.2.0/streamo/closing.py +229 -0
  29. streamo-0.2.0/streamo/composition.py +156 -0
  30. streamo-0.2.0/streamo/config.py +308 -0
  31. streamo-0.2.0/streamo/control.py +319 -0
  32. streamo-0.2.0/streamo/credentials.py +23 -0
  33. streamo-0.2.0/streamo/daemon.py +90 -0
  34. streamo-0.2.0/streamo/ffmpeg_progress.py +24 -0
  35. streamo-0.2.0/streamo/image_feed.py +200 -0
  36. streamo-0.2.0/streamo/images.py +276 -0
  37. streamo-0.2.0/streamo/kick_api.py +392 -0
  38. streamo-0.2.0/streamo/moderation.py +122 -0
  39. streamo-0.2.0/streamo/overlays.py +379 -0
  40. streamo-0.2.0/streamo/preflight.py +443 -0
  41. streamo-0.2.0/streamo/provider_config.py +390 -0
  42. streamo-0.2.0/streamo/providers.py +461 -0
  43. streamo-0.2.0/streamo/runtime.py +396 -0
  44. streamo-0.2.0/streamo/service.toml +6 -0
  45. streamo-0.2.0/streamo/streamer.py +512 -0
  46. streamo-0.2.0/streamo/twitch_api.py +227 -0
  47. streamo-0.2.0/streamo/youtube_api.py +380 -0
  48. streamo-0.2.0/test/fixtures/render/title.md +6 -0
  49. streamo-0.2.0/test/foto_manifest_rollback.php +75 -0
  50. streamo-0.2.0/test/test_audio.py +129 -0
  51. streamo-0.2.0/test/test_auth.py +213 -0
  52. streamo-0.2.0/test/test_auto_loop.py +121 -0
  53. streamo-0.2.0/test/test_cli_help/test_authorization_help.txt +50 -0
  54. streamo-0.2.0/test/test_cli_help/test_help.txt +78 -0
  55. streamo-0.2.0/test/test_cli_help/test_media_tool_help_auto_loop_.txt +13 -0
  56. streamo-0.2.0/test/test_cli_help/test_media_tool_help_loop_videos_.txt +12 -0
  57. streamo-0.2.0/test/test_cli_help/test_media_tool_help_preview_loops_.txt +14 -0
  58. streamo-0.2.0/test/test_cli_help/test_media_tool_help_reencode_videos_.txt +15 -0
  59. streamo-0.2.0/test/test_cli_help/test_media_tool_help_render_.txt +35 -0
  60. streamo-0.2.0/test/test_cli_help.py +39 -0
  61. streamo-0.2.0/test/test_closing.py +122 -0
  62. streamo-0.2.0/test/test_config.py +466 -0
  63. streamo-0.2.0/test/test_control.py +320 -0
  64. streamo-0.2.0/test/test_daemon.py +182 -0
  65. streamo-0.2.0/test/test_ffmpeg_progress.py +63 -0
  66. streamo-0.2.0/test/test_foto_manifest.py +20 -0
  67. streamo-0.2.0/test/test_images.py +456 -0
  68. streamo-0.2.0/test/test_kick_api.py +227 -0
  69. streamo-0.2.0/test/test_loop_videos.py +36 -0
  70. streamo-0.2.0/test/test_media_output.py +35 -0
  71. streamo-0.2.0/test/test_media_probe_errors.py +35 -0
  72. streamo-0.2.0/test/test_moderation/test_queue_paginates_and_preview_is_bounded.yml +14 -0
  73. streamo-0.2.0/test/test_moderation.py +220 -0
  74. streamo-0.2.0/test/test_overlays/test_title_layout_and_opaque_full_size_slate.png +0 -0
  75. streamo-0.2.0/test/test_overlays.py +291 -0
  76. streamo-0.2.0/test/test_preflight.py +248 -0
  77. streamo-0.2.0/test/test_preview_loops.py +197 -0
  78. streamo-0.2.0/test/test_recovery.py +261 -0
  79. streamo-0.2.0/test/test_reencode_videos.py +108 -0
  80. streamo-0.2.0/test/test_render.py +686 -0
  81. streamo-0.2.0/test/test_runtime/test_incidents_retain_loss_and_recovery_without_duplicate_polls.yml +28 -0
  82. streamo-0.2.0/test/test_runtime.py +177 -0
  83. streamo-0.2.0/test/test_services.py +498 -0
  84. streamo-0.2.0/test/test_streamer.py +550 -0
  85. streamo-0.2.0/test/test_twitch_api.py +136 -0
  86. streamo-0.2.0/test/test_youtube_api.py +218 -0
  87. streamo-0.2.0/uv.lock +954 -0
  88. streamo-0.2.0/web/foto.php +399 -0
@@ -0,0 +1,221 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
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
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ # Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ # poetry.lock
109
+ # poetry.toml
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115
+ # pdm.lock
116
+ # pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # pixi
121
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122
+ # pixi.lock
123
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124
+ # in the .venv directory. It is recommended not to include this directory in version control.
125
+ .pixi
126
+
127
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128
+ __pypackages__/
129
+
130
+ # Celery stuff
131
+ celerybeat-schedule
132
+ celerybeat.pid
133
+
134
+ # Redis
135
+ *.rdb
136
+ *.aof
137
+ *.pid
138
+
139
+ # RabbitMQ
140
+ mnesia/
141
+ rabbitmq/
142
+ rabbitmq-data/
143
+
144
+ # ActiveMQ
145
+ activemq-data/
146
+
147
+ # SageMath parsed files
148
+ *.sage.py
149
+
150
+ # Environments
151
+ .env
152
+ .envrc
153
+ .venv
154
+ env/
155
+ venv/
156
+ ENV/
157
+ env.bak/
158
+ venv.bak/
159
+
160
+ # Spyder project settings
161
+ .spyderproject
162
+ .spyproject
163
+
164
+ # Rope project settings
165
+ .ropeproject
166
+
167
+ # mkdocs documentation
168
+ /site
169
+
170
+ # mypy
171
+ .mypy_cache/
172
+ .dmypy.json
173
+ dmypy.json
174
+
175
+ # Pyre type checker
176
+ .pyre/
177
+
178
+ # pytype static type analyzer
179
+ .pytype/
180
+
181
+ # Cython debug symbols
182
+ cython_debug/
183
+
184
+ # PyCharm
185
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
186
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
187
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
188
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
189
+ # .idea/
190
+
191
+ # Abstra
192
+ # Abstra is an AI-powered process automation framework.
193
+ # Ignore directories containing user credentials, local state, and settings.
194
+ # Learn more at https://abstra.io/docs
195
+ .abstra/
196
+
197
+ # Visual Studio Code
198
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
199
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
200
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
201
+ # you could uncomment the following to ignore the entire vscode folder
202
+ # .vscode/
203
+ # Temporary file for partial code execution
204
+ tempCodeRunnerFile.py
205
+
206
+ # Ruff stuff:
207
+ .ruff_cache/
208
+
209
+ # PyPI configuration file
210
+ .pypirc
211
+
212
+ # Marimo
213
+ marimo/_static/
214
+ marimo/_lsp/
215
+ __marimo__/
216
+
217
+ # Streamlit
218
+ .streamlit/secrets.toml
219
+
220
+ videos/
221
+ *.mp4
@@ -0,0 +1 @@
1
+ 3.13
streamo-0.2.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Tom Ritchford
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.
streamo-0.2.0/PKG-INFO ADDED
@@ -0,0 +1,46 @@
1
+ Metadata-Version: 2.5
2
+ Name: streamo
3
+ Version: 0.2.0
4
+ Summary: 🚰 Stream audio to all services 🚰
5
+ License-File: LICENSE
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: Programming Language :: Python :: 3.13
8
+ Classifier: Programming Language :: Python :: 3.14
9
+ Classifier: Programming Language :: Python :: 3.15
10
+ Requires-Python: >=3.13
11
+ Requires-Dist: google-auth-oauthlib>=1.4.1
12
+ Requires-Dist: google-auth>=2.57.0
13
+ Requires-Dist: numpy
14
+ Requires-Dist: pillow>=12.3.0
15
+ Requires-Dist: pydantic>=2
16
+ Requires-Dist: reccy
17
+ Requires-Dist: sounddevice
18
+ Requires-Dist: tyro
19
+ Description-Content-Type: text/markdown
20
+
21
+ # streamO
22
+
23
+ streamO sends a stereo audio-device pair to a live-streaming destination. It
24
+ combines audio with a looping visual bed, title cards, participant photos, and
25
+ an optional local HDMI display, or publishes audio-only to Icecast.
26
+
27
+ Start with the [operator guide](doc/streamo.md) for installation, configuration,
28
+ preview, show control, uploads, authorization, and media preparation.
29
+ Copy an example for [Twitch](examples/twitch.toml),
30
+ [generic RTMPS](examples/generic-rtmps.toml), or [Icecast](examples/icecast.toml).
31
+
32
+ ```bash
33
+ uv sync
34
+ uv run streamo --help
35
+ uv run streamo daemon preview --config ~/.config/streamo/config.toml
36
+ ```
37
+
38
+ Requires Python 3.13+, FFmpeg, FFprobe, an audio input device, and FFplay for
39
+ preview or local display. Live operation uses the same configuration:
40
+ `uv run streamo --config ~/.config/streamo/config.toml`.
41
+
42
+ Contributor context: [handover](doc/handover.md).
43
+
44
+ Run `uv run pytest` for parallel unit tests. It uses four workers and keeps
45
+ each test file in one worker. Run `uv run pytest -n 0` to reproduce a failure
46
+ serially.
@@ -0,0 +1,26 @@
1
+ # streamO
2
+
3
+ streamO sends a stereo audio-device pair to a live-streaming destination. It
4
+ combines audio with a looping visual bed, title cards, participant photos, and
5
+ an optional local HDMI display, or publishes audio-only to Icecast.
6
+
7
+ Start with the [operator guide](doc/streamo.md) for installation, configuration,
8
+ preview, show control, uploads, authorization, and media preparation.
9
+ Copy an example for [Twitch](examples/twitch.toml),
10
+ [generic RTMPS](examples/generic-rtmps.toml), or [Icecast](examples/icecast.toml).
11
+
12
+ ```bash
13
+ uv sync
14
+ uv run streamo --help
15
+ uv run streamo daemon preview --config ~/.config/streamo/config.toml
16
+ ```
17
+
18
+ Requires Python 3.13+, FFmpeg, FFprobe, an audio input device, and FFplay for
19
+ preview or local display. Live operation uses the same configuration:
20
+ `uv run streamo --config ~/.config/streamo/config.toml`.
21
+
22
+ Contributor context: [handover](doc/handover.md).
23
+
24
+ Run `uv run pytest` for parallel unit tests. It uses four workers and keeps
25
+ each test file in one worker. Run `uv run pytest -n 0` to reproduce a failure
26
+ serially.
@@ -0,0 +1 @@
1
+ pytest_plugins = ['reccy.pytest_plugin']
@@ -0,0 +1,32 @@
1
+ # Handover
2
+
3
+ ## Project state
4
+
5
+ The [feature plan](../plan/features.md) contains the remaining proposals:
6
+ audio/video alignment, repeatable rehearsal, and visual-bed planning preview.
7
+ The [operator guide](streamo.md) describes implemented behavior, including
8
+ closing credits and reccy's FFmpeg service logging.
9
+
10
+ Automated tests do not establish that a live provider, venue audio device, HDMI
11
+ display, or browser upload works in the target environment. Long-render capacity
12
+ also needs measurement on the target machine.
13
+
14
+ ## Decisions
15
+
16
+ - Audio capture keeps trying after device failure and drops old samples under
17
+ pressure. Status exposes current and last errors, counts, and dropped frames.
18
+ - Backup ingest is rejected until supported; no redundancy is implied.
19
+ - Local status never waits for provider health. Health refreshes in the background.
20
+ - Preview does not load provider credentials or contact provider APIs. A configured
21
+ participant-image feed still polls.
22
+ - Configured image directories are trusted. Only internet uploads and feed images
23
+ enter the approval inbox.
24
+ - Media tools reject output collisions. Paths in configuration resolve from that
25
+ file; generated render plans contain absolute paths.
26
+
27
+ ## Preserve
28
+
29
+ Two user-owned, untracked event files must remain untouched:
30
+
31
+ - `open-loop-forever.md`
32
+ - `open-loop.mp4`