Skip to main content

tlnw-get-file

tlnw-get-file is a small cross-platform Python CLI that retrieves a single file or folder from a Git repository by using sparse checkout and then moves it into a relative destination under the current working directory.

Installation

python -m pip install .

Usage

tlnw-get-file --git --repo https://github.com/owner/repo.git --source path/to/file.txt --dest output.txt

The CLI always supports these common options:

  • --help: show the current version, usage, and available options
  • --debug: enable debug logging
  • --version: print the current version

Version 0.1.0 requires --git mode.

Git mode

  • --repo must be an HTTPS repository URL.
  • --source must be a single relative file or folder path inside the repository.
  • --dest must be a relative path from the current working directory and must not contain .. path segments.

If TLNW_GIT_ACCESS_TOKEN is set, the command injects it into the HTTPS clone URL by using x-access-token authentication. If the variable is absent, the repository is cloned as a public repository.

Destination behavior

  • If --dest points to an existing directory, the retrieved source is moved inside it.
  • If --dest ends with / or \, that directory is created and the retrieved source is moved inside it.
  • Otherwise, a file source is written to the exact destination file path.
  • Otherwise, a directory source is moved to the exact destination directory path, which allows renaming the retrieved folder.

Examples

Retrieve a file to a specific output filename:

tlnw-get-file --git --repo https://github.com/owner/repo.git --source docs/spec.md --dest specs/current.md

Retrieve a folder into a destination directory:

tlnw-get-file --git --repo https://github.com/owner/repo.git --source templates/api --dest vendor/

Enable debug logging:

tlnw-get-file --debug --git --repo https://github.com/owner/repo.git --source path/to/file.txt --dest output.txt

Development

python -m pip install -e .[dev]
python -m pytest

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tlnw_get_file-0.1.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

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

tlnw_get_file-0.1.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tlnw_get_file-0.1.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for tlnw_get_file-0.1.0.tar.gz
Algorithm Hash digest
SHA256 82275984f2d0dc797b067671ce52bb99b45d307ab99d79da9d6af70dd867b907
MD5 6648f764cfaebca41873026a09d4bca0
BLAKE2b-256 be80ae77cc15c98adaabbdba14b16ac21131b25be849e9048b1d3d9371c89007

See more details on using hashes here.

Provenance

The following attestation bundles were made for tlnw_get_file-0.1.0.tar.gz:

Publisher: publish-to-pypi.yml on tellersnetwork/tlnw-get-file

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: tlnw_get_file-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for tlnw_get_file-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 65a8ecf7e7ba1329d95506a0951b528dfe1aaec37a7c7fba60e32319ddba3805
MD5 ac7616e36f3f834841912926da043479
BLAKE2b-256 23ffc5272f9337cc5ed2f948dbc396b7b40dd2952f8bd4085d86bfcaa5120083

See more details on using hashes here.

Provenance

The following attestation bundles were made for tlnw_get_file-0.1.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on tellersnetwork/tlnw-get-file

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.2.0

2 files

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page