Python interface for libcypher-parser.
Requires libcypher-parser to be installed before compiling the extension.
Debian/Ubuntu
$ sudo add-apt-repository ppa:cleishm/neo4j
$ sudo apt-get update
$ sudo apt-get install libcypher-parser-dev
macOS
$ brew install cleishm/neo4j/libcypher-parser
For other platforms, see the official docs.
Installation
$ pip install libcypher-parser-python
$ pip install Cython
$ python setup.py build_ext --inplace
A simple test
Paste the following code in your terminal.
$ python -c "from libcypher_parser import parse_statement; print(parse_statement('MATCH (n) RETURN n'))"
(True, {'n_errors': 0, 'n_nodes': 10, 'n_statements': 1})
macOS
- Make sure to install the dev dependencies
$ pipenv install -d
- Build both the source and wheel distribution
$ python setup.py sdist bdist_wheel
- Add required dynamic libraries to the binary distribution
We'll use the delocate tool to add required dynamic libraries so that users won't have to compile it themselves.
$ delocate-listdeps --all dist/libcypher_parser_python-0.0.5-cp37-cp37m-macosx_10_13_x86_64.whl
- Verify that dynamic libraries are included
$ delocate-listdeps --all dist/libcypher_parser_python-0.0.5-cp37-cp37m-macosx_10_13_x86_64.whl
/usr/lib/libSystem.B.dylib
/usr/local/Cellar/libcypher-parser/0.6.0/lib/libcypher-parser.8.dylib
Linux
TODO: Write similar setup for autitwheel
Windows
TODO