A Python package for creating simple local web overlays for streams and other needs
Project description
pyweboverlay
A Python package for easily creating web overlays in Python using Flask and SocketIO.
Installation
pip install pyweboverlay
Usage
Set up your directory structure like the example provided in the repository:
│ example.py
│
└───rloverlay
│ rloverlay.html
│
└───static
background.png
pivot.png
See example.py and the rloverlay/ directory for a complete working example.
API Reference
pyweboverlay.init(port=5000, verbose=True)
Initialize the pyweboverlay server.
- port (int): Port number for the web server (default: 5000)
- verbose (bool): Enable detailed logging (default: True)
pyweboverlay.register(overlay, name, template_file=None, static_dir=None)
Register an overlay instance with the server.
- overlay (Overlay): Instance of a class extending Overlay
- name (str): Unique name for the overlay's namespace
- template_file (str, optional): Path to custom HTML template file
- static_dir (str, optional): Path to directory for serving static files
Returns the overlay ID.
pyweboverlay.update(name, data=None)
Update an overlay with new data and emit to connected clients.
- name (str): The registered name of the overlay
- data (any): Data to pass to the overlay's update method
Creating Custom Overlays
Extend the Overlay base class and implement two required methods:
from pyweboverlay import Overlay
class CustomOverlay(Overlay):
def get_data(self):
"""Return current overlay data as a dictionary."""
return {"key": "value"}
def update(self, data=None):
"""Update the overlay state with new data."""
if data is not None:
# Process and store the data
pass
Features
- Real-time updates using WebSocket connections
- Custom HTML templates with Jinja2 templating
- Static file serving for images, CSS, and JavaScript
- Multiple overlays on a single server
- Minimal configuration required
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyweboverlay-1.0.5.tar.gz.
File metadata
- Download URL: pyweboverlay-1.0.5.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6f164e5dd005d79c2384ba19c2c810f286f514b2034e6f5d41f2a563f5d13a6
|
|
| MD5 |
a21ea371eccc981fd671b079d1ab76a1
|
|
| BLAKE2b-256 |
e9f5fd89ea6c821ba3c7f4138d119cc2fb0d7c0380b89efdff6c09a5f79e8aef
|
Provenance
The following attestation bundles were made for pyweboverlay-1.0.5.tar.gz:
Publisher:
workflow.yml on chrisrca/pyweboverlay
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyweboverlay-1.0.5.tar.gz -
Subject digest:
f6f164e5dd005d79c2384ba19c2c810f286f514b2034e6f5d41f2a563f5d13a6 - Sigstore transparency entry: 590953906
- Sigstore integration time:
-
Permalink:
chrisrca/pyweboverlay@4b7126673f6addf3eb21a4b79a8c37d89f3cfaaf -
Branch / Tag:
refs/tags/v1.0.5 - Owner: https://github.com/chrisrca
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@4b7126673f6addf3eb21a4b79a8c37d89f3cfaaf -
Trigger Event:
release
-
Statement type:
File details
Details for the file pyweboverlay-1.0.5-py3-none-any.whl.
File metadata
- Download URL: pyweboverlay-1.0.5-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74d114d7491a555759eda1bac53d168c6fd67fd29c9835d9ff04eb8e389e4159
|
|
| MD5 |
3be9d7bd968fdebbd3ba9b1f27f5a8ff
|
|
| BLAKE2b-256 |
519a52dcf761be063e17d2f7c48c3b70b4dda711432d373594dfd450fb0f1b2c
|
Provenance
The following attestation bundles were made for pyweboverlay-1.0.5-py3-none-any.whl:
Publisher:
workflow.yml on chrisrca/pyweboverlay
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyweboverlay-1.0.5-py3-none-any.whl -
Subject digest:
74d114d7491a555759eda1bac53d168c6fd67fd29c9835d9ff04eb8e389e4159 - Sigstore transparency entry: 590953911
- Sigstore integration time:
-
Permalink:
chrisrca/pyweboverlay@4b7126673f6addf3eb21a4b79a8c37d89f3cfaaf -
Branch / Tag:
refs/tags/v1.0.5 - Owner: https://github.com/chrisrca
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@4b7126673f6addf3eb21a4b79a8c37d89f3cfaaf -
Trigger Event:
release
-
Statement type: