hydrus package

Submodules

hydrus.app module

Main route for the applciation.

class hydrus.app.Contexts

Bases: flask_restful.Resource

Dynamically genereated contexts.

get(category)

Return the context for the specified class.

methods = ['GET']
class hydrus.app.Entrypoint

Bases: flask_restful.Resource

Hydra EntryPoint.

get()

Return application main Entrypoint.

methods = ['GET']
class hydrus.app.Index

Bases: flask_restful.Resource

Class for the EntryPoint.

get()

Return main entrypoint for the api.

methods = ['GET']
class hydrus.app.Item

Bases: flask_restful.Resource

Handles all operations(GET, POST, PATCH, DELETE) on Items (item can be anything depending upon the vocabulary).

delete(id_, type_)

Delete object with id=id_ from database.

get(id_, type_)

GET object with id = id_ from the database.

methods = ['DELETE', 'GET', 'POST', 'PUT']
post(id_, type_)

Update object of type<type_> at ID<id_> with new object_ using HTTP POST.

put(id_, type_)

Add new object_ optional <id_> parameter using HTTP PUT.

class hydrus.app.ItemCollection

Bases: flask_restful.Resource

Handle operation related to ItemCollection (a collection of items).

delete(type_)

Delete a non Collection class item.

get(type_)

Retrieve a collection of items from the database.

methods = ['DELETE', 'GET', 'POST', 'PUT']
post(type_)

Update Non Collection class item.

put(type_)

Add item to ItemCollection.

class hydrus.app.Vocab

Bases: flask_restful.Resource

Vocabulary for Hydra.

get()

Return the main hydra vocab.

methods = ['GET']
hydrus.app.app_factory(API_NAME='api')

Create an app object.

hydrus.app.checkClassOp(class_type, method)

Check if the Class supports the operation.

hydrus.app.checkEndpoint(method, type_)

Check if endpoint and method is supported in the API.

hydrus.app.failed_authentication()

Return failed authentication object.

hydrus.app.getType(class_type, method)

Return the @type of object allowed for POST/PUT.

hydrus.app.hydrafy(object_)

Add hydra context to objects.

hydrus.app.set_response_headers(resp, ct='application/ld+json', headers=[], status_code=200)

Set the response headers.

hydrus.app.validObject(object_)

Check if the data passed in POST is of valid format or not.

hydrus.utils module

Pluggable utilities for Hydrus.

hydrus.utils.get_api_name()

Get the server API name.

hydrus.utils.get_authentication()

Check wether API needs to be authenticated or not.

hydrus.utils.get_doc()

Get the server API Documentation.

hydrus.utils.get_hydrus_server_url()

Get the server URL.

hydrus.utils.get_session()

Get the Database Session for the server.

hydrus.utils.set_api_name(*args, **kwds)

Set the server name or EntryPoint for the app. Must be of type <str>.

hydrus.utils.set_authentication(*args, **kwds)

Set the wether API needs to be authenticated or not.

hydrus.utils.set_doc(*args, **kwds)

Set the API Documentation for the app. Must be of type <hydrus.hydraspec.doc_writer.HydraDoc>.

hydrus.utils.set_hydrus_server_url(*args, **kwds)

Set the server URL for the app. Must be of type <str>.

hydrus.utils.set_session(*args, **kwds)

Set the database session for the app. Must be of type <hydrus.hydraspec.doc_writer.HydraDoc>.

Module contents