Skip to content
This repository was archived by the owner on Dec 4, 2022. It is now read-only.

inonit/libcypher-parser-python

Repository files navigation

Cypher parser for Python

Build Status Coverage Status

Python interface for libcypher-parser.

Getting started

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

To build

$ 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})

Build distribution

macOS

  1. Make sure to install the dev dependencies
$ pipenv install -d
  1. Build both the source and wheel distribution
$ python setup.py sdist bdist_wheel
  1. 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
  1. 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

About

Python interface for libcypher-parser

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages