Skip to main content

A CLI tool for dispatching file processing jobs to GCP Pub/Sub and listening for results

Project description

File Prompt CLI

A CLI tool for dispatching files to GCP Pub/Sub and listening for results.

Installation

pip install file-prompt-tool

Usage

The CLI tool provides a single command to dispatch files to GCP Pub/Sub and listen for results:

file-prompt "*.txt" \
  --prompt "Summarize this text" \
  --project-id "your-project-id" \
  --bucket "your-bucket-name" \
  --topic "your-topic-name" \
  --subscription "your-subscription-name"

Arguments

  • files: File paths or glob patterns to process (required)
  • --prompt, -p: Prompt to use for processing (required)
  • --project-id: GCP project ID (required)
  • --bucket: GCS bucket name (required)
  • --topic: Pub/Sub topic name (required)
  • --subscription: Pub/Sub subscription name (required)
  • --timeout, -t: Timeout in seconds for processing each file (default: 300)
  • --verbose, -v: Enable verbose output (default: false)

Example

# Process all text files in the current directory
file-prompt "*.txt" \
  --prompt "Summarize this text" \
  --project-id "my-project" \
  --bucket "my-bucket" \
  --topic "file-processing" \
  --subscription "file-results"

# Process specific files with verbose output
file-prompt file1.txt file2.txt \
  --prompt "Analyze this document" \
  --project-id "my-project" \
  --bucket "my-bucket" \
  --topic "file-processing" \
  --subscription "file-results" \
  --verbose

Development

Setup

  1. Clone the repository
  2. Install development dependencies:
    pip install -e ".[dev]"
    

Running Tests

pytest

Code Style

The project uses:

  • Black for code formatting
  • isort for import sorting
  • flake8 for linting
  • mypy for type checking

Run all checks:

black .
isort .
flake8
mypy .

License

MIT

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

file_prompt_tool-0.1.1.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

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

file_prompt_tool-0.1.1-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file file_prompt_tool-0.1.1.tar.gz.

File metadata

  • Download URL: file_prompt_tool-0.1.1.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.7

File hashes

Hashes for file_prompt_tool-0.1.1.tar.gz
Algorithm Hash digest
SHA256 485cb8fe3e2322b665b25a1f4da38fc57929a3aaa562a96b1ad6b5536ae7f6c2
MD5 7846be2e7ff811ccc416eb483e0dacf9
BLAKE2b-256 ea012da99b0b1c9f3ad97e98668dab74bd000a05c09857faa82471a6faeccfc9

See more details on using hashes here.

File details

Details for the file file_prompt_tool-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for file_prompt_tool-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6f14a4de0207d71074b872cc6b98bb2c17fd487bdb5f3cc0faf7491fd54b6acb
MD5 8c5a1e141c02872bb3379094eae0f12f
BLAKE2b-256 564b9914254d1590412a23c372832caf2a7a99e57d3cdc8edf6df19af496185d

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