6. neokit – Command Line Toolkit for Neo4j

Neokit is a standalone module for managing one or more Neo4j server installations. The Neokit classes may be used programmatically but will generally be invoked via the command line interface. If Neokit has been installed as part of the Py2neo package, the command line tool will be available as neokit; otherwise, it can be called as a Python module: python -m neokit.

6.1. Command Line Usage

6.1.1. Installing a Neo4j archive

$ neokit install 3.0

6.2. API

class neokit.GraphServer(home=None)[source]

A Neo4j server installation.

property auth_enabled

Settable boolean property for enabling and disabling auth on this server.

config(key, default=None)[source]

Retrieve the value of a configuration item.

Parameters:
  • key

  • default

Returns:

property control_script

The file name of the control script for this server installation.

delete_store(force=False)[source]

Delete the store directory for this server.

Parameters:

force

property http_port

The port on which this server expects HTTP communication.

property http_uri

The full HTTP URI for this server.

info(key)[source]

Look up an item of server information from a running server.

Parameters:

key – the key of the item to look up

restart()[source]

Restart the server.

running()[source]

The PID of the current executing process for this server.

set_config(key, value)[source]

Update a single configuration value.

Parameters:
  • key

  • value

start()[source]

Start the server.

stop()[source]

Stop the server.

property store_path

The location of the graph database store on disk.

update_config(properties)[source]

Update multiple configuration values.

Parameters:

properties

update_password(user, password, new_password)[source]

Update the password for this server.

Parameters:
  • user

  • password

  • new_password

Returns:

class neokit.GraphServerV2(home=None)[source]
property http_port

The port on which this server expects HTTP communication.

property store_path

The location of the graph database store on disk.

class neokit.GraphServerV3(home=None)[source]
property http_port

The port on which this server expects HTTP communication.

property store_path

The location of the graph database store on disk.

class neokit.Package(edition=None, version=None)[source]

Represents a Neo4j archive.

download(path='.', overwrite=False)[source]

Download a Neo4j distribution to the specified path.

Parameters:
  • path

  • overwrite

Returns:

the name of the downloaded file

property key

The unique key that identifies the archive, e.g. community-2.3.2.

property name

The full name of the archive file, e.g. neo4j-community-2.3.2-unix.tar.gz.

property uri

The URI from which this archive may be downloaded, e.g. http://dist.neo4j.org/neo4j-community-2.3.2-unix.tar.gz.

class neokit.PropertiesParser(defaults=None, dict_type=<class 'dict'>, allow_no_value=False, *, delimiters=('=', ':'), comment_prefixes=('#', ';'), inline_comment_prefixes=None, strict=True, empty_lines_in_values=True, default_section='DEFAULT', interpolation=<object object>, converters=<object object>)[source]
exception neokit.Unauthorized[source]

Raised when auth fails.

class neokit.Warehouse(home=None)[source]

A local storage area for Neo4j installations.

directory()[source]

Fetch a dictionary of GraphServer objects, keyed by name, for all available Neo4j installations.

get(name)[source]

Obtain a Neo4j installation by name.

Parameters:

name

Returns:

install(name, edition=None, version=None)[source]

Install Neo4j.

Parameters:
  • name

  • edition

  • version

Returns:

rename(name, new_name)[source]

Rename a Neo4j installation.

Parameters:
  • name

  • new_name

Returns:

uninstall(name)[source]

Remove a Neo4j installation.

Parameters:

name

Returns: