Skip to main content

Utility scripts for ManySecured-D3 claims

Project description

ManySecured d3-cli

Utility cli for ManySecured-D3 claims

Installation

This api may be installed using pip like so:

pip install d3-cli

When developing these scripts, Python Poetry is used to install and manage dependencies as well as publish to PyPI.

Poetry will create a python isolated virtual environment in the ./.venv folder and install dependencies if you run:

poetry install

You cannot run the cli or scripts directly from the ./src/d3-scripts since we are using Python relative imports.

Instead, you must run the d3-cli script defined in the [tool.poetry.scripts] field of pyproject.toml: You can run the command line interface locally, directly from source code without building/installing by running poetry run d3-cli.

Usage

usage: d3-cli [-h] [--version] [--guid] [--output [OUTPUT]]
              [--mode [{build,lint,export}]] [--build-dir [BUILD_DIR]]
              [--check_uri_resolves] [--verbose | --quiet]
              [input ...]

ManySecured D3 CLI for creating, linting and exporting D3 claims

positional arguments:
  input                 Folders containing D3 YAML files. (default: [])

optional arguments:
  -h, --help            show this help message and exit
  --version             Show the version and exit. (default: False)
  --guid, --uuid        Generate and show guid and exit. (default:
                        False)
  --output [OUTPUT]     Directory in which to output built claims.
                        (default: <cwd>/d3-build)
  --mode [{build,lint,export}], -m [{build,lint,export}]
                        Mode to run d3-cli in. (default: build)
  --build-dir [BUILD_DIR]
                        Build directory with json claims to export.
                        Specifying this will skip build step in export
                        mode. (default: None)
  --check_uri_resolves  Check that URIs/refs resolve. This can be very
                        slow, so you may want to leave this off
                        normally. (default: False)
  --verbose, -v
  --quiet, -q

Example: d3-cli ./manufacturers

Tests

Tests can be run via:

poetry run pytest

Publish

The d3-cli utility is published here.

In order to publish you must run:

poetry build
poetry publish

And then enter the credentials for the NquiringMinds pypi account.

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

d3_cli-0.1.9.tar.gz (24.0 kB view hashes)

Uploaded Source

Built Distribution

d3_cli-0.1.9-py3-none-any.whl (31.8 kB view hashes)

Uploaded Python 3

Supported by

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