Metadata-Version: 2.4
Name: larql
Version: 0.1.0
Summary: Lark Parser for SPARQL 1.1
Author-email: Lukas Plank <lupl@tuta.io>
Requires-Python: >=3.11
Requires-Dist: lark>=1.2.2
Description-Content-Type: text/markdown

# ⅃arqL 🐦✨

[![W3C SPARQL 1.1. Tests](https://github.com/lu-pl/larql/actions/workflows/w3c_tests.yml/badge.svg)](https://github.com/w3c/rdf-tests)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)

`larql` is a simple [Lark](https://github.com/lark-parser/lark) parser for [SPARQL 1.1](https://www.w3.org/TR/sparql11-query/).

Apart from parsing SPARQL strings into Lark parse trees, the only additional feature `larql` will provide is a `lark.Transformer` for (pretty) serializing parsed queries back to strings. That's it.

> WARNING: This project is in an early stage of development and should be used with caution.

#### Usage

```python
from larql import SPARQLParser

parsed = SPARQLParser("select * where {?s ?p ?o .}")
parsed.tree  # lark.Tree

# not yet available
parsed.serialize(indent=2)
```
