Infra-agnostic image processing core for Intro to Cloud Computing exercises
Project description
image-core (Python)
Infra-agnostic image processing core for exercise solutions.
Prerequisites
- Python 3.11+
- pip (or uv/pip-tools)
Features
- Validate image payloads
- Resize by longest edge
- Convert output format
- Return required metadata
- Bytes and stream entry points
Install
Published package:
pip install intro-to-cc-image-core
Local package test (without publishing):
pip install .
API Surface
This package intentionally exposes a small student-facing API:
| Function | Input style | Typical use case |
|---|---|---|
process_image_bytes |
bytes |
Use when you already have complete bytes in memory |
process_image_stream |
BinaryIO stream |
Use when image data comes from stream-based IO |
Persistence and storage integration stay in your app code.
Bytes Usage
from image_core.models import ProcessingConfig
from image_core.processing import process_image_bytes
result = process_image_bytes(
source_bytes=input_bytes,
config=ProcessingConfig(
max_long_edge_px=1280,
output_format="JPEG",
output_quality=85,
),
image_id="img-1",
)
print(result.metadata, result.content_type)
Build and Publish Checklist
python -m pip install --upgrade build twine
python -m build
python -m twine check dist/*
python -m twine upload dist/*
Stream Usage
from image_core.models import ProcessingConfig
from image_core.processing import process_image_stream
with open("./input.png", "rb") as source_stream:
result = process_image_stream(
source_stream=source_stream,
config=ProcessingConfig(
max_long_edge_px=1280,
output_format="JPEG",
output_quality=85,
),
image_id="img-2",
asset_path="processed/img-2.jpg",
)
print(result.metadata, result.content_type)
Project details
Release history Release notifications | RSS feed
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 intro_to_cc_image_core-0.1.0.tar.gz.
File metadata
- Download URL: intro_to_cc_image_core-0.1.0.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1232ae41967734f98798ec5769779714f30aacfacb56bf1e4643f18a67f7939e
|
|
| MD5 |
1b54763554e6d75047cbb0f32bbe62b3
|
|
| BLAKE2b-256 |
385088884f482fbd3a86b26f8c167921aed30ede13c8f2c73cce3c6415930279
|
File details
Details for the file intro_to_cc_image_core-0.1.0-py3-none-any.whl.
File metadata
- Download URL: intro_to_cc_image_core-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b4e15527d0b7de7106c356576fc623a1233f6f1d6ac53ad5720509c9dcd5c71
|
|
| MD5 |
022dc8a53c571f2a8927b84ceee4aadf
|
|
| BLAKE2b-256 |
d871201ecfbb044589a2ca2ebd5a4d5e3063513eddf208eec9e2a4194b7802d4
|