Property Graph Exchange Format (PG) parser and serializer
Project description
pgformat
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.
The command line client can also be called via python -m pgformat
.
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
Built Distribution
Hashes for pgformat-0.1.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7f909587c39d1089b8165a3ecb1f900134c73b7784024822e5c90c5f956ba66 |
|
MD5 | 64af0fe7b7a4d2727a5cd56d351173b3 |
|
BLAKE2b-256 | f636b7439705884b530ca1d335347a670a408326ee08af072b97be3b3b76b422 |