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.1.tar.gz (7.4 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.1-py2.py3-none-any.whl (6.5 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: pgformat-0.1.1.tar.gz
  • Upload date:
  • Size: 7.4 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.1.tar.gz
Algorithm Hash digest
SHA256 16e1136608afee9937894e62359e1bf244240ada6e508665a194aa015e63bbf4
MD5 ec7dca5f20e620a9a3ca759dde07756a
BLAKE2b-256 87f3f2d3c918088948e901b8a56816dbe01c15559ed7dcdf8a3c1aba568ce987

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pgformat-0.1.1-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.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9b9a6202051b62283aff5778b357c2922f63aff4736fa4cb642b9ce42389fce4
MD5 82d11dbe8a0f844829cd6a9540820b9a
BLAKE2b-256 f24be49491b17c4e497f36b82472d26ca02a400ed28645f1016fd7083ce787a4

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