{ "info": { "author": "Marco Paolini", "author_email": "markopaolini@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Graphql parser based on libgraphqlparser\n=========================================\n\nPython2.7+ Python3.4+ class-based bindings to libgraphqlparser; just a thin layer on top of ``libgraphqlparser`` C API.\n\nStill **EXPERIMENTAL**\n\n\nInstalling\n----------\n\nFirst install ``libgraphqlparser`` following instructions on `libgraphqlparser github page`_ .\n\nNext you can install ``graphqlparser``. The easiest way is using precompiled wheels which are usually available\non `graphqlparser github releases`_\n\nPick the right wheel for your platform and python version, then install it using pip::\n\n pip install https://github.com/elastic-coders/py-graphqlparser/releases/download/v0.0.3/graphqlparser-0.0.3-cp27-none-linux_x86_64.whl\n\n\nAs an alternative you can install ``graphqlparser`` from source distribution:\n\n- Install ``cython``\n- Set an env var ``$GRAPHQL_HOME`` to the folder where ``libgraphqlparser.so`` and ``Ast.h`` are\n- Install ``graphqlparser`` with pip::\n\n LDFLAGS=\"-L$GRAPHQL_HOME\" CFLAGS=\"-I$GRAPHQL_HOME/c -I$GRAPHQL_HOME\" pip install graphqlparser\n\n\nUsage\n-----\n\nMake sure ``libgraphqlparser`` is available to the loader. You can add its base dir to ``LD_LIBRARY_PATH``.\n\nThen you can start parsing by creating your custom visitor class:\n\n.. code-block:: python\n\n from graphql_parser import GraphQLAstVisitor\n\n class MyVisitor(GraphQLAstVisitor.GraphQLAstVisitor):\n\n def visit_field(self, node):\n print('start field %s visit' % node)\n # Return 1 to keep visiting children, 0 to skip them\n return 1\n\n def end_visit_field(self, node):\n print('end field %s visit' % node)\n\nAnd using it to visit a parsed query:\n\n.. code-block:: python\n\n from graphql_parser import GraphQLParser\n\n query = '{query{}}'\n node = GraphQLParser.graphql_parse_string(query)\n MyVisitor().visit_node(node)\n\nSee also ``examples`` folder.\n\n\nBuilding from source checkout\n-----------------------------\n\nRebuild the generated cython files from the libgraphql AST (usually not needed)\n\n- download submodules with ``git checkout --recursive``\n- build libgraphql library in folder ``./libgraphqlparser`` (python2.7 required for building)\n (usually ``pushd libgraphqlparser && cmake . && make && popd`` works)\n- generate source code with ``python ast/build_ast.py``\n- you can now switch to python 3\n- install ``cython``\n- run::\n\n LDFLAGS=\"-L./libgraphqlparser\" CFLAGS=\"-Ilibgraphqlparser/c -Ilibgraphqlparser\" python setup.py build_ext\n\n\nTo create a wheel distribution:\n\n- install wheel: ``pip install wheel``\n- create wheelhouse ``mkdir .wheelhouse``\n- build with ``pip wheel --wheel-dir=.wheelhouse .``\n\n\nKnown issues\n------------\n\n- Only (lightly) tested on python3\n- Unicode string handling not yet complete (a mixture of bytes and strings all over)\n- Exceptions in the visitor's class callbacks are ignored\n- libgraphqlparser is **dynamically** linked but It would be better if it was linked statically\n\n\nTODO\n----\n\n- build more wheel packages for linux 32 bit and other platforms\n\n\n.. _libgraphqlparser github page: https://github.com/graphql/libgraphqlparser\n.. _graphqlparser github releases: https://github.com/elastic-coders/py-graphqlparser/releases/\n\n\n-----\n\nNews\n----\n\nv0.0.3\n------\n\n- fixed packaging and building", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/elastic-coders/py-graphqlparser", "keywords": "graphql,parser,libgraphql", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "graphqlparser", "package_url": "https://pypi.org/project/graphqlparser/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/graphqlparser/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/elastic-coders/py-graphqlparser" }, "release_url": "https://pypi.org/project/graphqlparser/0.0.3/", "requires_dist": null, "requires_python": null, "summary": "Python bindings for libgraphqlparser (Cython-based)", "version": "0.0.3" }, "last_serial": 1730881, "releases": { "0.0.3": [ { "comment_text": "", "digests": { "md5": "e2145912b0d0a3d3269b52ea2e1388e6", "sha256": "88ce2a46ec1cc0efb72586ca2b1ed351bfe282ebb3d28bf30d7e2f90af9438fd" }, "downloads": -1, "filename": "graphqlparser-0.0.3.tar.gz", "has_sig": false, "md5_digest": "e2145912b0d0a3d3269b52ea2e1388e6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15916, "upload_time": "2015-09-19T22:43:18", "url": "https://files.pythonhosted.org/packages/1d/3b/2e77cfad51a6dbd85cea31fbe44a1328cd86d300a6bc4bb464179c92a2d4/graphqlparser-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e2145912b0d0a3d3269b52ea2e1388e6", "sha256": "88ce2a46ec1cc0efb72586ca2b1ed351bfe282ebb3d28bf30d7e2f90af9438fd" }, "downloads": -1, "filename": "graphqlparser-0.0.3.tar.gz", "has_sig": false, "md5_digest": "e2145912b0d0a3d3269b52ea2e1388e6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15916, "upload_time": "2015-09-19T22:43:18", "url": "https://files.pythonhosted.org/packages/1d/3b/2e77cfad51a6dbd85cea31fbe44a1328cd86d300a6bc4bb464179c92a2d4/graphqlparser-0.0.3.tar.gz" } ] }