Skip to main content

Property Graph Exchange Format (PG) parser and serializer

Project description

pgformat

Test PyPI

Property Graph Exchange Format (PG) parser and serializer

This package implements parsers and serializers to for labeled property graphs in Property Graph Exchange Format.

Table of Contents

Install

Requires Python 3.

pip install pgformat

Usage

The package comes with a simple command line client to convert between serialization forms of Property Graph Exchange format and an API to be used in python code. The command line client by default reads PG Format and emits PG JSONL.

usage: pgformat [-h] [-t {ndjson,json,pg}] [source]

Parse and transform property graphs in PG Format.

positional arguments:
  source                input file (default: - for standard input)

options:
  -h, --help            show this help message and exit
  -t {ndjson,json,pg}, --to {ndjson,json,pg}
                        target format

The functionality is a subset of the pgraph command line tool written in NodeJS.

API

The package exports two functions: parseGraph and parseStatements:

from pgformat import parseGraph, parseStatements

graph = parseGraph("a -> b")
statements = parseStatements("x\na -> b")

The return format consists of plain lists and arrays for direct conversion to JSON.

License

Licensed under the MIT License.

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

pgformat-0.1.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pgformat-0.1.0-py2.py3-none-any.whl (6.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pgformat-0.1.0.tar.gz.

File metadata

  • Download URL: pgformat-0.1.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for pgformat-0.1.0.tar.gz
Algorithm Hash digest
SHA256 35f45c1da6a9e43e2668d0d2657a1d16326a089c058c9c374aea86ac836d5560
MD5 97ff1e66f8aaef51ebd855c8e03d360d
BLAKE2b-256 9944d880725be1fbcd6cecf0050035f818842ceab8a8a7c242ce7a2a351097a7

See more details on using hashes here.

File details

Details for the file pgformat-0.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: pgformat-0.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for pgformat-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 91eea66da984dae0b6868b3337793d15b9a8ec252bcdcda185716bb222ec4d18
MD5 ed465929a2a27fce5da02c8c2aa81184
BLAKE2b-256 7d85aa0885554a4f36c32ea7b676aed02cd6b83d9f4ed7c0f36fca33ee7a0b00

See more details on using hashes here.

Supported by

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