Skip to main content

A Python REST client library for accessing VisualVault.

Project description

vvrest

A Python REST client library for accessing VisualVault.

install

pip3 install vvrest

getting started

  • The Vault class handles authentication.
  • Services mapping to the different endpoints live in the services namespace. For example if one wishes to interact with the /api/v1/documents endpoint, then import DocumentService or for /api/v1/files import FileService, etc.
  • Now credentials need to be defined so VisualVault knows who one is.
  • url is the base url for the instance of VisualVault (example below). NOTE: do not leave a trailing '/' at the end of the url.
  • customer_alias and database_alias are the customer and database one wishes to connect to.
  • client_id and client_secret can be found on the users page in the central admin section of VisualVault. The first APIKEY is client_id and the second APIKEY is the client_secret.
  • Each service class in services takes an instance of Vault as a required parameter.
  • The code example below demonstrates requesting documents.
from vvrest.vault import Vault
from vvrest.services.document_service import DocumentService

# define credentials
url = 'https://demo.visualvault.com'
customer_alias = 'test_customer'
database_alias = 'test_database'
client_id = '12344b69-cd52-4444-815a-1234ec0fb5ef'
client_secret = 'PouE/GLZ7pjFoqRRyu9L8K3EjTXXdf56sY/FxPaaxxU='

# get vault object (authenticate)
vault = Vault(url, customer_alias, database_alias, client_id, client_secret)

document_service = DocumentService(vault)  # instantiate a service class (DocumentService)
documents = document_service.get_documents("folderPath='/test'")  # request documents
  • documentation coming soon.
  • refer to the VVRestTestSuite in the tests directory for more examples.

For more information on any of the endpoints, data types, or anything referring to the VisualVault REST API please refer to the HTTP API section at http://developer.visualvault.com where each endpoint and there parameters are covered in great detail.

unittest coverage

Name                                     Stmts   Miss  Cover   Missing
----------------------------------------------------------------------
vvrest/__init__.py                           0      0   100%
vvrest/constants.py                         30      0   100%
vvrest/services/__init__.py                  0      0   100%
vvrest/services/auth_service.py             21      0   100%
vvrest/services/document_service.py         80      0   100%
vvrest/services/email_service.py            11      0   100%
vvrest/services/file_service.py             25      0   100%
vvrest/services/folder_service.py           73     11    85%   99-104, 192-205
vvrest/services/form_service.py            119     16    87%   178-183, 220-225, 234-238, 250, 268
vvrest/services/group_service.py            49      1    98%   17
vvrest/services/index_field_service.py      30      0   100%
vvrest/services/site_service.py             35      6    83%   76-90
vvrest/services/user_service.py             37      7    81%   17, 60-74
vvrest/token.py                              5      0   100%
vvrest/utilities.py                          5      0   100%
vvrest/vault.py                             33      0   100%
----------------------------------------------------------------------
TOTAL                                      553     41    93%

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vvrest-1.2.0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vvrest-1.2.0-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file vvrest-1.2.0.tar.gz.

File metadata

  • Download URL: vvrest-1.2.0.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.5.2

File hashes

Hashes for vvrest-1.2.0.tar.gz
Algorithm Hash digest
SHA256 8c747c603ece47f799438602df5ca9439f8bb3cbbfe9e269eaa0b3ccb2c8aefa
MD5 a317eabe110dba9ce2c1355b6d6beb87
BLAKE2b-256 8911f7cbbe0da5487d3e698dec205c9124af1cad66aa6d79bf2428e3cf309d7c

See more details on using hashes here.

File details

Details for the file vvrest-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: vvrest-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 15.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.5.2

File hashes

Hashes for vvrest-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bd564f4680a087b6159dca8e522b38c976d990dc725d53ffc1617acecfe6a46c
MD5 6d07e356d300fd8cb0f4468a1f61cf74
BLAKE2b-256 4bc9cc000dbe0c6fb2ef4a183bf0c7ca98134c3510bccd749e3b88a06492c435

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page