MCPcopy Index your code
hub / github.com/evinism/mistql

github.com/evinism/mistql @v0.4.8

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.4.8 ↗ · + Follow
210 symbols 839 edges 85 files 16 documented · 8%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

MistQL: Common Expression Language for JSON-like structures

mistql logo

GitHub license Python Node.js npm version npm version

MistQL is a miniature common expression language for JSON-like structures, built for embedding within applications. It supports logic for querying and manipulating JSON-like data in a simple, readable manner.

For more detailed usage information, please visit MistQL's docs site.

Join the Discord!!

Links

Developing MistQL

Contributions to MistQL are very welcome!

As MistQL is still a small project, there are no formatting requirements for either issues or pull requests.

If you're planning on making a new implementation, ping the discord and we'll coordinate!

Code workflow

Code contributions to MistQL should roughly follow standard open source workflows:

  1. Fork the project
  2. Make code changes on your fork of the project.
  3. (if necessary) Pull upstream to bring in new changes
  4. Submit a pull request to MistQL's main branch.
  5. (if necessary) Implement changes requested by maintainers.
  6. Wait for the branch to be accepted and merged by maintainers!

MistQL standard

No MistQL standard yet exists, but we're aiming for the 0.5.0 release of mistql as a standardizable language. After the 0.5.0 release, we will create a language specification, separate from any implementation.

In the meantime, we're actually pretty close.

We have a Lark grammar which defines the language's syntax. This is likely the final grammar that will be formalized into ABNF, although it is possible that we may need to fix minor issues before 0.5.0. I expect this to barely change, if at all.

Additionally our language-independent test suite is rather extensive and forms the de-facto standard of behaviors, as shared by both Python and JavaScript. While not strictly formalized, the tests and the docs together form a cohesive body of behaviors, that, except for a few minuitae, is of sufficient detail to be standardized.

Directory Structure

MistQL's directory struture is a monorepo, currently consisting of these main directories:

  1. /docs: Documentation Site (hosted at mistql.com)
  2. /js: MistQL's browser implementation (e.g. mistql on npm).
  3. /py: MistQL's python implementation (e.g. mistql on pypi).
  4. /shared: Shared assets between all implementation. Contains the language-independent test suite.

Developing for the docs site

Docs are built via a fairly standard Docusaurus 2 implementation. Please follow Docusaurus's docs for developing for the Docs site.

Developing for mistql on npm

mistql is written exclusively using typescript. Additionally, mistql uses yarn for dependency management, versioning, and uploading. JS-specific tests are stored alongside their implementation, using the suffix .spec.ts. Tests that describe the language itself are written in a language agnostic JSON format in the /shared directory. Writing tests for all feature additions and bug fixes is strongly encouraged.

For all major improvements, it is strongly encouraged to run yarn bundlesize to estimate gzipped impact of MistQL on a browser. MistQL for the browser should, in general, remain relatively close to 5kb.

The directory structure is relatively flat, except for the single src/builtins folder, which contains the implementation of all of MistQL's internal functions.

Developing for mistql on pypi

mistql is a fairly standard python package managed with poetry.

Tests can be run using pytest, e.g. poetry run pytest from within the /py directory.

Core symbols most depended-on inside this repo

of
called by 74
py/mistql/runtime_value.py
assert_type
called by 44
py/mistql/runtime_value.py
arity
called by 41
js/src/util.ts
validateType
called by 35
js/src/util.ts
execute
called by 25
js/src/executor.ts
query
called by 24
js/src/index.ts
getType
called by 22
js/src/runtimeValues.ts
tmatch
called by 16
js/src/parser.ts

Shape

Function 153
Method 30
Class 27

Languages

Python63%
TypeScript37%

Modules by API surface

py/mistql/builtins.py57 symbols
py/mistql/runtime_value.py24 symbols
js/src/parser.ts17 symbols
py/mistql/expression.py16 symbols
js/src/errors.ts15 symbols
js/src/runtimeValues.ts7 symbols
js/src/executor.ts7 symbols
py/tests/test_gardenwall.py6 symbols
py/mistql/exceptions.py6 symbols
py/tests/test_cli.py5 symbols
py/mistql/parse.py4 symbols
py/mistql/execute.py4 symbols

For agents

$ claude mcp add mistql \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact