Skip to main content

A command line tool for image processing and uploading (ex. S3-type)

Project description

pictl

A command line tool for Image Compression and Upload (ex. S3-type)

PyPI GitHub GitHub code size in bytes PyPI - Python Version

Libraries.io dependency status for GitHub repo GitHub Workflow Status PyPI - Downloads

Engligh | 中文简体

Why a new project

When I publish blog articles, it's quite inefficient for me to prepare images.

Although there exist many good enough tools, like uPic, PicGo, and so on, they still cannot meet my need completely.

For me, these points are very necessary:

  • All images should be compressed and transformed into webp format (less storage and loading time).
  • All images can be uploaded to S3-like object storage with a unique short name.
  • It should be very easy to use. It‘s better if no web UI or GUI. Command line first.
  • (Optional) The customized watermark can be added into all images automatically.
  • (Optional) All images can be resized into the defined default size automatically.
  • (Optional) It defaults to read the image from the clipboard.

Actually uPic and PicGo can provide most of the above functions, but not so good in some points.

  • They don't provide the transformation to webp format.
  • They don't provide the support for Cloudflare R2 (though uPic paid version in appstore provides it).

It's quite time-consuming for me to write a plugin for PicGo or rewrite codes for uPic.

So why not write a new tool?

The project name

Because it's designed for image helper in writing blog articles and using only with command line, it's named PICTL, a short name for Picture Control.

The architecture

Here is the architecture of this project.

It seems very similar to PicGo 😂, but it will be different.

The architecture

Installation

From source

git clone https://github.com/zhonger/pictl
cd pictl
pip3 install .

PIP

pip3 install pictl

Brew

(PS: It will support in the next version. Now it's supported in MacOS. Linux is not available yet.)

brew tap zhonger/pictl
brew install pictl

Usage

Config

The config file for PICTL is named .pictlrc with toml format. The config file is located at ~/.pictlrc.

Until now PICTL supports:

Name type in config
Cloudflare R2 R2
AWS S3 S3
Tencent COS COS(Tencent)

Manually

[basic]
length = 6
ntype = "random"
algorithm = "sha1"

[blog]
type = "S3"
endpoint = "https://s3.ap-northeast-1.amazonaws.com"
bucket = "blog"
region = "ap-northeast-1"
prefix = "blog"
key = "this-is-a-long-key-for-s3"
secret = "this-is-a-long-secret-for-s3"
url = "https://i.lisz.me"

Interactive way

╰─$ pictl config
Usage: pictl config [OPTIONS] COMMAND [ARGS]...

  Operations for the config file `~/.pictlrc`.

Options:
  -h, --help  Show this message and exit.

Commands:
  add     Add configs to the config file.
  delete  Delete config group from the config file.
  info    Check the configs.
  init    Initialize config file with default configs

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

pictl-0.3.0.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

pictl-0.3.0-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file pictl-0.3.0.tar.gz.

File metadata

  • Download URL: pictl-0.3.0.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.0 Linux/5.15.0-1040-azure

File hashes

Hashes for pictl-0.3.0.tar.gz
Algorithm Hash digest
SHA256 a2223a4b069ffdf11a1af3232afb1987fec03e4a291f0790a219e3b608328dec
MD5 513fd65c12effab3efefde74b366f135
BLAKE2b-256 bf0788c0cfd54ac5124385e99f893a8bb2001420fd8262bb5ee992de48e70d76

See more details on using hashes here.

File details

Details for the file pictl-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: pictl-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.0 Linux/5.15.0-1040-azure

File hashes

Hashes for pictl-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 70989c8b1bca8bc19f1bacc7eb9dadc0c85a66fb8bc681cb66acc0f9a99d95ac
MD5 dab9335ce1c1c5a64104e501f551154b
BLAKE2b-256 1bb016e06a9fe279f9fe82abc0405449be38b49fd3c6108a2da031dbb19d9b3d

See more details on using hashes here.

Supported by

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