Reiz.io
Structural Source Code Search Engine
Install / Use
/learn @reizio/Reiz.ioREADME
reiz.io
reiz.io is a structural source code search engine for Python. Compared to the popular alternatives (e.g Github Code Search) it executes queries over the syntax trees (instead of raw source code) and tries to retrive structural knowledge (no semantics applied). For more information, please see the docs.
A gentle introduction
Reiz is the code search framework that reiz.io is built a top on. Due to it's nature, it solely works with the ASTs and intentionally avoids doing any semantical work.
Some ASTs attach a bit of contextual knowledge (e.g `Name(ctx=...)`
on python) which can be queried through simple matcher queries but
reiz.io doesn't include them when comparing references (see
matchers#reference-matcher for details).
Here is a simple ReizQL query that searches for a function that ends with a try statement where we return a call to a function that has the same name as the function we are within.
FunctionDef(~func, body=[*..., Try(body=[Return(Call(Name(~func)))])])
which would match the following;
def foo(spam):
eggs = bar()
try:
return foo(spam + eggs)
except ValueError:
return None
In the very basic sense, it is generating the AST of the code above and checks whether it fits the pattern (ReizQL query) or not.;
FunctionDef(
name='foo',
args=arguments(
posonlyargs=[],
args=[arg(arg='spam', annotation=None, type_comment=None)],
vararg=None,
kwonlyargs=[],
kw_defaults=[],
kwarg=None,
defaults=[],
),
body=[
Assign(
targets=[Name(id='eggs', ctx=Store())],
value=Call(
func=Name(id='bar', ctx=Load()),
args=[],
keywords=[],
),
type_comment=None,
),
Try(
body=[
Return(
value=Call(
func=Name(id='foo', ctx=Load()),
args=[
BinOp(
left=Name(id='spam', ctx=Load()),
op=Add(),
right=Name(id='eggs', ctx=Load()),
),
],
keywords=[],
),
),
],
handlers=[
ExceptHandler(
type=Name(id='ValueError', ctx=Load()),
name=None,
body=[
Return(
value=Constant(value=None, kind=None),
),
],
),
],
orelse=[],
finalbody=[],
),
],
decorator_list=[],
returns=None,
type_comment=None,
)
Related Skills
node-connect
354.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
112.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
354.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
354.5kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
