Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jbn/idgraph
IPython cell magic for dgraph remote interaction.
https://github.com/jbn/idgraph
dgraph dgraph-client dgraph-tutorial ipython ipython-magic ipython-notebook ipython-notebooks jupyter-notebook juypter
Last synced: 5 days ago
JSON representation
IPython cell magic for dgraph remote interaction.
- Host: GitHub
- URL: https://github.com/jbn/idgraph
- Owner: jbn
- License: mit
- Created: 2019-10-20T15:21:20.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-26T20:59:18.000Z (almost 2 years ago)
- Last Synced: 2024-12-15T17:08:27.516Z (7 days ago)
- Topics: dgraph, dgraph-client, dgraph-tutorial, ipython, ipython-magic, ipython-notebook, ipython-notebooks, jupyter-notebook, juypter
- Language: Jupyter Notebook
- Size: 18.6 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.rst
- Changelog: HISTORY.rst
- Contributing: CONTRIBUTING.rst
- License: LICENSE
Awesome Lists containing this project
README
idgraph
=======.. image:: https://img.shields.io/pypi/v/idgraph.svg
:target: https://pypi.python.org/pypi/idgraph.. image:: https://travis-ci.org/jbn/idgraph.svg?branch=master
:target: https://travis-ci.org/jbn/idgraphProvides IPython cell magic for `dgraph `__ remote
interaction.Installation
------------.. code:: bash
pip install idgraph
Why is this?
------------While `dgraph `__ provides several useful interfaces,
I spend most of my time learning, exploring, and developing in
`Jupyter `__. Executable documentation is
fantastic! This package abstractly provides cell magic for dgraph query,
mutation, and alteration execution. You could do the same with ``curl``
or ``requests``. But, the sensible defaults help make things less
verbose and tedious. (It's inspired by my experience with
`itikz `__ which proved really
beneficial.)Usage
-----The easiest way to understand how this works is by following (and cloning)
the `tutorial notebook `__.
It's a projection dgraph's
`Tour of Dgraph: A Bigger Dataset `__.Cheat Sheet
~~~~~~~~~~~Load the extension with,
.. code::
%load_ext idgraph
Then,
- By default, ``%%dgraph`` assumes a query.
- ``%%dgraph --alter`` does an alteration
- ``%%dgraph --mutate`` does a mutation- By default, ``%%dgraph`` assumes ``localhost:8080``
- ``%%dgraph --addr=remote-host:8080`` overrides the default
- The ``DGRAPH_ADDR`` environmental variable overrides default if
the ``--addr`` flag isn't set- By default, only the value associated with the ``data`` key in the
response is shown.- ``%%dgraph --full-resp`` shows the full response including
metadata.
- ``%%dgraph --jmespath="query"`` allows you to extract part of the
response with a `jmespath `__ query.- By default, each cell execution binds the extracted response to
``_dgraph`` and the full response to ``_dgraph_full``- ``%%dgraph --into=name`` will bind the extracted response to
``name`` and the full response to ``{name}_full``- By default, the cell contents are executed.
- ``%%dgraph --skip`` skips execution.
- Useful for mutations that are possibly dangerous on someone
else's computer.- Jinja
- technically you can use templates in a directory. you almost
certainly shouldnt though.Credits
~~~~~~~This package was created with
`Cookiecutter `__ and the
`audreyr/cookiecutter-pypackage `__
project template.