API client & CLI for https://github.com/realerikrani/project
Project description
projectclient
API client and CLI for https://github.com/realerikrani/project.
CLI
Pip-install projectclient.
Set export PROJECT_CLI_CONFIG_PATH=/path/to/config.ini
which contains the URL of your project API
[DEFAULT]
url = http://localhost:5000
Then can call the
cli_project -h
usage: cli_project [-h] {create,read,delete,key-create,keys-read,key-delete} ...
CLI for managing projects and keys.
positional arguments:
{create,read,delete,key-create,keys-read,key-delete}
create Create a project with a key.
read Read a project.
delete Delete a project.
key-create Create a new key for a project.
keys-read Read public keys of a project.
key-delete Delete a key.
options:
-h, --help show this help message and exit
API Client
from realerikrani.projectclient import JWTAuth, ProjectClient
from realerikrani.baseclient import BaseAdapter, BaseClient
def create_project_client() -> ProjectClient:
adapter = BaseAdapter()
with requests.Session() as session:
jwt_auth = None
with suppress(KeyError):
jwt_auth = JWTAuth(YOUR_CONF[YOUR_PROJECT_ID], YOUR_CONF[YOUR_KEY_ID], YOUR_CONF[YOUR_PRIVATE_KEY_PEM_STR])
baseclient = BaseClient(
session=session, adapter=adapter, url=YOUR_URL, auth=jwt_auth
)
return ProjectClient(baseclient)
Direct Dependencies:
- requests - licensed under the Apache License 2.0
- realerikrani-baseclient - licensed under the Apache License 2.0
- pyjwt[crypto] - licensed under the MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file realerikrani_projectclient-1.0.0.tar.gz.
File metadata
- Download URL: realerikrani_projectclient-1.0.0.tar.gz
- Upload date:
- Size: 11.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f63e6fa70f7ed39064ed90fe125949b9d1c7428f450624c7f6f7917824a0c14c
|
|
| MD5 |
9589ed6f9a565e6f736b11046b8d32e6
|
|
| BLAKE2b-256 |
cfdc8e3ffcb4907885f918b9593c902ff3698d3f20f4d9fee2cc85bcd0613b2b
|
File details
Details for the file realerikrani_projectclient-1.0.0-py3-none-any.whl.
File metadata
- Download URL: realerikrani_projectclient-1.0.0-py3-none-any.whl
- Upload date:
- Size: 15.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59639a99c7f42bfea9be8b83d597ec5e80b75191a5dcefb6d1ae37597cff51a3
|
|
| MD5 |
a0a524be5b2b69bfcd1b4970b206f325
|
|
| BLAKE2b-256 |
a32bf9e8ec029541fd740d582700ebeda97f317bbc21978cebda18da91194109
|