Skip to main content

No project description provided

Project description

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 for their authorization solution, but need a way to translate from their DSL to the JSON format the HTTP API expects.

Usage

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 .nenv
  2. source .venv/bin/activate
  3. pip install maturin

Install & build package using Maturin for local testing:

maturin develop

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openfga_dsl_parser_python-0.1.0.tar.gz (6.6 kB view hashes)

Uploaded Source

Built Distributions

openfga_dsl_parser_python-0.1.0-cp310-none-win_amd64.whl (152.8 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

openfga_dsl_parser_python-0.1.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.0 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.5+ x86-64

openfga_dsl_parser_python-0.1.0-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (505.4 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

openfga_dsl_parser_python-0.1.0-cp39-none-win_amd64.whl (152.8 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

openfga_dsl_parser_python-0.1.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.0 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.5+ x86-64

openfga_dsl_parser_python-0.1.0-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (505.2 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

openfga_dsl_parser_python-0.1.0-cp38-none-win_amd64.whl (152.6 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

openfga_dsl_parser_python-0.1.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.0 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.5+ x86-64

openfga_dsl_parser_python-0.1.0-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (505.6 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

openfga_dsl_parser_python-0.1.0-cp37-none-win_amd64.whl (152.6 kB view hashes)

Uploaded CPython 3.7 Windows x86-64

openfga_dsl_parser_python-0.1.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.0 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.5+ x86-64

openfga_dsl_parser_python-0.1.0-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (505.7 kB view hashes)

Uploaded CPython 3.7m macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page