birdseye
Graphical Python debugger which lets you easily view the values of all evaluated expressions
Top Related Projects
Jupyter Interactive Notebook
Python extension for Visual Studio Code
The official Python SDK for Sentry.io
Parsing ELF and DWARF in Python
Scalene: a high-performance, high-precision CPU, GPU, and memory profiler for Python with AI-powered optimization proposals
Quick Overview
Birdseye is a Python debugger that provides a graphical interface for inspecting code execution. It allows developers to visualize the flow of their code, inspect variable values, and understand complex logic more easily. Birdseye integrates with popular IDEs and can be used as a standalone tool.
Pros
- Offers a unique graphical representation of code execution
- Provides detailed information about variable values and types
- Integrates well with popular IDEs like PyCharm and VS Code
- Supports both local and remote debugging
Cons
- May have a steeper learning curve compared to traditional debuggers
- Can be resource-intensive for large or complex programs
- Limited support for certain Python features (e.g., some decorators)
- Requires additional setup and configuration
Code Examples
- Basic usage:
from birdseye import eye
@eye
def fibonacci(n):
if n <= 1:
return n
return fibonacci(n-1) + fibonacci(n-2)
result = fibonacci(5)
print(result)
This example demonstrates how to use the @eye
decorator to enable Birdseye debugging for a function.
- Debugging a loop:
from birdseye import eye
@eye
def process_list(items):
result = []
for item in items:
if isinstance(item, int):
result.append(item * 2)
else:
result.append(str(item).upper())
return result
data = [1, "hello", 3, "world", 5]
processed = process_list(data)
print(processed)
This example shows how Birdseye can help visualize the execution of a loop with conditional logic.
- Debugging a class method:
from birdseye import eye
class Calculator:
@eye
def add(self, a, b):
return a + b
@eye
def multiply(self, a, b):
return a * b
calc = Calculator()
result = calc.add(5, calc.multiply(3, 4))
print(result)
This example demonstrates how to use Birdseye to debug methods within a class.
Getting Started
To get started with Birdseye, follow these steps:
-
Install Birdseye:
pip install birdseye
-
Add the
@eye
decorator to functions you want to debug:from birdseye import eye @eye def my_function(): # Your code here
-
Run your Python script as usual.
-
Open a web browser and navigate to
http://localhost:7777
to view the Birdseye interface. -
Click on the function calls in the interface to explore the execution details.
Competitor Comparisons
Jupyter Interactive Notebook
Pros of Notebook
- Widely adopted and supported by the data science community
- Integrates with multiple programming languages (Python, R, Julia, etc.)
- Allows for interactive coding, visualization, and documentation in a single environment
Cons of Notebook
- Limited debugging capabilities compared to specialized debugging tools
- Can become cluttered and difficult to manage with large amounts of code and output
- Execution order can be confusing, leading to potential reproducibility issues
Code Comparison
Notebook:
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0, 10, 100)
plt.plot(x, np.sin(x))
plt.show()
Birdseye:
from birdseye import eye
@eye
def plot_sine():
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0, 10, 100)
plt.plot(x, np.sin(x))
plt.show()
plot_sine()
The Notebook code is more concise and immediately executable, while the Birdseye code requires the @eye
decorator for debugging but provides more detailed inspection of function execution.
Python extension for Visual Studio Code
Pros of vscode-python
- Extensive feature set for Python development in VS Code
- Large user base and active community support
- Seamless integration with VS Code's ecosystem
Cons of vscode-python
- Heavier resource usage due to its comprehensive nature
- Steeper learning curve for beginners
- May include features not needed by all users
Code Comparison
birdseye:
from birdseye import eye
@eye
def factorial(n):
if n == 0:
return 1
return n * factorial(n - 1)
vscode-python:
# No specific code required; works with standard Python files
# Debugging is initiated through VS Code's interface
# Example breakpoint:
breakpoint()
Key Differences
- birdseye focuses on detailed code visualization and debugging
- vscode-python provides a full-featured Python development environment
- birdseye offers unique call-by-call inspection of function execution
- vscode-python integrates with VS Code's built-in debugging tools
Use Cases
birdseye is ideal for:
- Detailed function analysis
- Educational purposes
- Debugging complex algorithms
vscode-python is suitable for:
- General Python development
- Large-scale projects
- Integrated development workflows
The official Python SDK for Sentry.io
Pros of sentry-python
- Comprehensive error tracking and performance monitoring for Python applications
- Integrates seamlessly with the Sentry platform for detailed error analysis and reporting
- Supports a wide range of Python frameworks and libraries out of the box
Cons of sentry-python
- Requires a Sentry account and potentially paid plans for advanced features
- May introduce a slight performance overhead in production environments
- Less focused on local debugging and code visualization compared to birdseye
Code Comparison
sentry-python:
import sentry_sdk
sentry_sdk.init(
dsn="https://examplePublicKey@o0.ingest.sentry.io/0",
traces_sample_rate=1.0
)
birdseye:
from birdseye import eye
@eye
def my_function(x, y):
return x + y
sentry-python is designed for production error tracking and performance monitoring, while birdseye focuses on local debugging and code visualization. sentry-python requires initialization with a DSN and offers various configuration options, whereas birdseye uses a simple decorator to enable debugging for specific functions.
Parsing ELF and DWARF in Python
Pros of pyelftools
- Specialized for parsing ELF files, providing in-depth analysis of binary files
- Lightweight and focused on a specific task, making it efficient for its purpose
- Well-documented with examples and use cases for ELF file manipulation
Cons of pyelftools
- Limited to ELF file analysis, lacking broader debugging capabilities
- Requires more manual setup and coding to extract specific information
- Less visual and interactive compared to birdseye's debugging interface
Code Comparison
pyelftools:
from elftools.elf.elffile import ELFFile
with open('binary_file', 'rb') as f:
elf = ELFFile(f)
for section in elf.iter_sections():
print(section.name)
birdseye:
from birdseye import eye
@eye
def function_to_debug(x, y):
result = x + y
return result
function_to_debug(5, 3)
While pyelftools focuses on low-level binary analysis, birdseye provides a high-level debugging experience with visual representations of code execution. pyelftools is more suitable for developers working with ELF files and system-level programming, whereas birdseye caters to general Python debugging needs with an emphasis on visualization and ease of use.
Scalene: a high-performance, high-precision CPU, GPU, and memory profiler for Python with AI-powered optimization proposals
Pros of Scalene
- Provides detailed CPU, GPU, and memory profiling with minimal overhead
- Offers line-by-line analysis and identifies potential memory leaks
- Supports both Python and C/C++ code profiling
Cons of Scalene
- Limited visualization options compared to Birdseye's interactive interface
- Focuses primarily on performance metrics rather than code execution flow
- May require more setup and configuration for advanced features
Code Comparison
Scalene usage:
from scalene import scalene_profiler
@scalene_profiler
def my_function():
# Your code here
Birdseye usage:
from birdseye import eye
@eye
def my_function():
# Your code here
Both tools use decorators to profile functions, but Scalene focuses on performance metrics while Birdseye provides detailed execution tracing and visualization.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
|logo| birdseye
|Build Status| |Supports Python versions 2.7 and 3.5+|
birdseye is a Python debugger which records the values of expressions in a function call and lets you easily view them after the function exits. For example:
.. figure:: https://i.imgur.com/rtZEhHb.gif :alt: Hovering over expressions
You can use birdseye no matter how you run or edit your code. Just pip install birdseye
, add the @eye
decorator
as seen above, run your function however you like, and view the results in your browser.
It's also integrated with some common tools <http://birdseye.readthedocs.io/en/latest/integrations.html>
_ for a smoother experience.
You can try it out instantly on futurecoder <https://futurecoder.io/course/#ide>
_: enter your code in the editor on the left and click the birdseye
button to run. No imports or decorators required.
Feature Highlights
Rather than stepping through lines, move back and forth through loop iterations and see how the values of selected expressions change:
.. figure:: https://i.imgur.com/236Gj2E.gif :alt: Stepping through loop iterations
See which expressions raise exceptions, even if theyâre suppressed:
.. figure:: http://i.imgur.com/UxqDyIL.png :alt: Exception highlighting
Expand concrete data structures and objects to see their contents. Lengths and depths are limited to avoid an overload of data.
.. figure:: http://i.imgur.com/PfmqZnT.png :alt: Exploring data structures and objects
Calls are organised into functions (which are organised into files) and ordered by time, letting you see what happens at a glance:
.. figure:: https://i.imgur.com/5OrB76I.png :alt: List of function calls
.. |logo| image:: https://i.imgur.com/i7uaJDO.png .. |Build Status| image:: https://travis-ci.com/alexmojaki/birdseye.svg?branch=master :target: https://travis-ci.com/alexmojaki/birdseye .. |Supports Python versions 2.7 and 3.5+| image:: https://img.shields.io/pypi/pyversions/birdseye.svg :target: https://pypi.python.org/pypi/birdseye
.. inclusion-end-marker
Read more documentation here <http://birdseye.readthedocs.io>
_
Top Related Projects
Jupyter Interactive Notebook
Python extension for Visual Studio Code
The official Python SDK for Sentry.io
Parsing ELF and DWARF in Python
Scalene: a high-performance, high-precision CPU, GPU, and memory profiler for Python with AI-powered optimization proposals
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot