Metadata-Version: 2.3
Name: sonyci
Version: 0.5.0
Summary: A Sony Ci api client
Author: WGBH-MLA
Author-email: WGBH-MLA <ryan_harbert@wgbh.org>
License: MIT
Requires-Dist: pydantic~=2.12
Requires-Dist: requests-oauth2client~=1.8
Requires-Dist: loguru~=0.7
Requires-Dist: mkdocs~=1.6 ; extra == 'docs'
Requires-Dist: mkdocs-material~=9.5 ; extra == 'docs'
Requires-Dist: mkdocs-git-revision-date-localized-plugin~=1.2 ; extra == 'docs'
Requires-Dist: mike~=2.1 ; extra == 'docs'
Requires-Dist: mkdocstrings[python]>=0.26,<2.0 ; extra == 'docs'
Requires-Dist: mkdocs-jupyter~=0.24 ; extra == 'docs'
Requires-Dist: pytest>=8.3,<10.0 ; extra == 'test'
Requires-Dist: vcrpy~=8.1 ; extra == 'test'
Requires-Dist: pytest-vcr~=1.0 ; extra == 'test'
Requires-Dist: pytest-cov>=5,<8 ; extra == 'test'
Requires-Dist: pytest-sugar~=1.0 ; extra == 'test'
Requires-Dist: pytest-xdist~=3.6 ; extra == 'test'
Requires-Dist: urllib3~=2.6 ; extra == 'test'
Requires-Python: >=3.10
Provides-Extra: docs
Provides-Extra: test
Description-Content-Type: text/markdown

![deploy](https://github.com/WGBH-MLA/sonyci/actions/workflows/CI.yml/badge.svg)
[![codecov](https://codecov.io/gh/WGBH-MLA/sonyci/branch/main/graph/badge.svg?token=6J7UUYW9I9)](https://codecov.io/gh/WGBH-MLA/sonyci)
<a href="https://codecov.io/gh/WGBH-MLA/sonyci"><img height=20 src="https://codecov.io/gh/WGBH-MLA/sonyci/branch/main/graphs/tree.svg?token=6J7UUYW9I9"></img></a>

# sonyci

A Sony Ci api client

## Install

### with pip

```sh
pip install sonyci
```

### with git

```sh
git clone https://github.com/WGBH-MLA/sonyci.git && cd sonyci
uv sync
```

### with docker

```sh
docker pull ghcr.io/wgbh-mla/sonyci:latest
docker run -it --rm ghcr.io/wgbh-mla/sonyci:latest
```

## Configure

Create a file called `.cred` with the following contents, and add your credentials:

```sh
export CI_USERNAME=
export CI_PASSWORD=
export CI_CLIENT_ID=
export CI_CLIENT_SECRET=
export CI_WORKSPACE_ID=
```

Activate the variables:

```sh
source .cred
```

Alternate notation: (May not be available in your terminal)

```sh
. .cred
```

## Use

Run the cli with `ci`

```sh
$ ci -h

 Usage: ci [OPTIONS] COMMAND [ARGS]...


╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --version             -V                          Show the version and exit.                             │
│ --verbose             -v                          Show verbose output.                                   │
│ --token               -t      PARSE_BEARER_TOKEN  Sony CI token. [env var: CI_TOKEN] [default: None]     │
│ --workspace-id        -w      TEXT                Sony CI workspace ID. [env var: CI_WORKSPACE_ID]       │
│                                                   [default: None]                                        │
│ --client-id           -c      TEXT                Sony CI client ID. [env var: CI_CLIENT_ID]             │
│                                                   [default: None]                                        │
│ --client-secret       -s      TEXT                Sony CI client secret. [env var: CI_CLIENT_SECRET]     │
│                                                   [default: None]                                        │
│ --install-completion                              Install completion for the current shell.              │
│ --show-completion                                 Show completion for the current shell, to copy it or   │
│                                                   customize the installation.                            │
│ --help                -h                          Show this message and exit.                            │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────────────────────────────────╮
│ asset      Search for files in a Sony CI workspace                                                       │
│ download   Download a file from Sony CI                                                                  │
│ get        Make a GET request to Sony CI.                                                                │
│ login      Login to Sony CI.                                                                             │
│ post       Make a POST request to Sony CI.                                                               │
│ search     Search for files in a Sony CI workspace                                                       │
│ tui                                                                                                      │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯

```

### Login

```sh
ci login
```

## develop

### pre-commit secret scanning

0. Install [ggshield](https://docs.gitguardian.com/ggshield-docs/getting-started)

```sh
pip install ggshield
# or
brew install gitguardian/tap/ggshield
```

1. Login to gitguardian

```sh
ggshield auth login
```

2. Install the pre-commit hooks

```sh
pre-commit install
```
