Awesome `sys-config` is a Python cli/package created with https://github.com/william-cass-wright/cookiecutter-pypackage-slim
Project description
sys-config
is a Python package created with william-cass-wright/cookiecutter-pypackage-slim... kinda
PROJECT DEVELOPMENT NOTES
Summary
how to use
- command line tool (component of
smgmt
)- transfer AWS Secrets to local (or visversa)
- crawl
~/.config
&~
directories for credentials/configs- systematically extract and transform for command line
- within CLI project (used to implement
mmgmt
)- init new project after binary install
- explicitly call config file (endpoint usage pattern)
- function dectorator (on top of command/endpoint)
- within context???
- other types of projects???
value to include in config file?
- pypi tokens
- api keys
- dev and prod split
- app specific references within file system
components
- file crawler
- extractor
- click interface (class inheritance --> factory design pattern?)
Usage
implementation example within media-mgmt-cli:
from .config import ConfigHandler
class AwsStorageMgmt:
def __init__(self):
self.s3_resour = boto3.resource("s3")
self.s3_client = boto3.client("s3")
self.config = ConfigHandler(project_name="media_mgmt_cli")
if self.config.check_config_exists():
self.configs = self.config.get_configs()
self.bucket = self.configs.get("aws_bucket", None)
self.object_prefix = self.configs.get("aws_bucket_path", None)
else:
echo("config file does not exist, run `mmgmt configure`")
def upload_file(self, file_name, object_name=None):
"""
...
"""
echo(
f"uploading: {file_name} \nto S3 bucket: {self.configs.get('aws_bucket')}/{self.configs.get('aws_bucket_path')}/{file_name}"
)
...
Future Work
- setup sys-config
Project Examples
Publishing Notes
make install
#* Installation
.PHONY: install
install:
poetry lock -n && poetry export --without-hashes > requirements.txt
poetry install -n
-poetry run mypy --install-types --non-interactive ./
- bump version
poetry version [major, minor, bug]
only updates within pyproject.toml
- publish
poetry publish --dry-run --build
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
sys-config-0.2.0.tar.gz
(16.7 kB
view hashes)
Built Distribution
sys_config-0.2.0-py3-none-any.whl
(15.5 kB
view hashes)
Close
Hashes for sys_config-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8cb5cbbe335476f53d110e978870272817c81121ae70c246caff0add5b25aba |
|
MD5 | da52182eff4e9e1a7875488808c079f6 |
|
BLAKE2b-256 | fa8ac46286a587861f71cb00d5abf03d306715cfd9c36593a57b639b1c41aca4 |