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
- Clone the repository
- 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
Release history Release notifications | RSS feed
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.2.tar.gz
(10.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file file_prompt_tool-0.1.2.tar.gz.
File metadata
- Download URL: file_prompt_tool-0.1.2.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9b452198589c333a4011b15bd9a799b75d7961520dce453d95ae2bf71746f58
|
|
| MD5 |
132e27b9998722d1837a840cb4096da0
|
|
| BLAKE2b-256 |
8a0e14856dd19eb4573801112e0afb09d95d418eb4e4121a4553388d3e4ceb6d
|
File details
Details for the file file_prompt_tool-0.1.2-py3-none-any.whl.
File metadata
- Download URL: file_prompt_tool-0.1.2-py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a581777c53f45bba23bf700bb21e58f7da7f9f90de691b4a2c51f5448f5952f7
|
|
| MD5 |
d473510bdc1f68775a75a5dd87ba697f
|
|
| BLAKE2b-256 |
6ad16bfb381e6eece41100d53887ee17c99f542d0829ca8a5305cefb26cf2d17
|