webcam-push-service 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.
- webcam_push_service-0.1.0/.gitignore +5 -0
- webcam_push_service-0.1.0/PKG-INFO +39 -0
- webcam_push_service-0.1.0/README.md +25 -0
- webcam_push_service-0.1.0/build.sh +9 -0
- webcam_push_service-0.1.0/pyproject.toml +56 -0
- webcam_push_service-0.1.0/template.html +63 -0
- webcam_push_service-0.1.0/uv.lock +659 -0
- webcam_push_service-0.1.0/webcam_push_server.py +62 -0
- webcam_push_service-0.1.0/webcam_push_service.py +65 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: webcam-push-service
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Project-URL: Homepage, https://gitlab.com/alda78/webcam-push-service
|
|
5
|
+
Author-email: Ales Adamek <alda78@seznam.cz>
|
|
6
|
+
License-Expression: GPL-3.0-or-later
|
|
7
|
+
Requires-Python: >=3.10
|
|
8
|
+
Requires-Dist: flask
|
|
9
|
+
Requires-Dist: opencv-python
|
|
10
|
+
Requires-Dist: requests
|
|
11
|
+
Provides-Extra: dev
|
|
12
|
+
Requires-Dist: ruff; extra == 'dev'
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
|
|
15
|
+
# Web camera push service
|
|
16
|
+
|
|
17
|
+
This package has 2 tools. First tool allows you to get static image from web camera and push it via post request into server part.
|
|
18
|
+
Second tool is server part to receive the images and display them in a web interface.
|
|
19
|
+
|
|
20
|
+
## installation
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pip install webcam-push-service
|
|
24
|
+
```
|
|
25
|
+
or
|
|
26
|
+
```bash
|
|
27
|
+
uv tool install webcam-push-service
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## usage
|
|
31
|
+
Push service
|
|
32
|
+
```bash
|
|
33
|
+
webcam-push-service -i 0 --url http://localhost:5000
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Server service
|
|
37
|
+
```bash
|
|
38
|
+
webcam-push-server /tmp/capture.jpg
|
|
39
|
+
```
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Web camera push service
|
|
2
|
+
|
|
3
|
+
This package has 2 tools. First tool allows you to get static image from web camera and push it via post request into server part.
|
|
4
|
+
Second tool is server part to receive the images and display them in a web interface.
|
|
5
|
+
|
|
6
|
+
## installation
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
pip install webcam-push-service
|
|
10
|
+
```
|
|
11
|
+
or
|
|
12
|
+
```bash
|
|
13
|
+
uv tool install webcam-push-service
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## usage
|
|
17
|
+
Push service
|
|
18
|
+
```bash
|
|
19
|
+
webcam-push-service -i 0 --url http://localhost:5000
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Server service
|
|
23
|
+
```bash
|
|
24
|
+
webcam-push-server /tmp/capture.jpg
|
|
25
|
+
```
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "webcam-push-service"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
readme = "README.md"
|
|
5
|
+
requires-python = ">=3.10"
|
|
6
|
+
dependencies = ["flask", "opencv-python", "requests"]
|
|
7
|
+
|
|
8
|
+
authors = [
|
|
9
|
+
{name = "Ales Adamek", email = "alda78@seznam.cz"}
|
|
10
|
+
]
|
|
11
|
+
license = "GPL-3.0-or-later"
|
|
12
|
+
|
|
13
|
+
[project.urls]
|
|
14
|
+
Homepage = "https://gitlab.com/alda78/webcam-push-service"
|
|
15
|
+
|
|
16
|
+
[project.optional-dependencies]
|
|
17
|
+
dev = [
|
|
18
|
+
"ruff",
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
[build-system]
|
|
22
|
+
requires = ["hatchling"]
|
|
23
|
+
build-backend = "hatchling.build"
|
|
24
|
+
|
|
25
|
+
[tool.hatch.build.targets.wheel]
|
|
26
|
+
include = [
|
|
27
|
+
"/*.py",
|
|
28
|
+
"/*.html",
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
[project.scripts]
|
|
32
|
+
webcam-push-service = "webcam_push_service:main"
|
|
33
|
+
webcam-push-server = "webcam_push_server:main"
|
|
34
|
+
|
|
35
|
+
[tool.ruff]
|
|
36
|
+
line-length = 240
|
|
37
|
+
target-version = "py310"
|
|
38
|
+
exclude = [
|
|
39
|
+
".venv",
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
[tool.ruff.lint]
|
|
43
|
+
select = [
|
|
44
|
+
# pycodestyle
|
|
45
|
+
"E",
|
|
46
|
+
# flakes
|
|
47
|
+
"F",
|
|
48
|
+
# isort
|
|
49
|
+
"I",
|
|
50
|
+
]
|
|
51
|
+
|
|
52
|
+
[tool.ruff.lint.isort]
|
|
53
|
+
force-single-line = true
|
|
54
|
+
|
|
55
|
+
[tool.ruff.lint.pycodestyle]
|
|
56
|
+
max-doc-length = 240
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<title>Webcam captures</title>
|
|
6
|
+
<meta content="width=device-width, height=device-height, initial-scale=1, minimal-ui" name="viewport" />
|
|
7
|
+
<style>
|
|
8
|
+
body {
|
|
9
|
+
font-family: "Droid Sans", sans-serif;
|
|
10
|
+
}
|
|
11
|
+
*, *::before, *::after {
|
|
12
|
+
box-sizing: border-box;
|
|
13
|
+
}
|
|
14
|
+
h1 {
|
|
15
|
+
font-size: 16px;
|
|
16
|
+
text-align: left;
|
|
17
|
+
}
|
|
18
|
+
h2 {
|
|
19
|
+
font-size: 12px;
|
|
20
|
+
text-align: right;
|
|
21
|
+
color: darkgray;
|
|
22
|
+
}
|
|
23
|
+
.img-container {
|
|
24
|
+
width: 100%;
|
|
25
|
+
margin: 0;
|
|
26
|
+
padding: 4px;
|
|
27
|
+
}
|
|
28
|
+
.img-container img {
|
|
29
|
+
display: block;
|
|
30
|
+
width: 100%;
|
|
31
|
+
max-width: 100%;
|
|
32
|
+
height: auto;
|
|
33
|
+
max-height: 90vh;
|
|
34
|
+
margin: 0 auto;
|
|
35
|
+
object-fit: contain;
|
|
36
|
+
}
|
|
37
|
+
</style>
|
|
38
|
+
</head>
|
|
39
|
+
<body>
|
|
40
|
+
<h1>Webcam captures</h1>
|
|
41
|
+
<h2>{{timestamp}} <span id="timestamp-diff"></span></h2>
|
|
42
|
+
<div class="img-container">
|
|
43
|
+
<img src="{{image_path}}?timestamp={{timestamp}}">
|
|
44
|
+
</div>
|
|
45
|
+
<script>
|
|
46
|
+
setTimeout(() => window.location.reload(), 30000);
|
|
47
|
+
const imgTimestamp = new Date("{{timestamp}}".replace(" ", "T"));
|
|
48
|
+
|
|
49
|
+
function updateTimestampDiff() {
|
|
50
|
+
try {
|
|
51
|
+
const diffT = Date.now() - imgTimestamp.getTime();
|
|
52
|
+
const diffTs = Math.floor(diffT / 1000);
|
|
53
|
+
document.getElementById("timestamp-diff").textContent = `(${diffTs} s ago)`;
|
|
54
|
+
} catch (error) {
|
|
55
|
+
console.error("Error calculating timestamp difference:", error);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
updateTimestampDiff();
|
|
60
|
+
setInterval(updateTimestampDiff, 1000);
|
|
61
|
+
</script>
|
|
62
|
+
</body>
|
|
63
|
+
</html>
|