Metadata-Version: 2.4
Name: dice_cli
Version: 2025.3.1
Summary: Command-line interface for DICE
Project-URL: homepage, https://github.com/uobdic/dice-cli
Author-email: Luke Kreczko <kreczko@cern.ch>
Maintainer-email: The UoB DICE team <lcg-admin@bristol.ac.uk>
License: BSD 3-Clause License
        
        Copyright (c) 2021, Luke Kreczko.
        All rights reserved.
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        
        * Redistributions of source code must retain the above copyright notice, this
          list of conditions and the following disclaimer.
        
        * Redistributions in binary form must reproduce the above copyright notice,
          this list of conditions and the following disclaimer in the documentation
          and/or other materials provided with the distribution.
        
        * Neither the name of the vector package developers nor the names of its
          contributors may be used to endorse or promote products derived from
          this software without specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
License-File: LICENSE
Classifier: Development Status :: 1 - Planning
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.11
Requires-Dist: colorama>=0.4.0
Requires-Dist: dice-lib>=2024.04.01
Requires-Dist: diskcache>=5.4.0
Requires-Dist: htcondor>=9.0.0
Requires-Dist: plumbum>=1.7.2
Requires-Dist: prettytable>=3.2.0
Requires-Dist: requests<3.0.0
Requires-Dist: rich>=10.12.0
Requires-Dist: shellingham>=1.4.0
Requires-Dist: tabulate>=0.8.9
Requires-Dist: tqdm<5.0.0
Requires-Dist: typer>=0.4.0
Requires-Dist: typing-extensions>=3.7
Provides-Extra: admin
Requires-Dist: python-nmap>=0.7.1; extra == 'admin'
Provides-Extra: dev
Requires-Dist: pytest>=6; extra == 'dev'
Provides-Extra: docs
Requires-Dist: myst-parser>=0.13; extra == 'docs'
Requires-Dist: sphinx-book-theme>=0.1.0; extra == 'docs'
Requires-Dist: sphinx-copybutton; extra == 'docs'
Requires-Dist: sphinx~=7.0; extra == 'docs'
Provides-Extra: test
Requires-Dist: pytest>=6; extra == 'test'
Description-Content-Type: text/markdown

# DICE Command Line Interface (CLI)

[![Actions Status][actions-badge]][actions-link]
[![Documentation Status][rtd-badge]][rtd-link]
[![Code style: black][black-badge]][black-link]

[![PyPI version][pypi-version]][pypi-link]
[![PyPI platforms][pypi-platforms]][pypi-link]

[actions-badge]: https://github.com/uobdic/dice-cli/workflows/CI/badge.svg
[actions-link]: https://github.com/uobdic/dice-cli/actions
[black-badge]: https://img.shields.io/badge/code%20style-black-000000.svg
[black-link]: https://github.com/psf/black
[pypi-link]: https://pypi.org/project/dice-cli/
[pypi-platforms]: https://img.shields.io/pypi/pyversions/dice-cli
[pypi-version]: https://badge.fury.io/py/dice-cli.svg
[rtd-badge]: https://readthedocs.org/projects/dice-cli/badge/?version=latest
[rtd-link]: https://dice-cli.readthedocs.io/en/latest/?badge=latest

## Installation

The best way to install `dice-cli` is via `pipx`. This will setup a separate
`virtualenv` for `dice-cli` preventing interference with your normal Python
setup.

```bash
pipx install dice-cli
```

For tab-completion of the DICE CLI, you can run

```bash
dice --install-completion
```

which will install the completion for your shell.

Should you be using a "non-standard" shell, you can check what will be installed
through

```bash
dice --show-completion
```

## Development

### Development cycle

`dice-cli` has a direct, tight dependency on
[dice-lib](https://github.com/uobdic/dice-lib). New features are usually
developed within `dice-cli` first, and then common functionality is moved to
`dice-lib`.

### Code layout

CLI commands are currently grouped into two categories: `admin` and `user`. All
categories, except for `user` need to be placed in their respective folders.
Each category should use its own logging and error handling to allow for
individual tuning.

Main commands are implemented directly into `<category>/__init__.py`, e.g.
`dice admin scan_groups_and_users`, while subcommands should be placed in
`<category>/<command>/__init__.py`, e.g. `dice job why_is_my_job_not_running`.

Should a command require extensive logic, it should be placed in its own file ,
e.g. `admin/_print_used_id_ranges.py`. This will be the main point of change
when things move to `dice-lib`.

Snapshot (2022.02.17):

```bash
src/dice_cli/
├── __init__.py
├── _io
│   ├── __init__.py
│   └── _csv.py
├── admin # `dice admin` category
│   ├── __init__.py
│   ├── _print_unused_id_ranges.py # main command functionality for `dice admin print_unused_id_ranges`
│   ├── _print_used_id_ranges.py
│   ├── _scan_groups_and_users.py
│   └── report # all `dice admin report` commands
│       ├── __init__.py
│       ├── __pycache__
│       ├── _consistency_check_grid.py
│       ├── _inventory.py
│       ├── _network.py
│       └── _storage.py
├── benchmark
│   ├── __init__.py
├── docs
│   ├── __init__.py
├── fs # user command example: `dice fs`
│   ├── __init__.py
│   └── _copy_from_local.py
├── info
│   ├── __init__.py
├── job
│   ├── __init__.py
├── logger.py
├── main.py
└── py.typed
```

### Local installation

```bash
conda create -n dice python=3.8
conda activate dice
# make sure to have the latst pip
pip install -U pip
# install dice-cli
pip install -e .
```
