Reduces the size of images for the web.
Project description
Shrinkix
Reduces the size of images for the web.
Documentation
Documentation is available on https://dashstrom.github.io/shrinkix.
Installation
# Using pip
pip install shrinkix
# Using uv (install in your project dependencies)
uv add shrinkix
# Using pipx (install as a tool in a venv)
pipx install shrinkix
# Using uv (install as a tool in a venv)
uv tool install shrinkix
Usage
Usage as CLI
shrinkix image.png --max-width 1024 --max-height 1024 --artist 'You' --copyright 'you@example.com'
Usage as module
from shrinkix import Shrinkix
shrinkix = Shrinkix(
max_width=1024,
max_height=1024,
keep_metadata=False,
)
shrinkix.shrink("tests/resources/test.jpg", "test.png")
Development
Contributing
Contributions are very welcome. Tests can be run with poe check, please ensure the coverage at least stays the same before you submit a pull request.
Prerequisite
First, You need to install git following the official guide and configure it.
Then, you need to install uv and update shell path with this command:
uv tool update-shell
Finally, run these commands for setup the project with dev dependencies.
git clone https://github.com/Dashstrom/shrinkix
cd shrinkix
uv sync --all-extras --python 3.10
uv run poe setup
Poe
Poe is available for help you to run tasks: uv run poe {task} or poe task within the venv.
test Run test suite.
lint Run linters: ruff checker and ruff formatter and mypy.
format Run linters in fix mode.
check Run all checks: lint, test and docs.
check-tag Check if the current tag match the version.
cov Run coverage for generate report and html.
open-cov Open html coverage report in webbrowser.
doc Build documentation.
open-doc Open documentation in webbrowser.
setup Setup pre-commit.
pre-commit Run pre-commit.
clean Clean cache files.
How to add dependency
uv add 'PACKAGE'
Ignore illegitimate warnings
To ignore illegitimate warnings you can add :
- # noqa: ERROR_CODE on the same line for ruff.
- # type: ignore[ERROR_CODE] on the same line for mypy.
- # pragma: no cover on the same line to ignore line for coverage.
- # doctest: +SKIP on the same line for doctest.
License
This work is licensed under MIT.
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 shrinkix-1.1.1.tar.gz.
File metadata
- Download URL: shrinkix-1.1.1.tar.gz
- Upload date:
- Size: 4.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
093a883dff7ae1a4cddab78e7c939522a256e414102b521a8bb058e015cf2a2c
|
|
| MD5 |
ea4d0d1ee7cd671b7a010da9cd5517a3
|
|
| BLAKE2b-256 |
7fdb1b04105e0fa4535330799974f3dec29985b6510acb9b432752b5a01d5b93
|
Provenance
The following attestation bundles were made for shrinkix-1.1.1.tar.gz:
Publisher:
publish.yml on Dashstrom/shrinkix
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
shrinkix-1.1.1.tar.gz -
Subject digest:
093a883dff7ae1a4cddab78e7c939522a256e414102b521a8bb058e015cf2a2c - Sigstore transparency entry: 369058706
- Sigstore integration time:
-
Permalink:
Dashstrom/shrinkix@55d14183ff3ca89830d66477eebdeef519d24bb9 -
Branch / Tag:
refs/tags/v1.1.1 - Owner: https://github.com/Dashstrom
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@55d14183ff3ca89830d66477eebdeef519d24bb9 -
Trigger Event:
push
-
Statement type:
File details
Details for the file shrinkix-1.1.1-py3-none-any.whl.
File metadata
- Download URL: shrinkix-1.1.1-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b8fe487d10313bfa386a92e5c1dde7223f162eb61fa88872381f7d1d58a2a8c
|
|
| MD5 |
c0fe3fe4a727597037d0abb076fc4811
|
|
| BLAKE2b-256 |
4a228dd71300975654f3e8ae010b4fe5ae0b881d04ec99a3309829b6d4e95437
|
Provenance
The following attestation bundles were made for shrinkix-1.1.1-py3-none-any.whl:
Publisher:
publish.yml on Dashstrom/shrinkix
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
shrinkix-1.1.1-py3-none-any.whl -
Subject digest:
8b8fe487d10313bfa386a92e5c1dde7223f162eb61fa88872381f7d1d58a2a8c - Sigstore transparency entry: 369058735
- Sigstore integration time:
-
Permalink:
Dashstrom/shrinkix@55d14183ff3ca89830d66477eebdeef519d24bb9 -
Branch / Tag:
refs/tags/v1.1.1 - Owner: https://github.com/Dashstrom
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@55d14183ff3ca89830d66477eebdeef519d24bb9 -
Trigger Event:
push
-
Statement type: