ipython-gremlin package

Submodules

gremlin.config module

Default configuration for GremlinMagic

class gremlin.config.DefaultConfig(ssl_context, username, uri, response_timeout, aliases, password)

Bases: tuple

aliases

Alias for field number 4

password

Alias for field number 5

response_timeout

Alias for field number 3

ssl_context

Alias for field number 0

uri

Alias for field number 2

username

Alias for field number 1

gremlin.magic module

IPython Gremlin custom magic

class gremlin.magic.GremlinMagic(shell=None, **kwargs)[source]

Bases: IPython.core.magic.Magics

First of all, keep him out of the light, he hates bright light, especially sunlight, it’ll kill him. Second, don’t give him any water, not even to drink. But the most important rule, the rule you can never forget, no matter how much he cries, no matter how much he begs, never feed him after midnight.

aliases

An instance of a Python dict.

close(line)[source]

Explicity close underlying DB connections

close_connection(line)[source]
get_current_connection(line)[source]

Get the currently used connection object

gremlin(line, cell=None, local_ns={})[source]

I make the illogical logical

magics = {'line': {'gremlin.connection.set_current': 'set_current_connection', 'gremlin': 'gremlin', 'gremlin.connection.current': 'get_current_connection', 'gremlin.connection.close': 'close_connection', 'gremlin.connection.set_alias': 'set_connection_alias', 'gremlin.close': 'close'}, 'cell': {'gremlin': 'gremlin'}}
password

A trait for unicode strings.

registered = True
response_timeout

A float trait.

set_connection_alias(line)[source]

Set alias for specified connection

set_current_connection(line)[source]

Set specified connection as current

ssl_context

A trait whose value must be an instance of a specified class.

The value can also be an instance of a subclass of the specified class.

Subclasses can declare default classes by overriding the klass attribute

uri

A trait for unicode strings.

username

A trait for unicode strings.

gremlin.magic.close()[source]

uh oh

gremlin.magic.load_ipython_extension(ip)[source]

Load the extension in IPython.

gremlin.registry module

Simple interface for keeping track of DB connections and aliases

class gremlin.registry.ConnectionRegistry[source]

Bases: object

Issue and keep track of database connections.

classmethod close(connection_str=None)[source]

Close DB connections

connections = {}
current = None
classmethod get(descriptors, config=None)[source]

Get a connection from the registry based on the descriptor

classmethod set_connection_alias(descriptors, config)[source]
classmethod set_current_connection(descriptors, config)[source]
class gremlin.registry.RegistryConnection(conn, alias)[source]

Bases: object

Wrapper for aiogremlin.driver.connection.Connection

alias
close()[source]

Close underlying connections

loop
uri
write(message)[source]

Write message to Gremlin Server

gremlin.utils module

Utility functions to support GremlinMagic operations

gremlin.utils.parse(connection_str)[source]

Parse connection string passed by user

gremlin.utils.submit(gremlin, user_ns, aliases, conn)[source]

Submit a script to the Gremlin Server using the IPython namespace using the IPython namespace to pass bindings using Magics configuration and a connection registered with ConnectionRegistry

Module contents