Handle

class docushare.Handle(handle_type, handle_number)

Bases: object

This class represents a DocuShare handle.

DocuShare identifies each object on your DocuShare site with a unique handle like Collection-10101, Document-20202 and Version-123456. This class represents one handle in the canonical way for the PyDocuShare API.

It consists of two parts: type and number. For example, the handle ‘Document-20202’ has ‘Collection’ type and 20202 is the number.

Parameters
  • handle_type (HandleType) – Handle type.

  • handle_number (int) – Handle number.

Attributes Summary

identifier

String representation of this handle like "Document-20202".

number

Handle number.

type

Handle type.

Methods Summary

from_str(handle_str)

Parse the given string as a DocuShare handle and return Handle instance.

Attributes Documentation

identifier

String representation of this handle like “Document-20202”.

Type

str

number

Handle number.

Type

int

type

Handle type.

Type

HandleType

Methods Documentation

classmethod from_str(handle_str)

Parse the given string as a DocuShare handle and return Handle instance.

Parameters

handle_str (str or bytes-like object) – A string that represents a DocuShare handle like ‘Document-20202’.

Returns

A canonical instance that represents the given handle.

Return type

Handle

Raises

InvalidHandleError – If the given string is not a valid DocuShare handle.