Metadata-Version: 2.1
Name: s2v-client
Author: Reeeliance IM GmbH
Description-Content-Type: text/markdown
Summary: Stream2Vault Client
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.12
Requires-Dist: click~=8.1.8
Requires-Dist: dash~=2.18.2
Requires-Dist: dash-bootstrap-components~=1.7.1
Requires-Dist: google-auth~=2.38.0
Requires-Dist: httpx~=0.28.1
Requires-Dist: msal~=1.31.1
Requires-Dist: platformdirs~=4.3.6
Requires-Dist: pyyaml~=6.0.2
Requires-Dist: visdcc~=0.0.50
Requires-Dist: yaspin~=3.1.0
Version: 0.0.dev38

# Stream2Vault Client

The Stream2Vault generator client.

## Installation

Install the client using `pip`:

```shell
pip install s2v-client
```

## Usage

Authenticate the CLI with the S2V server using the auth configuration file belonging to your tenant:

```shell
s2v login -c my_auth_config.json
```

```
MY_VAULT
├── configuration
│   ├── data_vault_settings.yaml
│   ├── source_system_settings.yaml
│   └── tags
│       └── pii.yaml
├── dv_model
│   ├── HUBS
│   │   ├── HUB_BILLING.yaml
│   │   ├── HUB_COMPANY_CODE.yaml
│   │   ├── HUB_COMPANY.yaml
│   │   └── HUB_CUSTOMER.yaml
│   ├── LINKS
│   │   └── LND_L_BILLING_HEADER.yaml
│   ├── REFERENCES
│   │   └── REF_DUMMY.yaml
│   └── SATELLITES
│   │   └── LDS_example.yaml
└── sources
    └── information_schema.csv
```

### Command Line

Using the CLI, you can have the S2V generator create the vault for you:

```shell
export S2V_GENERATE_URL=https://the-s2v-server
s2v generate -i MY_VAULT/ -o output/
```

The results have been written to the `output/` directory.

Run `s2v generate --help` to learn more about possible options.

#### Setting up Shell Completion

The S2V CLI supports shell completion for Bash, Zsh and Fish.

For Bash, add this to your `~/.bashrc`:

```shell
eval "$(_S2V_COMPLETE=bash_source s2v)"
```

For Zsh, add this to your `~/.zshrc`:

```shell
eval "$(_S2V_COMPLETE=zsh_source s2v)"
```

For Fish, create a file named `~/.config/fish/completions/foo-bar.fish` with the following content:

```shell
env _S2V_COMPLETE=fish_source s2v | source
```

### Library

The S2V client can also be embedded in your Python application.

Using the auth configuration file directly assumes your application to run in an Azure environment.

```python
import pathlib
from s2v.client import S2VClient
from google.auth import external_account

credentials = external_account.Credentials.from_file("my_auth_config.json")
input_dir = pathlib.Path("MY_VAULT")
output_dir = pathlib.Path("output")
with S2VClient.create(credentials) as s2v_client:
    s2v_client.generate(input_dir, output_dir)
```

