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.

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

pgformat-0.1.2.tar.gz (7.8 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.2-py2.py3-none-any.whl (6.9 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: pgformat-0.1.2.tar.gz
  • Upload date:
  • Size: 7.8 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.2.tar.gz
Algorithm Hash digest
SHA256 23e6e93bc9a106783740a4a83cb8b8c37a2911e351ffdda024e1e7cb114d8b97
MD5 b7dac4e0562179cf5b69936290e79ad1
BLAKE2b-256 8515f9b972f6f28920a44386105562d8ecfca76e15d5834c03a4518a313c3433

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pgformat-0.1.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 6.9 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.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d7f909587c39d1089b8165a3ecb1f900134c73b7784024822e5c90c5f956ba66
MD5 64af0fe7b7a4d2727a5cd56d351173b3
BLAKE2b-256 f636b7439705884b530ca1d335347a670a408326ee08af072b97be3b3b76b422

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