Simple to use command running tools and file transformation/move tools.
Project description
DEPLOYMENT-TOOLS
Description:
Small package simplifying deployment scripts by:
- easy shell command running, with or without success checks;
- easy file editing (such as configs, settings, text, etc ...);
- easy file transfers, directory manipulation, and file reading;
Content:
class Command => runs shell command from as list[str], example ["ls", "-la"]
- raise_on_failure() => raises ShellCommand exception on cmd failure;
- set_success(check:[str], on_line[int] = None) => check if string is present in outputs, could be specified specific line, where it should be (normal python indexing applies);
- set_failure(check:[str], on_line[int] = None) => check stderr for string, could be specified specific line, where it should be (normal python indexing applies);
class [File]Builder:
- invoked by create_file_builder(path: str, type_: str | None = None, blanked=False) => path - location of the file, type_ - if None, the function will decide based on extension, otherwise supported are json, toml, yaml/yml, or it will default to txt; blanked - will void the data in the file;
- attribute self.base_data, holds all the file information;
- [+]/[-] operand can be used to either add or remove from the files (including nesting of dicts in cases of nested configs);
- txt files support self.replace_line(patten, new_line) if pattern in existing line, it will be replaced by new_line;
- self.replace_string_in_lines(old, new), it will replace old:str with new:str in all occurances in the files;
class WorkingDirectory (singleton):
- slicing: [file_name] -> returns file content as dict(json, yml/yaml, toml) or list;
- setting: [file_name] = payload: str|list -> create file with provided data;
- [+]/[/]/[self.go_to(path)] - operands are used to transfer exectusion to another location;
- self.back() - return to previous location;
- self.go_to_home() - return to initial location;
- self.transfer_with_files(*args) => move execution to a location with all files in current location;
- self.transfer_and_copy_files(*args) => move execution to a location copy all files in current location;
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
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 deployment_tools-0.1.5.tar.gz.
File metadata
- Download URL: deployment_tools-0.1.5.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.1 CPython/3.10.6 Linux/6.0.12-76060006-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13c0952fa0373649b76516645c72b17229348c4752d7b735e171dfe6f72396b4
|
|
| MD5 |
d4d20fe7a0f6726e8eb22e3f688f5802
|
|
| BLAKE2b-256 |
80a2b9a82a72b3daccfd97011493b6449ab5f670f9833dfb0f4d9c3d2dc3b356
|
File details
Details for the file deployment_tools-0.1.5-py3-none-any.whl.
File metadata
- Download URL: deployment_tools-0.1.5-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.1 CPython/3.10.6 Linux/6.0.12-76060006-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d20f85b7ac53717f8eb539a17a5ecc5131604c7b3eee14b86f502efb0471ab4d
|
|
| MD5 |
087872bbdad93b3f02b1a9219d8a4a81
|
|
| BLAKE2b-256 |
0386a575ec3a2f202a05f60356e2fac9f4606ae7a481f65d9ffb281419d087f1
|