{"id":26558243,"url":"https://github.com/emcd/python-icecream-truck","last_synced_at":"2026-04-09T10:55:17.893Z","repository":{"id":282769498,"uuid":"949608704","full_name":"emcd/python-icecream-truck","owner":"emcd","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-16T21:06:21.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-16T21:15:30.248Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emcd.png","metadata":{"files":{"readme":"README.rst","changelog":"changelog.rst","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-16T20:28:07.000Z","updated_at":"2025-03-16T20:48:59.000Z","dependencies_parsed_at":"2025-03-16T21:15:32.176Z","dependency_job_id":"728a72e4-aa11-4b04-86f6-492cfd559d24","html_url":"https://github.com/emcd/python-icecream-truck","commit_stats":null,"previous_names":["emcd/python-icecream-truck"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emcd%2Fpython-icecream-truck","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emcd%2Fpython-icecream-truck/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emcd%2Fpython-icecream-truck/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emcd%2Fpython-icecream-truck/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emcd","download_url":"https://codeload.github.com/emcd/python-icecream-truck/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244959442,"owners_count":20538625,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-22T12:31:50.820Z","updated_at":"2026-04-09T10:55:17.879Z","avatar_url":"https://github.com/emcd.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":".. vim: set fileencoding=utf-8:\n.. -*- coding: utf-8 -*-\n.. +--------------------------------------------------------------------------+\n   |                                                                          |\n   | Licensed under the Apache License, Version 2.0 (the \"License\");          |\n   | you may not use this file except in compliance with the License.         |\n   | You may obtain a copy of the License at                                  |\n   |                                                                          |\n   |     http://www.apache.org/licenses/LICENSE-2.0                           |\n   |                                                                          |\n   | Unless required by applicable law or agreed to in writing, software      |\n   | distributed under the License is distributed on an \"AS IS\" BASIS,        |\n   | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |\n   | See the License for the specific language governing permissions and      |\n   | limitations under the License.                                           |\n   |                                                                          |\n   +--------------------------------------------------------------------------+\n\n*******************************************************************************\n                                 icecream-truck\n*******************************************************************************\n\n.. image:: https://img.shields.io/pypi/v/icecream-truck\n   :alt: Package Version\n   :target: https://pypi.org/project/icecream-truck/\n\n.. image:: https://img.shields.io/pypi/status/icecream-truck\n   :alt: PyPI - Status\n   :target: https://pypi.org/project/icecream-truck/\n\n.. image:: https://github.com/emcd/python-icecream-truck/actions/workflows/tester.yaml/badge.svg?branch=master\u0026event=push\n   :alt: Tests Status\n   :target: https://github.com/emcd/python-icecream-truck/actions/workflows/tester.yaml\n\n.. image:: https://emcd.github.io/python-icecream-truck/coverage.svg\n   :alt: Code Coverage Percentage\n   :target: https://github.com/emcd/python-icecream-truck/actions/workflows/tester.yaml\n\n.. image:: https://img.shields.io/github/license/emcd/python-icecream-truck\n   :alt: Project License\n   :target: https://github.com/emcd/python-icecream-truck/blob/master/LICENSE.txt\n\n.. image:: https://img.shields.io/pypi/pyversions/icecream-truck\n   :alt: Python Versions\n   :target: https://pypi.org/project/icecream-truck/\n\n.. image:: https://raw.githubusercontent.com/emcd/python-icecream-truck/master/data/pictures/logo.svg\n   :alt: Icecream Truck Logo\n   :width: 800\n   :align: center\n\n\n🍦 **Flavorful Debugging** - A Python library which enhances the powerful and\nwell-known `icecream \u003chttps://github.com/gruns/icecream\u003e`_ package with\nflavored traces, configuration hierarchies, customized outputs, ready-made\nrecipes, and more.\n\nKey Features ⭐\n===============================================================================\n\n🍒 **Debugger Flavors**: Numeric trace depths to control level of debugging\ndetail (``0`` to ``9``) or custom named flavors for specific subsystems (e.g.,\n``io``, ``reporting``), traditional logging levels (e.g., ``info``, ``error``),\nor whatever else you can imagine.\n\n🌳 **Module Hierarchy**: Global and per-module configs with inheritance for\nprecise control over output prefixes, formatters, custom flavors, etc....\n\n🖨️ **Printer Factory**: Dyanamically associate output functions with debugger\nobjects based on module name, flavor, etc.... Swap in customized ``print``,\n``logging``, or other sinks as desired.\n\n📚 **Library-Friendly**: Non-intrusive registration for libraries without\nstepping on application debugger/logging configuration.\n\n🚦 **Disabled by Default**: Can leave in production code and explicitly\nactivate portions as needed. (Performance and security considerations\nnotwithstanding.)\n\nInstallation 📦\n===============================================================================\n\nMethod: Install Python Package\n-------------------------------------------------------------------------------\n\nInstall via `uv \u003chttps://github.com/astral-sh/uv/blob/main/README.md\u003e`_ ``pip``\ncommand:\n\n::\n\n    uv pip install icecream-truck\n\nOr, install via ``pip``:\n\n::\n\n    pip install icecream-truck\n\nExamples 💡\n===============================================================================\n\nPlease see the `examples directory\n\u003chttps://github.com/emcd/python-icecream-truck/tree/master/examples\u003e`_ for\ngreater detail.\n\nUniversal Availability\n-------------------------------------------------------------------------------\n\nInstall an icecream truck as a Python builtin (default alias, ``ictr``) and\nthen use anywhere in your codebase:\n\n.. code-block:: python\n\n    from ictruck import install\n    install( trace_levels = 3 )  # Enable TRACE0 to TRACE3\n    message = \"Hello, debug world!\"\n    ictr( 1 )( message )  # Prints: TRACE1| message: 'Hello, debug world!'\n\nLibrary Registration\n-------------------------------------------------------------------------------\n\nLibraries can register their own configurations without overriding those of the\napplication or other libraries. By default, the name of the calling module is\nused to register a default configuration:\n\n.. code-block:: python\n\n    from ictruck import register_module\n    register_module( )  # Can pass custom configuration.\n\nWhen ``install`` is called, any module configurations that were previously\nregistered via ``register_module`` are added to the installed icecream truck.\nThis allows an application to setup output after libraries have already\nregistered their flavors, giving lots of initialization-time and runtime\nflexibility.\n\nRecipes for Customization\n-------------------------------------------------------------------------------\n\nPlease see the package documentation for available recipes.\n\nE.g., integrate ``icecream``-based introspection and formatting with the\n``logging`` module in the Python standard library:\n\n.. code-block:: python\n\n    import logging\n    from ictruck.recipes.logging import produce_truck\n    logging.basicConfig( level = logging.INFO )\n    truck = produce_truck( )\n    admonition = \"Careful now!\"\n    answer = 42\n    truck( 'warning' )( admonition )  # Logs: WARNING:__main__:ic| admonition: 'Careful now!'\n    truck( 'info' )( answer )         # Logs: INFO:__main__:ic| answer: 42\n    ## Note: Module name will be from whatever module calls the truck.\n\nMotivation 🚚\n===============================================================================\n\nWhy ``icecream-truck``?\n\nThere is nothing wrong with the ``icecream`` or ``logging`` packages. However,\nthere are times that the author of ``icecream-truck`` has wanted, for various\nreasons, more than these packages inherently offer:\n\n* **Coexistence**: Application and libraries can coexist without configuration\n  clashes.\n\n  - Library developers are `strongly advised not to create custom levels\n    \u003chttps://docs.python.org/3/howto/logging.html#custom-levels\u003e`_ in\n    ``logging``.\n\n  - Library developers are `advised on how to avoid polluting stderr\n    \u003chttps://docs.python.org/3/howto/logging.html#configuring-logging-for-a-library\u003e`_\n    in ``logging``, when an application has not supplied a configuration.\n\n  - Loggers `propagate upwards\n    \u003chttps://docs.python.org/3/library/logging.html#logging.Logger.propagate\u003e`_\n    by default in ``logging``. This means that libraries must explicitly\n    opt-out of propagation if their authors want to be good citizens and not\n    contribute to noise pollution / signal obfuscation.\n\n* **Granularity**: Control of debug output by depth threshold and subsystem.\n\n  - Only one default debugging level (``DEBUG``) with ``logging``. Libraries\n    cannot safely extend this. (See point about coexistence).\n\n  - No concept of debugging level with ``ic`` builtin. Need to orchestrate\n    multiple ``icecream.IceCreamDebugger`` instances to support this. (In fact,\n    this is what ``icecream-truck`` does.)\n\n  - While logger hierarchies in ``logging`` do support the notion of software\n    subsystems, hierarchies are not always the most convenient or abbreviated\n    way of representing subsystems which span parts or entireties of modules.\n\n* **Signal**: Prevention of undesirable library chatter.\n\n  - The ``logging`` root logger will log all messages, at its current log\n    level or higher, which propagate up to it. Many Python libraries have\n    opt-out rather than opt-in logging, so you see all of their ``DEBUG`` and\n    ``INFO`` spam unless you surgically manipulate their loggers or squelch\n    the overall log level.\n\n  - Use of the ``ic`` builtin is only recommended for temporary debugging. It\n    cannot be left in production code without spamming. While the ``enabled``\n    flag on the ``ic`` builtin can be set to false, it is easy to forget and\n    also applies to every place where ``ic`` is used in the code. (See point\n    about granularity.)\n\n* **Extensibility**: More natural integration with packages like ``rich`` via\n  robust recipes.\n\n  - While it is not difficult to change the ``argToStringFunction`` on ``ic``\n    to be ``rich.pretty.pretty_repr``, there is some repetitive code involved\n    in each project which wants to do this. And, from a safety perspective,\n    there should be a fallback if ``rich`` fails to import.\n\n  - Similarly, one can add a ``rich.logging.RichHandler`` instance to a logger\n    instance with minimal effort. However, depending on the the target output\n    stream, one may also need to build a ``rich.console.Console`` first and\n    pass that to the handler. This handler will also compete with whatever\n    handler has been set on the root logger. So, some care must be taken to\n    prevent propagation. Again, this is repetitive code across projects and\n    there are import safety fallbacks to consider.\n\nContribution 🤝\n===============================================================================\n\nContribution to this project is welcome! However, it must follow the `code of\nconduct\n\u003chttps://emcd.github.io/python-project-common/stable/sphinx-html/common/conduct.html\u003e`_\nfor the project.\n\nPlease file bug reports and feature requests in the `issue tracker\n\u003chttps://github.com/emcd/python-icecream-truck/issues\u003e`_ or submit `pull\nrequests \u003chttps://github.com/emcd/python-icecream-truck/pulls\u003e`_ to\nimprove the source code or documentation.\n\nFor development guidance and standards, please see the `development guide\n\u003chttps://emcd.github.io/python-icecream-truck/stable/sphinx-html/contribution.html#development\u003e`_.\n\n\nAdditional Indicia\n===============================================================================\n\n.. image:: https://img.shields.io/github/last-commit/emcd/python-icecream-truck\n   :alt: GitHub last commit\n   :target: https://github.com/emcd/python-icecream-truck\n\n.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-orange.json\n   :alt: Copier\n   :target: https://github.com/copier-org/copier\n\n.. image:: https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg\n   :alt: Hatch\n   :target: https://github.com/pypa/hatch\n\n.. image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit\n   :alt: pre-commit\n   :target: https://github.com/pre-commit/pre-commit\n\n.. image:: https://microsoft.github.io/pyright/img/pyright_badge.svg\n   :alt: Pyright\n   :target: https://microsoft.github.io/pyright\n\n.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json\n   :alt: Ruff\n   :target: https://github.com/astral-sh/ruff\n\n.. image:: https://img.shields.io/badge/hypothesis-tested-brightgreen.svg\n   :alt: Hypothesis\n   :target: https://hypothesis.readthedocs.io/en/latest/\n\n.. image:: https://img.shields.io/pypi/implementation/icecream-truck\n   :alt: PyPI - Implementation\n   :target: https://pypi.org/project/icecream-truck/\n\n.. image:: https://img.shields.io/pypi/wheel/icecream-truck\n   :alt: PyPI - Wheel\n   :target: https://pypi.org/project/icecream-truck/\n\n\nOther Projects by This Author 🌟\n===============================================================================\n\n\n* `python-absence \u003chttps://github.com/emcd/python-absence\u003e`_ (`absence \u003chttps://pypi.org/project/absence/\u003e`_ on PyPI)\n\n  🕳️ A Python library package which provides a **sentinel for absent values** - a falsey, immutable singleton that represents the absence of a value in contexts where ``None`` or ``False`` may be valid values.\n* `python-accretive \u003chttps://github.com/emcd/python-accretive\u003e`_ (`accretive \u003chttps://pypi.org/project/accretive/\u003e`_ on PyPI)\n\n  🌌 A Python library package which provides **accretive data structures** - collections which can grow but never shrink.\n* `python-classcore \u003chttps://github.com/emcd/python-classcore\u003e`_ (`classcore \u003chttps://pypi.org/project/classcore/\u003e`_ on PyPI)\n\n  🏭 A Python library package which provides **foundational class factories and decorators** for providing classes with attributes immutability and concealment and other custom behaviors.\n* `python-dynadoc \u003chttps://github.com/emcd/python-dynadoc\u003e`_ (`dynadoc \u003chttps://pypi.org/project/dynadoc/\u003e`_ on PyPI)\n\n  📝 A Python library package which bridges the gap between **rich annotations** and **automatic documentation generation** with configurable renderers and support for reusable fragments.\n* `python-falsifier \u003chttps://github.com/emcd/python-falsifier\u003e`_ (`falsifier \u003chttps://pypi.org/project/falsifier/\u003e`_ on PyPI)\n\n  🎭 A very simple Python library package which provides a **base class for falsey objects** - objects that evaluate to ``False`` in boolean contexts.\n* `python-frigid \u003chttps://github.com/emcd/python-frigid\u003e`_ (`frigid \u003chttps://pypi.org/project/frigid/\u003e`_ on PyPI)\n\n  🔒 A Python library package which provides **immutable data structures** - collections which cannot be modified after creation.\n* `python-mimeogram \u003chttps://github.com/emcd/python-mimeogram\u003e`_ (`mimeogram \u003chttps://pypi.org/project/mimeogram/\u003e`_ on PyPI)\n\n  📨 A command-line tool for **exchanging collections of files with Large Language Models** - bundle multiple files into a single clipboard-ready document while preserving directory structure and metadata... good for code reviews, project sharing, and LLM interactions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femcd%2Fpython-icecream-truck","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femcd%2Fpython-icecream-truck","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femcd%2Fpython-icecream-truck/lists"}