Skip to main content

Validate and debug DCTAP instances.

Project description

Basic validation of a DCTAP instance.

Test Status Documentation Status Code style: black

Documentation

Installation

To work correctly, “dctap” requires Python 3.7 or higher. Executing the command python3 should show you if Python 3 is installed on your machine and in which version.

As explained below, the command-line utility can be installed either from the online PyPI repository, using the pip command, or from a local copy of the project on your own machine.

Installation with pip (ordinary users)

Installing with “pip” pulls the most recently published version of the project from the PyPI repository with the following command:

python3 -m pip install -U https://github.com/dcmi/dctap-python/archive/main.zip

Installation with pip (developers)

For developers who work alot with Python projects, it is good practice to create and activate a virtual environment so that “dctap”, and its dependencies, will not be installed into the global Python environment on your machine. The virtual environment is held in a directory of your choice; in the example below, a hidden directory .venv is created in some_directory (your current working directory), and the virtual environment is activated by executing source .venv/bin/activate.

some_directory$ python3 -m venv .venv
some_directory$ source .venv/bin/activate
some_directory$ python3 -m pip install -U https://github.com/dcmi/dctap-python/archive/main.zip

Note that “dctap” will pip-install even without creating and activating a virtual environment, even though this is not considered good practice. If you do install it into a virtual environment, note that the virtual environment must be activated with source .venv/bin/activate or “dctap” will not work. The activation of a virtual environment can be automated by adding this command to a shell profile where it will be executed when starting the shell, for example by adding the lines to the file “~/.bash_profile”:

cd /Users/foo/somedirectory
source .venv/bin/activate

Installation from a local clone of Git repository

Cloning the “dctap-python” repository to your machine and installing it from the dctap-python directory is a good option if you want to keep up-to-date with the latest developments in the project. The following commands install “dctap” for the first time. In order to refresh the project directly from the project repository, you can at any time execute git pull (from within the repository), which will install the latest features and bug fixes in your local copy.

$ git clone https://github.com/dcmi/dctap-python.git
$ cd dctap-python
dctap-python$ python -m venv .venv
dctap-python$ source .venv/bin/activate
dctap-python$ python3 -m pip install flit Pygments
dctap-python$ flit install -s

Quick start

Run without arguments, “dctap” shows what options and commands are available.

$ dctap
Usage: dctap [OPTIONS] COMMAND [ARGS]...

  DC Tabular Application Profiles (DCTAP) - base module

Options:
  --version  Show version and exit
  --help     Show help and exit

Commands:
  generate  Given CSV, generate text, JSON, or YAML, with warnings.
  init      Write out starter config file [default: dctap.yml]

To examine a CSV file formatted according to the DCTAP model (here: “some_dctap.csv”), use the dctap generate command.

$ dctap generate some_dctap.csv

For more information, see the documentation on readthedocs.io.

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

dctap-0.3.3.tar.gz (43.9 kB view hashes)

Uploaded Source

Built Distribution

dctap-0.3.3-py3-none-any.whl (15.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