https://github.com/maxmindlin/openfga-dsl-parser-python
Python bindings to the openfga-dsl-parser library
https://github.com/maxmindlin/openfga-dsl-parser-python
json library openfga parser transformer
Last synced: 2 months ago
JSON representation
Python bindings to the openfga-dsl-parser library
- Host: GitHub
- URL: https://github.com/maxmindlin/openfga-dsl-parser-python
- Owner: maxmindlin
- License: apache-2.0
- Created: 2022-07-31T22:55:58.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-08-01T01:02:07.000Z (almost 3 years ago)
- Last Synced: 2025-02-01T14:30:57.055Z (4 months ago)
- Topics: json, library, openfga, parser, transformer
- Language: Rust
- Homepage: https://pypi.org/project/openfga-dsl-parser-python/
- Size: 12.7 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OpenFGA DSL Parser (Python)
The OpenFGA DSL Parser provides utilities for parsing DSL file string inputs into an AST representation, as well as transforming them into a JSON representation.
This library is meant to be a utility for services using [OpenFGA](https://openfga.dev/) for their authorization solution, but need a way to translate from their DSL to the JSON format the HTTP API expects.
## Installation
`pip install openfga-dsl-parser-python`
## Usage
```python
from openfga_dsl_parser import dsl_to_json
input = """type group
relations
define member as self
type resource
relations
define writer as self
define reader as self but not writer"""json = dsl_to_json(input)
print(json)
```## Development
Setup Python environment & install Maturin:
1. `python -m venv .venv`
2. `source .venv/bin/activate`
3. `pip install maturin`Install & build package using Maturin for local testing:
`maturin develop`