Skip to main content

bex-hooks-files

Project description

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

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

bex_hooks_files-0.1.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bex_hooks_files-0.1.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file bex_hooks_files-0.1.0.tar.gz.

File metadata

  • Download URL: bex_hooks_files-0.1.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for bex_hooks_files-0.1.0.tar.gz
Algorithm Hash digest
SHA256 10f20d8509091231638d4911608c00f79e49b86d424743abc85fa49ff760e5c3
MD5 ae2517bb1ec99df8dc25024efaf46f5e
BLAKE2b-256 8d08bdc2ea8ffd57898d49b71f0f6b8aa5b3f0942ebb029ca2728abdb80755c1

See more details on using hashes here.

File details

Details for the file bex_hooks_files-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: bex_hooks_files-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for bex_hooks_files-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 87d0e0805bfa79a7c4e4088515fc34f3c5c626cf177f035e865f9fa243b5ac05
MD5 27fef9e889aa9e7f8d21daa574c0cbb1
BLAKE2b-256 3e2a441461abce540d3c8f3708ac32126bed40031db803bb24d3f6947ed2e8d1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page