Skip to main content

Verify an nbsinfra API implementation

Project description

NbSAPI Verification Tool

nbsapi_verify is a standalone tool designed to verify that your API implementation conforms to the https://nbsapi.org OpenAPI specification, currently at Version 1.0.

Installation and Usage

Installation (temporary)

Using pipx

pipx nbsapi_verify --help

Using uvx

uvx nbsapi_verify --help

Installation (permanent, on $PATH)

If you would prefer the tool to be installed on your PATH you can run:

pipx install nbsapi_verify or uv tool install nbsapi_verify. You can then run nbsapi_verify without prefixes.

Installation as a package

You can also install the package using your preferred Python package manager:

Using pip

pip install nbsapi_verify

Using uv

uv add nbsapi_verify

Using poetry

poetry add nbsapi_verify

After installation, you can run the tool using the installed script:

nbsapi_verify --help

Usage

nbsapi_verify requires a small amount of configuration:

  1. First, generate a verification config. This requires you to specify:
    • the host the API is running on
    • a valid username
    • the password for that username
    • the ID of that user
    • a path for the verification config to be stored (optional: it defaults to the current working directory)
    • the test type to be run: all, auth, user: the auth tests will exercise the write API functions, while the user tests will exercise the read API functions (defaults to all).

In order to test your API while locally developing, that command might look like:

nbsapi_verify --generate \
    --host http://localhost:8000 \
    --test-type all
    --username testuser \
    --password testpass \
    --testid 1 \
    --config-dir ~

If the command completes sucessfully, you can run the verification tool:

nbsapi_verify --config-dir ~

You can also generate JSON and HTML reports of the test results:

# Generate default JSON report (nbsapi_verify_report.json)
nbsapi_verify --config-dir ~ --json-output

# Generate default HTML report (nbsapi_verify_report.html)
nbsapi_verify --config-dir ~ --html-output

# Generate both reports
nbsapi_verify --config-dir ~ --json-output --html-output

When all tests pass, your API implementation is conformant to the NbsAPI specification!

Help

nbsapi_verify --help

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

nbsapi_verify-0.1.7.tar.gz (52.5 kB view details)

Uploaded Source

Built Distribution

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

nbsapi_verify-0.1.7-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file nbsapi_verify-0.1.7.tar.gz.

File metadata

  • Download URL: nbsapi_verify-0.1.7.tar.gz
  • Upload date:
  • Size: 52.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for nbsapi_verify-0.1.7.tar.gz
Algorithm Hash digest
SHA256 a54e9bef74486bde387f778f2158328ddbc40921d7a963b653da0996fee750e0
MD5 f1feb89c9bbc230b55e8f190e66d6ad9
BLAKE2b-256 8d19ab1b8f96e364420af926a5a05aaf3188c5f4cdd2f1ab14467deba5a31ec3

See more details on using hashes here.

Provenance

The following attestation bundles were made for nbsapi_verify-0.1.7.tar.gz:

Publisher: ci.yml on nbsapi/nbsapi_verification

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nbsapi_verify-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: nbsapi_verify-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for nbsapi_verify-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 cad79bc1574eb8d958e6e85cc9aca76d352ea10c474d9f8f01fc336879e20c0a
MD5 6c0d5f6ed968fced8eab7ea8e2bb5693
BLAKE2b-256 c402437a2fd7d9e92cded6aac52e5a5a2ddad6596d3401a81c7fb3e260a15e7f

See more details on using hashes here.

Provenance

The following attestation bundles were made for nbsapi_verify-0.1.7-py3-none-any.whl:

Publisher: ci.yml on nbsapi/nbsapi_verification

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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