Icecream: Never use print() to debug again in Python

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

InfluxDB – Built for High-Performance Time Series Workloads
InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.
www.influxdata.com
featured
Sevalla - Deploy and host your apps and databases, now with $50 credit!
Sevalla is the PaaS you have been looking for! Advanced deployment pipelines, usage-based pricing, preview apps, templates, human support by developers, and much more!
sevalla.com
featured
  1. icecream

    🍦 Never use print() to debug again.

    It seems like it was a coincidence. See comment thread:

    https://github.com/gruns/icecream/commit/ee849b840eb34242aa2...

  2. InfluxDB

    InfluxDB – Built for High-Performance Time Series Workloads. InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.

    InfluxDB logo
  3. q

    Quick and dirty debugging output for tired programmers. ⛺ (by zestyping)

    For an even easier-to-remember alternative, there’s q: https://github.com/zestyping/q

    All you need is `import q`. q works like a function (q(x)), like a variable (q|x and q/x, so you get different operator precedences) and like a decorator (@q), so it can be used in practically any circumstance for a quick debug print. Plus, the name sounds like you’re interrogating something.

  4. python-devtools

    Dev tools for python

    __builtins__['debug'] = debug

    (see https://github.com/samuelcolvin/python-devtools#usage-withou...)

    This would work with icecream too.

    The second advantage of not needing the import is that CI fails if you forget to remove all debug() commands.

  5. PySnooper

    Never use print for debugging again

    Funny, a few months back I added this sentence to PySnooper's readme:

    "PySnooper is a poor man's debugger. If you've used Bash, it's like set -x for Python, except it's fancier."

    https://github.com/cool-RR/PySnooper

  6. py_better_exchook

    Zero-dependency Python excepthook/library that intelligently prints variables in stack traces

    If you like this, you might also like my small debugging utility, a better_exchook replacement: https://github.com/albertz/py_better_exchook

    Simple example:

        assert x == 4

  7. ray

    Debug with Ray to fix problems faster (by spatie)

    I am the same, it's the most easy. Very interesting is that in the laravel php world currently an interesting product is gaining momentum: Ray (https://myray.app/)

    So basically it's dump with a lot of neat extras and instead of looking at the console of the script, or the website you are printing on you push this to a little desktop application, from every of your languages you are using. Something like log collection for everything on your desktop.

  8. pdbpp

    pdb++, a drop-in replacement for pdb (the Python debugger)

    I like to use PDB++ which is a drop in replacement for PDB

    https://github.com/pdbpp/pdbpp

  9. Sevalla

    Deploy and host your apps and databases, now with $50 credit! Sevalla is the PaaS you have been looking for! Advanced deployment pipelines, usage-based pricing, preview apps, templates, human support by developers, and much more!

    Sevalla logo
  10. panopticon

    Python tracing module to visualize code execution.

    I've built https://github.com/kunalb/panopticon to easily trace function execution to handle a similar use case, except that it generates output for chrome://tracing instead of printing out lines.

    cPython's settrace/setprofile functionality enables so many cool tools.

  11. pyset_x

    Like `set -x` in bash, for Python

    I started writing a very-alpha related tool, https://github.com/czinck/pyset_x. As the name implies, it's like `set -x` in bash, in that it prints every line as it executes. It's more useful for situations where you have some complicated control flow and it's not working exactly how you expect.

  12. snoop

    A powerful set of Python debugging tools, based on PySnooper (by alexmojaki)

  13. Puts Debuggerer

    Ruby library for improved puts debugging, automatically displaying bonus useful information such as source line number and source code.

    I was wondering if there was anything like this for Ruby. Turns out there is: https://github.com/AndyObtiva/puts_debuggerer. With this library,

      pd bug_or_band

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • What Python debugger do you use?

    4 projects | /r/learnpython | 26 Mar 2023
  • Does anyone use python debugger?

    2 projects | /r/Python | 12 Feb 2023
  • Trace your Python process line by line with minimal overhead!

    3 projects | news.ycombinator.com | 15 Jan 2023
  • What was the most helpful resource that allowed you become a better coder?

    1 project | /r/learnpython | 5 Aug 2022
  • “I think the vast majority of developers still debug using print() statements”

    1 project | news.ycombinator.com | 4 Jun 2022

Did you know that Python is
the 2nd most popular programming language
based on number of references?