bex-hooks-files
File-related hooks for bex. This package provides hooks to download, extract, and generate files.
Usage
bex-hooks-files is available on PyPI.
Add the plugin package to the requirements section of your bex bootstrap header:
# /// bootstrap
# requires-python: ">=3.11,<3.12"
# requirements: |
# bex-hooks
# bex-hooks-files
# entrypoint: bex_hooks.exec:main
# ///
Then enable the plugin in your configuration:
config:
plugins:
- bex_hooks.hooks.files
Hooks
files/archive
Downloads an archive (zip or tar, including compressed variants) from a source URL and extracts it to a target directory.
Arguments
| Name | Type | Default | Description |
|---|---|---|---|
source |
str |
(required) | URL to the archive file. |
source_hash |
str |
(required) | Expected file hash (e.g. sha256:<digest>) for integrity verification. |
target |
str |
(required) | Destination directory where the archive will be extracted. |
format |
str |
(required) | Archive format (e.g. zip, tar, tar.gz, tar.xz). |
keep_source |
bool |
True |
If False, removes the downloaded archive after extraction. |
Example
hooks:
- id: files/archive
source: https://example.com/project.tar.gz
source_hash: sha256:abc123...
target: ./project
format: tar.gz
keep_source: false
files/download
Downloads a file from a source URL to a target path.
Arguments
| Name | Type | Default | Description |
|---|---|---|---|
source |
str |
(required) | URL to the file. |
source_hash |
str |
(required) | Expected file hash (e.g. sha256:<digest>) for integrity verification. |
target |
str |
(required) | Destination file path. |
keep_source |
bool |
True |
If False, removes the downloaded file after processing. |
Example
hooks:
- id: files/download
source: https://example.com/tool.bin
source_hash: sha256:def456...
target: ./bin/tool.bin
files/inline
Creates a file at the specified target path using inline content.
Arguments
| Name | Type | Default | Description |
|---|---|---|---|
content |
str |
(required) | File contents. |
target |
str |
(required) | Destination file path. |
Example
hooks:
- id: files/inline
target: ./config/example.txt
content: |
hello world
this file was generated by bex
Metadata
Release files for bex-hooks-files 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bex_hooks_files-0.1.0.tar.gz | 5.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bex_hooks_files-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.4 kB
Release files / bex_hooks_files-0.1.0.tar.gz
| Download URL | bex_hooks_files-0.1.0.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
10f20d8509091231638d4911608c00f79e49b86d424743abc85fa49ff760e5c3
|
|
BLAKE2b-256 checksum How to use checksums |
8d08bdc2ea8ffd57898d49b71f0f6b8aa5b3f0942ebb029ca2728abdb80755c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / bex_hooks_files-0.1.0-py3-none-any.whl
| Download URL | bex_hooks_files-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
87d0e0805bfa79a7c4e4088515fc34f3c5c626cf177f035e865f9fa243b5ac05
|
|
BLAKE2b-256 checksum How to use checksums |
3e2a441461abce540d3c8f3708ac32126bed40031db803bb24d3f6947ed2e8d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|