Core component for CLI tools built atop of Modular Framework
Project description
This is a temporary repository used to remap projects before push to Github
Modular CLI SDK
Building distribution archives
- Make sure you have the latest version of PyPA’s build installed:
python3 -m pip install --upgrade build
- Run the command form the same directory where
pyptoject.toml
is located:python3 -m build
- This command should output a lot of text and once completed should generate two files in the dist directory:
dist/
modular_cli_sdk-{version}.tar.gz
modular_cli_sdk-{version}-py3-none-any.whl
Installation
To install Modular CLI SDK please use pip
command:
- standard installation
pip install "modular_cli_sdk"
Usage:
1. Credentials Manager
class CredentialsProvider
Used for storing, extracting and deleting credentials. In case if a tool installed in
standalone mode all operations with credentials are carried out using the user`s
file system. In case if a tool installed as a part of
Modular-API the AWS Parameter
Store (SSM) will be used instead of file system.
In standalone installation credentials will be placed by path:
~user_home_directory/.<tool_name>/credentials
In Modular-API's installation credentials will be placed at SSM by name:
modular-api.<tool_name>.<system_username>.configuration
from modular_cli_sdk.services.credentials_manager import CredentialsProvider
configuration = CredentialsProvider(module_name="tool_name", context: Click.Context)
To access to the available methods use class property credentials_manager
:
configuration.credentials_manager.store(config=$config_dict)
configuration.credentials_manager.extract()
configuration.credentials_manager.extract()
-
store(config= ) # saving given configuration
Parameters:- config (dict) [Required] - takes a dictionary with tool configuration data
Return type: - str
- config (dict) [Required] - takes a dictionary with tool configuration data
-
extract() # retrieve saved configuration
Parameters:- None
Return type: - dict
- None
-
clean_up() # delete saved configuration Parameters:
- None
Return type: - str
- None
Project details
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
Hashes for modular_cli_sdk-1.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce5a1677ef3c2e807ef8a3472710371b6541dd55241b5ee0701b0371c1e3ebd9 |
|
MD5 | 5d6c0241cd535cb58bbf84a8aa4a7c19 |
|
BLAKE2b-256 | 3c3b17e7b057a26ff4a40d20b27d91f5def87417b01f10e47cd435419b691f7d |