{"categories":[{"label":"Software Development","url":"https://skillfed.io/packages/category/software-development/13"}],"enrichment":{"capability":"Pyccolo is a library for declarative instrumentation in Python that rewrites source code with event-emitting AST transformations, letting you specify what instrumentation to perform and handling the implementation details automatically.","skillfed_tags":["metaprogramming","ast-transformation","dynamic-analysis"],"use_cases":["Build a reactive notebook kernel that tracks dataflow between cells by instrumenting variable assignments and attribute access.","Implement statement-level code coverage by registering a handler on before_stmt to log which lines execute.","Add syntax extensions like pipe operators or optional chaining by defining an AugmentationSpec and attaching handlers to the resulting AST nodes.","Trace computation graphs for automatic differentiation by intercepting operations on ordinary numpy arrays without requiring a special namespace.","Instrument imports to implement lazy loading or concolic execution by hooking module load events."],"what_it_does":"Pyccolo is a metaprogramming library that instruments Python code by rewriting its abstract syntax tree to emit fine-grained events\u2014over 100 event types covering statements, attribute access, operators, assignments, literals, calls, and returns. Instead of manually patching bytecode or writing ast.NodeTransformer classes, you subclass BaseTracer, decorate handler methods with event decorators like @pyc.before_stmt or @pyc.after_assign_rhs, and register them to observe or modify behavior. Handlers receive the instrumented value, AST node, stack frame, and event object, and can override the value that flows out of an expression by returning a replacement.\n\nThe library is designed to be ergonomic, composable, and portable. Multiple independently-written tracers can be nested in context managers and their handlers compose automatically without manual conflict resolution. Because instrumentation is embedded at the source level rather than bytecode, the same code runs across Python 3.6 through 3.14. It powers production tools like ipyflow (a reactive Jupyter kernel), pipescript (pipe operators and macros for IPython), and pycograd (automatic differentiation for plain numpy code), and has been used to build code coverage, syntactic macros, optional chaining, lazy imports, and concolic execution tools.","worth_installing":"Yes, with conditions. Pyccolo is actively maintained, has no known vulnerabilities, and installs with minimal friction. It is genuinely useful for building observability and syntax-augmentation tools that would otherwise require manual bytecode patching or complex AST visitor logic. However, it is classified as Alpha, so production use should account for potential API changes. Start with it if you need composable, source-level instrumentation; avoid it if you need guaranteed stability or are looking for a simple logging library."},"id":"pyccolo","links":{"html":"https://skillfed.io/packages/pyccolo","md":"https://skillfed.io/packages/pyccolo.md","pypi":"https://pypi.org/project/pyccolo/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-07-11","license_spdx":null,"license_treatment":"permissive","name":"pyccolo","python_support":"supports_current","summary":"Declarative instrumentation for Python"},"popularity":{"monthly_downloads":222978,"position":9254,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.0.94"}
