|
1 | 1 | # `PEPHubClient`
|
2 | 2 |
|
3 |
| -`PEPHubClient` is a tool to provide Python and CLI interface for `pephub`. |
4 |
| -Authorization is based on `OAuth` with using GitHub. |
| 3 | +[](https://pepkit.github.io) |
| 4 | + |
| 5 | +[](https://pypi.org/project/pephubclient) |
| 6 | +[](https://github.com/psf/black) |
5 | 7 |
|
6 |
| -The authorization process is slightly complex and needs more explanation. |
7 |
| -The explanation will be provided based on two commands: |
| 8 | +`PEPHubClient` is a tool to provide Python API and CLI for [PEPhub](https://pephub.databio.org). |
8 | 9 |
|
| 10 | +`pephubclient` features: |
| 11 | +1) `push` (upload) projects) |
| 12 | +2) `pull` (download projects) |
9 | 13 |
|
10 |
| -## 1. `pephubclient login` |
11 |
| -To authenticate itself user must execute `pephubclient login` command (1). |
12 |
| -Command triggers the process of authenticating with GitHub. |
13 |
| -`PEPHubClient` sends the request for user and device verification codes (2), and |
14 |
| -GitHub responds with the data (3). Next, if user is not logged in, GitHub |
15 |
| -asks for login (4), user logs in (5) and then GitHub asks to input |
16 |
| -verification code (6) that is shown to user in the CLI. |
17 |
| -After inputting the correct verification code (7), `PEPHubClient` |
18 |
| -sends the request to GitHub and asks about access token (8), which is then |
19 |
| -provided by GitHub based on data from authentication (9). |
20 |
| - |
| 14 | +Additionally, our client supports pephub authorization. |
| 15 | +The authorization process is based on pephub device authorization protocol. |
| 16 | +To upload projects or to download private projects, user must be authorized through pephub. |
21 | 17 |
|
| 18 | +To login, use the `login` argument; to logout, use `logout`. |
22 | 19 |
|
23 |
| -## 2. `pephubclient pull project/name:tag` |
24 |
| - |
| 20 | +---- |
| 21 | +```text |
| 22 | +$ phc --help |
| 23 | + |
| 24 | + Usage: pephubclient [OPTIONS] COMMAND [ARGS]... |
| 25 | + |
| 26 | +╭─ Options ───────────────────────────────────────────────────────────────────────────────────────────────────────╮ |
| 27 | +│ --version -v │ |
| 28 | +│ --install-completion Install completion for the current shell. │ |
| 29 | +│ --show-completion Show completion for the current shell, to copy it or customize the │ |
| 30 | +│ installation. │ |
| 31 | +│ --help Show this message and exit. │ |
| 32 | +╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ |
| 33 | +╭─ Commands ──────────────────────────────────────────────────────────────────────────────────────────────────────╮ |
| 34 | +│ login Login to PEPhub │ |
| 35 | +│ logout Logout │ |
| 36 | +│ pull Download and save project locally. │ |
| 37 | +│ push Upload/update project in PEPhub │ |
| 38 | +╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ |
| 39 | +``` |
| 40 | + |
| 41 | +```text |
| 42 | +$ phc pull --help |
| 43 | + |
| 44 | + Usage: pephubclient pull [OPTIONS] PROJECT_REGISTRY_PATH |
| 45 | + |
| 46 | + Download and save project locally. |
| 47 | + |
| 48 | +╭─ Arguments ─────────────────────────────────────────────────────────────────────────────────────────────────────╮ |
| 49 | +│ * project_registry_path TEXT [default: None] [required] │ |
| 50 | +╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ |
| 51 | +╭─ Options ───────────────────────────────────────────────────────────────────────────────────────────────────────╮ |
| 52 | +│ --force --no-force Overwrite project if it exists. [default: no-force] │ |
| 53 | +│ --help Show this message and exit. │ |
| 54 | +╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ |
| 55 | +``` |
| 56 | + |
| 57 | +```text |
| 58 | +$ phc push --help |
| 59 | + |
| 60 | + Usage: pephubclient push [OPTIONS] CFG |
| 61 | + |
| 62 | + Upload/update project in PEPhub |
| 63 | + |
| 64 | +╭─ Arguments ─────────────────────────────────────────────────────────────────────────────────────────────────────╮ |
| 65 | +│ * cfg TEXT Project config file (YAML) or sample table (CSV/TSV)with one row per sample to constitute │ |
| 66 | +│ project │ |
| 67 | +│ [default: None] │ |
| 68 | +│ [required] │ |
| 69 | +╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ |
| 70 | +╭─ Options ───────────────────────────────────────────────────────────────────────────────────────────────────────╮ |
| 71 | +│ * --namespace TEXT Project namespace [default: None] [required] │ |
| 72 | +│ * --name TEXT Project name [default: None] [required] │ |
| 73 | +│ --tag TEXT Project tag [default: None] │ |
| 74 | +│ --force --no-force Force push to the database. Use it to update, or upload project. │ |
| 75 | +│ [default: no-force] │ |
| 76 | +│ --is-private --no-is-private Upload project as private. [default: no-is-private] │ |
| 77 | +│ --help Show this message and exit. │ |
| 78 | +╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ |
| 79 | +
|
| 80 | +``` |
0 commit comments