Skip to main content

Reduces the size of images for the web.

Project description

CI : Docs CI : Lint CI : Tests PyPI : shrinkix Python : versions Discord License : MIT

Description

Reduces the size of images for the web.

Documentation

Documentation is available on https://dashstrom.github.io/shrinkix

Installation from scratch

Windows

Open an Admin PowerShell with windows + X, then press a.

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

MacOs and Linux

curl -LsSf https://astral.sh/uv/install.sh | sh

Package installation (All System)

You can install shrinkix using uv from PyPI

uv tool install shrinkix

Usage

Usage as script

shrinkix image.png --max-width 1024 --max-height 1024 --artist 'Dashstrom' --copyright 'dashstrom.pro@gmail.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.

Setup

You need to install uv and Git for work with this project.

git clone https://github.com/Dashstrom/shrinkix
cd shrinkix
uv sync
uv run poe setup

Poe

Poe is available for help you to run tasks.

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.
docs           Build documentation.
open-docs      Open documentation in webbrowser.
setup          Setup pre-commit.
pre-commit     Run pre-commit.
commit         Test, commit and push.
clean          Clean cache files.

Skip commit verification

If the linting is not successful, you can’t commit. For forcing the commit you can use the next command :

git commit --no-verify -m 'MESSAGE'

Commit with commitizen

To respect commit conventions, this repository uses Commitizen.

cz c

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.

Uninstall

pipx uninstall shrinkix

License

This work is licensed under MIT.

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

shrinkix-1.0.0.tar.gz (89.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shrinkix-1.0.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file shrinkix-1.0.0.tar.gz.

File metadata

  • Download URL: shrinkix-1.0.0.tar.gz
  • Upload date:
  • Size: 89.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for shrinkix-1.0.0.tar.gz
Algorithm Hash digest
SHA256 dd3738c3941619020c96b4ca343e33c412a5bbac5b19c80583bb3755cf2df119
MD5 5c58808825d0ce26367d51b5b388ae65
BLAKE2b-256 bcd0acd8e6afd82cf07e10b8734e9bced30fe8fda1469c416371c1e05030572f

See more details on using hashes here.

Provenance

The following attestation bundles were made for shrinkix-1.0.0.tar.gz:

Publisher: publish.yml on Dashstrom/shrinkix

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file shrinkix-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: shrinkix-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for shrinkix-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6c3dfb23e06aa4a051caefb5057c3a1e639462e356916b91aab69cceb1de8cfe
MD5 41f51019e7973f8e6336a94626ea5761
BLAKE2b-256 9540ae1543f1d9b1763329e10807a0c9470160cf4dc636c0ea926eac72d2a4de

See more details on using hashes here.

Provenance

The following attestation bundles were made for shrinkix-1.0.0-py3-none-any.whl:

Publisher: publish.yml on Dashstrom/shrinkix

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page