Skip to main content
https://img.shields.io/pypi/v/gryaml.svg

Represent Neo4j graph data as YAML.

Features

  • Creates nodes and relationships in a Neo4j graph database from YAML using PyYAML-specific tags.

  • Operates at a whole-file level, as it uses custom YAML tags to deserialize the data to live objects.

  • Developed for loading data for integration testing.

  • Requires a running Neo4j instance and instantiates actual database entities, rather than just generating abstract/unbound py2neo.Node and py2neo.Relationship objects. This is due to py2neo version 1.6 not supporting node labels with abstract nodes. This might be changed if we are able to migrate off of 1.6 in the near future.

Versions

Python

Tested with both Python 2.7 and 3.6.

Neo4j

Should work with anything >= 2.0. Tested with 3.3.5. Running the tests requires 2.3 as it uses the DETACH DELETE feature to drop the database.

py2neo

Currently supports 1.6 and 2.0.

pyyaml

Tested with PyYAML v3.13.

Testing

Running the tests requires an installed, running Neo4j instance. Pass the URL through the environment variable NEO4J_URI.

Future

  • Make nodes just dicts with ‘labels’ and ‘properties’ keys? Maybe make rels dicts with ‘head’, ‘tail’, ‘type’ and ‘properties’ keys too?

  • Add a context manager to register with PyYAML, create graph database connection and then cleanup.

  • Support locating nodes with a Cypher query as part of creating a relationship.

  • Add gryaml-dump CLI tool to render database (or query result) as YAML.

  • Test/support ruamel.yaml.

  • Add ability to update & display schema.

  • Later py2neo. Dependent mainly on supporting later versions in py2neo_compat.

  • Documentation more complete & published to ReadTheDocs.

History

1.0.0 (2018-08-02)

  • Require registration for YAML constructors & representers – this no longer happens automatically as a side-effect of importing the gryaml package.

  • Add “simple” constructors & representers, to convert Nodes or Relationships to plain YAML structures or YAML structures tagged with ‘!gryaml.*’ to plain Python structures.

  • Reorganized repo so package is in src/.

  • Added more tests.

  • Use py2neo_compat as compatibility layer.

0.4.0 (2017-08-30)

  • Enable using application-specific tags gryaml.node and gryaml.rel to construct instead of PyYAML’s general-purpose !python/object/apply:.

0.3.1 (2016-10-28)

  • Fix assumption that a non-None instance of GraphDatabaseService in py2neo 1.6 would not be False.

0.3.0 (2016-10-28)

  • Fix so that it should mostly work with py2neo 1.6 in addition to py2neo 2.0. py2neo 1.6 does not support abstract nodes without labels, so it must be used against a live database, whereas py2neo 2.0 does not. (py2neo v3 support is in progress.)

0.2.0 (2016-07-05)

  • Initial implementation of working constructors with some basic testing.

0.1.0 (2015-11-11)

  • First tagged release. No working code, just ideas of what the YAML might look like. Not released on PyPI.

Metadata

Release files for gryaml 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gryaml 1.0.0
File Size Uploaded
gryaml-1.0.0.tar.gz 27.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gryaml 1.0.0
File Interpreter ABI Platform
gryaml-1.0.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 35.7 kB

Release files / gryaml-1.0.0.tar.gz

Download URL gryaml-1.0.0.tar.gz
Size 27.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d5fe8a63b96d0075e094fbfa572c51482316b88e0097e44519851d23d8640776
BLAKE2b-256 checksum
How to use checksums
56db667a015561f5e92d92899a13ead1515d2c96b37ff9fdeed4b9a769f0bf6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.4

Release files / gryaml-1.0.0-py2.py3-none-any.whl

Download URL gryaml-1.0.0-py2.py3-none-any.whl
Size 8.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
70d931d3de1eab3d2cf23fc4c3fafabf3e7e03d049de8f7c8692a01df754367e
BLAKE2b-256 checksum
How to use checksums
903397f632360531af4d4e76b394c9d28ca80405b0fa7a1e824e7d28b1d225e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.4

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page