Skip to content

Commit 6d87ac4

Browse files
committed
Merge branch 'release/0.2.0'
2 parents 1cc54b3 + 518d1b7 commit 6d87ac4

File tree

5 files changed

+83
-23
lines changed

5 files changed

+83
-23
lines changed

HISTORY.rst

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33
History
44
-------
55

6+
0.2.0 (2016-07-05)
7+
++++++++++++++++++
8+
9+
* Initial implementation of working constructors with some basic testing.
10+
611
0.1.0 (2015-11-11)
712
++++++++++++++++++
813

9-
* First release on PyPI.
14+
* First tagged release. No working code, just ideas of what the YAML might look
15+
like. Not released on PyPI.

README.rst

+20-15
Original file line numberDiff line numberDiff line change
@@ -20,35 +20,40 @@ Features
2020
--------
2121

2222
* Creates nodes and relationships in a Neo4j graph database from YAML using
23-
PyYAML-specific tags.
23+
PyYAML-specific tags.
2424
* Operates at a whole-file level, as it uses custom YAML tags to deserialize
25-
the data to live objects.
25+
the data to live objects.
2626
* Developed for loading data for integration testing.
2727
* Requires a running Neo4j instance and instantiates actual database entities,
28-
rather than just generating abstract/unbound :class:`py2neo.Node` and
29-
:class:`py2neo.Relationship` objects. This is due to :mod:`py2neo` version 1.6
30-
not supporting node labels with abstract nodes. This might be changed if we
31-
are able to migrate off of 1.6 in the near future.
28+
rather than just generating abstract/unbound :class:`py2neo.Node` and
29+
:class:`py2neo.Relationship` objects. This is due to :mod:`py2neo` version
30+
1.6 not supporting node labels with abstract nodes. This might be changed if
31+
we are able to migrate off of 1.6 in the near future.
3232

3333
Versions
3434
--------
3535

36-
* Neo4j: Should work with anything >= 2.0 but < 3. Tested with 2.3.2. Running
37-
the tests requires 2.3 as it uses the `DETACH DELETE` feature to drop the
38-
database.
39-
* :mod:`py2neo`: Currently only supports 2.0. Expecting to do 3; dreading 1.6.
40-
* :mod:`pyyaml`: Only tested with PyYAML v3.11, the last release since 2014.
36+
Python
37+
Tested with both Python 2.7 and 3.5.
38+
Neo4j
39+
Should work with anything >= 2.0 but < 3. Tested with 2.3.2. Running the
40+
tests requires 2.3 as it uses the ``DETACH DELETE`` feature to drop the
41+
database.
42+
:mod:`py2neo`
43+
Currently only supports 2.0. Expecting to do 3; dreading 1.6.
44+
:mod:`pyyaml`
45+
Only tested with PyYAML v3.11, the last release since 2014.
4146

4247
Testing
4348
-------
4449

45-
* Running the tests requires an installed, running Neo4j instance.
46-
Pass the URL through the environment variable `NEO4J_URI`.
50+
Running the tests requires an installed, running Neo4j instance. Pass the URL
51+
through the environment variable ``NEO4J_URI``.
4752

4853
Future
4954
------
5055

5156
* Custom YAML representer & constructor. Currently it is not possible to
52-
automatically dump Node and Relationship objects in a reasonable fashion.
57+
automatically dump Node and Relationship objects in a reasonable fashion.
5358
* `py2neo` & Neo4j v3 support.
54-
* Documentation, etc
59+
* Documentation, etc.

docs/usage.rst

+46-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,50 @@
22
Usage
33
========
44

5-
To use Python Gryaml in a project::
65

7-
import gryaml
6+
Nodes & relationships can be created automatically in a Neo4j database upon
7+
load using the ``!!python/object/apply`` YAML
8+
`tag <http://pyyaml.org/wiki/PyYAMLDocumentation#Objects>`_ with PyYAML.
9+
10+
#. A connection to the graph database needs to be established using
11+
``gryaml.connect(uri=URI)`` or ``gryaml.connect(graph=py2neo.Graph(...))``.
12+
This stores the graph handle in the global module namespace because it is not
13+
possible to pass in a handle to the constructors otherwise.
14+
15+
::
16+
17+
import gryaml
18+
19+
gryaml.connect('http://localhost:7474')
20+
21+
#. Import :mod:`pyyaml` and load the data:
22+
23+
::
24+
25+
import yaml
26+
yaml.load("""
27+
- &node-foo !!python/object/apply:gryaml.node
28+
- labels:
29+
- 'Fooer'
30+
- properties:
31+
prop1: 'flim'
32+
- &node-bar !!python/object/apply:gryaml.node
33+
- labels:
34+
- 'Barer'
35+
- properties:
36+
prop1: 'flam'
37+
- !!python/object/apply:gryaml.rel
38+
- *node-foo
39+
- 'RELATES_TO'
40+
- *node-bar
41+
- properties:
42+
bletch: 'xyzzy'
43+
""")
44+
45+
46+
The ``&node-x`` are YAML
47+
`anchors <http://pyyaml.org/wiki/PyYAMLDocumentation#Aliases>`_ and
48+
``*node-x`` are YAML
49+
`aliases <http://pyyaml.org/wiki/PyYAMLDocumentation#Aliases>`_.
50+
51+
See the ``tests/samples`` directory for other data examples.

setup.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@
3939
'License :: OSI Approved :: MIT License',
4040
'Natural Language :: English',
4141
'Programming Language :: Python :: 2',
42-
'Programming Language :: Python :: 2.6',
4342
'Programming Language :: Python :: 2.7',
4443
'Programming Language :: Python :: 3',
4544
'Programming Language :: Python :: 3.3',
45+
'Programming Language :: Python :: 3.4',
46+
'Programming Language :: Python :: 3.5',
4647
'Programming Language :: Python :: Implementation :: PyPy',
4748
],
4849
)

tox.ini

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
[tox]
2-
envlist = py27, py35, style, docs
2+
envlist = py27, py35, pypy, style, docs
33

44
[testenv]
5-
basepython =
6-
py27: /usr/local/bin/python2.7
7-
py35: /usr/local/bin/python3.5
5+
basepython = /usr/local/bin/python3.5
86
passenv = NEO4J_URI
97
deps =
108
-r{toxinidir}/requirements.txt
119
pytest
1210
commands =
1311
py.test --basetemp={envtmpdir}
1412

13+
[testenv:py27]
14+
basepython = /usr/local/bin/python2.7
15+
16+
[testenv:pypy]
17+
basepython = /usr/local/bin/pypy
18+
1519
[testenv:style]
1620
deps =
1721
-r{toxinidir}/requirements.txt

0 commit comments

Comments
 (0)