graphit.graph_model_classes package

graphit.graph_model_classes.model_datetime module

file: model_date_time.py

Graph model classes for dealing with date/time definitions

class graphit.graph_model_classes.model_datetime.Date

Bases: graphit.graph_mixin.NodeEdgeToolsBaseClass

datetime()

Return a Python datetime object representing the stored date

Return type

:py:datetime:date

static now()

Return a Python datetime.datetime object representing the current date.

Return type

:py:datetime:date

set(key=None, value=None)

Set and validate an ISO string representation of a date instance in accordance to RFC 3339

timestamp()

Return a seconds since epoch timestamp

Return type

:py:int

class graphit.graph_model_classes.model_datetime.DateTime

Bases: graphit.graph_mixin.NodeEdgeToolsBaseClass

datetime()

Return a Python datetime object representing the stored date-time

Return type

:py:datetime:datetime

static now()

Return a Python datetime.datetime object representing the current date-time respecting local timezone.

Return type

:py:datetime:datetime

set(key=None, value=None)

Set and validate an ISO string representation of a date-time instance in accordance to RFC 3339. Set to current date-time if called without arguments.

timestamp()

Return a seconds since epoch timestamp

Return type

:py:int

class graphit.graph_model_classes.model_datetime.Time

Bases: graphit.graph_mixin.NodeEdgeToolsBaseClass

datetime()

Return a Python datetime object representing the stored time

Return type

:py:datetime:time

static now()

Return a Python datetime.datetime object representing the current time respecting local timezone.

Return type

:py:datetime:time

set(key=None, value=None, **kwargs)

Set and validate an ISO string representation of a time instance in accordance to RFC 3339

timestamp()

Return a seconds since epoch timestamp

Return type

:py:int

graphit.graph_model_classes.model_dictionary module

file: model_dictionary.py

Graph mixin class to add method to a Graph base class that will have it behave like a python dictionary.

class graphit.graph_model_classes.model_dictionary.PythonDictionary

Bases: object

items(keystring=None, valuestring=None)

Python dict-like function to return node items in the (sub)graph.

Keystring defines the value lookup key in the node data dict. This defaults to the graph key_tag. Valuestring defines the value lookup key in the node data dict.

Parameters
  • keystring (:py:str) – Data key to use for dictionary keys.

  • valuestring (:py:str) – Data key to use for dictionary values.

Returns

List of keys, value pairs

Return type

:py:list

keys(keystring=None)

Python dict-like function to return node keys in the (sub)graph.

Keystring defines the value lookup key in the node data dict. This defaults to the graph key_tag.

Parameters

keystring (:py:str) – Data key to use for dictionary keys.

Returns

List of keys

Return type

:py:list

values(valuestring=None)

Python dict-like function to return node values in the (sub)graph.

Valuestring defines the value lookup key in the node data dict.

Parameters

valuestring (:py:str) – Data key to use for dictionary values.

Returns

List of values

Return type

:py:list

graphit.graph_model_classes.model_email module

file: model_email.py

Graph model classes for dealing with emails

TODO: checkout https://github.com/JoshData/python-email-validator/blob/master/email_validator/__init__.py

for IDN emails

class graphit.graph_model_classes.model_email.Email

Bases: graphit.graph_mixin.NodeEdgeToolsBaseClass

set(key, value=None, **kwargs)

Validate email adress syntax according to the ‘addr-spec’ part of the RFC 2822 specification.

validate_existence(timeout=10)

Email DNS and mailbox verification.

This method requires dnspython module to be installed

Incorrect results: some mail servers will give you incorrect results, for instance catch-all servers, which will accept all incoming email addresses, often forwarding incoming emails to a central mailbox. Yahoo addresses displays this catch-all behavior.

Warning

Using this method allot will risk blacklisting your IP (e.g. Spamhaus), especially if you are using a dynamic IP address from your ISP.

Parameters

timeout (:py:int) – SMTP timeout in seconds

graphit.graph_model_classes.model_files module

file: model_files.py

Graph model classes for working with files

class graphit.graph_model_classes.model_files.FilePath

Bases: graphit.graph_mixin.NodeEdgeToolsBaseClass

property exists
property iswritable
makedirs()

Recursively create the directory structure of the path

Returns

Absolute path to working directory

Return type

:py:str

remove(ignore_errors=True)

Remove the path

Uses shutil.rmtree to recursively remove files and directories.

Parameters

ignore_errors (:py:bool) – remove read-only files.

set(key, value=None, absolute=True)

Set node/edge key/value pair

Implement to provide a direct setter for node or edge key/value pairs preferably by using the set method of the node/edge storage API.

Parameters
  • key – node/edge key to set

  • value – node/edge value

graphit.graph_model_classes.model_identifiers module

file: model_identifiers.py

Graph model classes for working (unique) identifiers

class graphit.graph_model_classes.model_identifiers.UUID

Bases: graphit.graph_mixin.NodeEdgeToolsBaseClass

static create()
set(key, value=None, **kwargs)

Set node/edge key/value pair

Implement to provide a direct setter for node or edge key/value pairs preferably by using the set method of the node/edge storage API.

Parameters
  • key – node/edge key to set

  • value – node/edge value

graphit.graph_model_classes.model_networking module

file: model_networking.py

Graph model classes for dealing with network communication

class graphit.graph_model_classes.model_networking.IP4Address

Bases: graphit.graph_mixin.NodeEdgeToolsBaseClass

set(key, value=None)

Validate and set IP4 address according to the “dotted-quad” ABNF syntax as defined in RFC 2673

class graphit.graph_model_classes.model_networking.IP6Address

Bases: graphit.graph_mixin.NodeEdgeToolsBaseClass

set(key, value=None)

Validate and set IP6 address according to RFC 4291

graphit.graph_model_classes.model_openapi module

file: io_json_format.py

Functions for importing OpenAPI RESTfull API definitions into a functional API object

class graphit.graph_model_classes.model_openapi.OpenAPI(edges=None, directed=False, nodes=None, data=None, root=None, orm=None, storagedriver=<function init_dictstorage_driver>, **kwargs)

Bases: graphit.graph_axis.graph_axis_class.GraphAxis

Base Graph class for OpenAPI definition version 2.0 formally known as swagger version 2.0

adjacency
data
directed
edge_tools
edges
get_method(method_name)
list_methods()
masked
node_tools
nodes
origin
orm
root
schemes()

Return supported HTTP schemes

Return type

:py:list

storagedriver

graphit.graph_model_classes.model_user module

file: model_user.py

Graph model classes for dealing with user information

class graphit.graph_model_classes.model_user.User

Bases: graphit.graph_mixin.NodeEdgeToolsBaseClass

set(key=None, value=None, **kwargs)

Set to current system user if called without arguments.

static username()

Get user name of current system user

Module contents