Metadata-Version: 2.4
Name: ichec_platform_core
Version: 0.1.6
Summary: Utility library to support ICHEC Platform Engineering tools
Author: Irish Centre for High End Computing
License: MIT
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: Programming Language :: Python :: 3.14
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: System :: Distributed Computing
Requires-Python: >=3.14
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: PyYAML
Requires-Dist: pydantic
Dynamic: license-file

# ichec-platform-core

`ichec_platform_core` is a small Python library that other ICHEC platform tools
build on. It works with files, HTTP, git and the GitLab API. It also has a few
commands, which are handy for trying the library out.

## Install

```sh
pip install ichec_platform_core
```

Before you upgrade, read [CHANGELOG.md](CHANGELOG.md) for what each release
removes.

## Replace text in files

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

This replaces the search text with the replacement in every file under the
target directory. Both come from files, so you don't have to escape them for
the shell as you would with `sed`.

## Download a file

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

## Work with GitLab and git

Get the version of a project's latest release:

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

Add `--asset_name $ASSET_NAME` to download an asset from that release. The
token needs the Developer role and the `read_api` scope.

Inside a git repo, show information about it:

```shell
ichec_platform_core git info
```

In Python, use `GitlabClient` and `HttpClient` for the same things.

## Licence

MIT. See [LICENSE](LICENSE).
