Skip to main content

nsg-python-sdk

This repository contains changes for nsg-python-sdk python package. This package will be uploaded to the PyPI so that customer can install package and test their changes.

nsg-python-sdk package

Install nsg-python-sdk from PyPI. This package exposes nsgsdk binary.

pip install nsg-python-sdk

currently nsgsdk supports running tags, variables and views app request. Supported apps can be found by running the following command.

# nsgsdk -h
Usage: nsgsdk [OPTIONS] COMMAND [ARGS]...

Options:
  --version   Show the version and exit.
  -h, --help  Show this message and exit.

Commands:
  tags       run tags application
  test       run tests in the current repository
  variables  run variable builder application
  views      run views application

How to run apps on local machine

Go to the directory which contains scripts for testing.

To run module tags using embedded tags_app.py, we could use the following steps

to check the required parameters and options we can use the help option

# nsgsdk tags -h
Usage: nsgsdk tags [OPTIONS] INPUT_DEVICE

  NetSpyGlass tags assignment Python application

Options:
  -f, --format [json|pb]  use this format to generate output  [default: json]
  -o, --output TEXT       the file name where the result should be stored; if
                          missing or equal to "-", use stdout
  -h, --help              Show this message and exit.

tags command specifies that we want to run the tags app.

then to run it with input

nsgsdk tags <path_to_input_file> -o <path_to_output_file>

Run unit test cases.

  • cd to the scripts directory.
  • create directory tests and put your test modules there. If your tests need data files, we recommend placing them in the directory tests/fixtures. Directory structure should look like this:
    ~/src/test-repo/scripts$ tree
    ├── __init__.py
    ├── rules.py
    ├── tags.py
    ├── tests
    │     ├── __init__.py
    │     ├── fixtures
    │     │     └── ex2200-pb.json
    │     └── test_tags.py
    ├── var_builder.py
    └── views.py

to run the tests, change to the directory which contains scripts directory. We can use the following command

nsgsdk test

To check the required parameters and option we can use the following command:

nsgsdk test -h
Usage: nsgsdk test [OPTIONS] PATH

Options:
  -h, --help  Show this message and exit.

here Path can be module or directory path.

To run the tests in the directory, we can use the following command:

nsgsdk test scripts/tests

To run the tests in module, we can use the following command:

nsgsdk test scripts/tests/test_tags_1.py

Metadata

Release files for nsg-python-sdk 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nsg-python-sdk 0.0.4
File Size Uploaded
nsg-python-sdk-0.0.4.tar.gz 65.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nsg-python-sdk 0.0.4
File Interpreter ABI Platform
nsg_python_sdk-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 151.4 kB

Release files / nsg-python-sdk-0.0.4.tar.gz

Download URL nsg-python-sdk-0.0.4.tar.gz
Size 65.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6faefc49f19c930776c762a79b0ab78c9b9d09e65926f9c00bced6b7339a5f4f
BLAKE2b-256 checksum
How to use checksums
981244b40b0f36ff07d42b22cd16fc0e1789fc6825c849fc9152af3751436e6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.11.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.9.12

Release files / nsg_python_sdk-0.0.4-py3-none-any.whl

Download URL nsg_python_sdk-0.0.4-py3-none-any.whl
Size 85.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4d70c55e6a99670aca3aa627db6f76942cde1d3f4f1cc5f7292820ff27afe5f7
BLAKE2b-256 checksum
How to use checksums
b5e8f9b9d281ca9773312c7c9d3d751a102ee492df874726de0078ab3f0fe3db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.11.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.9.12

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page