Skip to main content

A simple formatter for removing icecream from your code after debugging.

Project description

Unicecream

A simple formatter for removing icecream from your code after debugging.

Python Version PyPI - Version GitHub License

Example

lyaguxa@thinkpad:$ cat somefile.py
from icecream import ic

def return_one() -> int:
    return 1

ic(return_one())

lyaguxa@thinkpad:$ unicecream --check somefile.py
somefile.py:6:1: IC001 remove icecream call
somefile.py:1:1: IC003 remove icecream from-import

lyaguxa@thinkpad:$ unicecream somefile.py
fixed: somefile.py

lyaguxa@thinkpad:$ cat somefile.py
def return_one() -> int:
    return 1

return_one()

Installation

pip install unicecream # for pyproject in python3.9 install unicecream[toml]

Usage

usage: unicecream [-h] [--check] [--select CODE] [--ignore CODE] [--version] path

Remove icecream debug calls from Python files

positional arguments:
  path

optional arguments:
  -h, --help     show this help message and exit
  --check
  --select CODE  Select rule code
  --ignore CODE  Ignore rule code
  --version      show program's version number and exit

Configuration

In pyproject:

[tool.unicecream]

# Rules to enable by default
select = ["IC001", "IC002", "IC003"]

# Rules to ignore
ignore = []

# Paths to skip
exclude = [
    ".venv",
    "__pycache__",
    "build",
    "dist"
]

Pre-commit

repos:
  - repo: https://github.com/lyaguxafrog/unicecream
    rev: 0.2.1 # 0.2.1 is the minimum version that supports pre-commit.
    hooks:
      - id: unicecream

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

unicecream-0.2.1.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

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

unicecream-0.2.1-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file unicecream-0.2.1.tar.gz.

File metadata

  • Download URL: unicecream-0.2.1.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for unicecream-0.2.1.tar.gz
Algorithm Hash digest
SHA256 e5b2d49938aa069c24d31ab7a5be4ec5c0d9bad96f1d3d3551721ea1836c96bd
MD5 260e928f97f93749850d2c0672ae5ac8
BLAKE2b-256 5312f403a036f2b2a3e1afbd207fa39b69a0275019dbbcc01049524c3e355a80

See more details on using hashes here.

File details

Details for the file unicecream-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: unicecream-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for unicecream-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 17c69ae6818d926b5ea43e7f7cb4a688e34b4b503e48b059a54a0555ad787505
MD5 5088d57db248b60394c5dde564e8f173
BLAKE2b-256 afa2c940aaa222a697db3de8bc1a3f9cb56feac551b79e7e38d0a9f74f239cbe

See more details on using hashes here.

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