Metadata-Version: 2.4
Name: ichec_platform_core
Version: 0.0.2
Summary: Utility library to support ICHEC Platform Engineering tools
Author: Irish Centre for High End Computing
Project-URL: Repository, https://git.ichec.ie/platform-engineering/ichec-platform-core
Project-URL: Homepage, https://git.ichec.ie/platform-engineering/ichec-platform-core
Keywords: HPC
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Operating System :: OS Independent
Classifier: Topic :: System :: Distributed Computing
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: PyYAML
Requires-Dist: pydantic
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Requires-Dist: pytest-sugar; extra == "test"
Requires-Dist: pytest-mock; extra == "test"
Requires-Dist: black; extra == "test"
Requires-Dist: mypy; extra == "test"
Requires-Dist: flake8; extra == "test"
Requires-Dist: pylint; extra == "test"
Provides-Extra: types
Requires-Dist: types-PyYAML; extra == "types"
Dynamic: license-file

# ichec-platform-core

This package has a set of low-level and low-dependency tools used by several ICHEC Platform Engineering projects. Some basic CLI commands are also included, sometimes just as a demo or way to easily test out library features.

# Features #

## Filesystem ##

Filesystem interaction utilities.

**Example CLI:** You can replace all occurences of a string with another recursively in files with:

``` shell
ichec_platform_core filesystem replace_in_files --target $REPLACE_DIR --search $FILE_WITH_SEARCH_TERM --replace $FILE_WITH_REPLACE_TERM 
```

The `search` and `replace` terms are read from files. This can be handy to avoid shell escape sequences - as might be needed in `sed`.

## Network ##

Tooling for communication over a network, includes a:

* `HttpClient`

**Example CLI:** You can download a file with:

``` shell
ichec_platform_core network download --url $RESOURCE_URL --download_dir $WHERE_TO_PUT_DOWNLOAD
```

## Version Control ##

Tooling for interacting with `git` and `gitlab` via its API. Includes a:

* `GitlabClient`

**Example CLI:** You can get the version number of the most recent project release with:

``` shell
ichec_platform_core gitlab --token $GITLAB_TOKEN latest_release $PROJECT_ID
```

or download a particular release asset with:

``` shell
ichec_platform_core gitlab --token $GITLAB_TOKEN latest_release $PROJECT_ID --asset_name $ASSET_NAME
```

The token should have suitable permissions to download project release assets, in particular 'read api', 'repo access' and Developer Role.

You can get info about a git repo with:

``` shell
ichec_platform_core git info 
```

run in the repo.

# Install  #

It is available on PyPI:

``` sh
pip install ichec_platform_core
```

# License #

This project is licensed under the GPLv3+. See the incluced `LICENSE.txt` file for details.
