ProjectsPDF Parser
GCS Service
FastAPI service for working with Google Cloud Storage buckets.
GCS Service
FastAPI service for working with Google Cloud Storage buckets.
Features
- List buckets in the project
- List files in a bucket (with prefix filtering)
- Upload files to buckets
- Download files from buckets
- Delete files from buckets
- Copy files between buckets
- Get bucket and file information
- Automatic gzip compression/decompression support
API Endpoints
Health Check
GET /health- Health check endpoint
Buckets
GET /buckets- List all bucketsGET /buckets/{bucket_name}/info- Get bucket information
Files
GET /buckets/{bucket_name}/files- List files in a bucket- Query parameters:
prefix(optional): Filter files by prefixmax_results(optional, default: 100): Maximum number of results (1-1000)
- Query parameters:
GET /buckets/{bucket_name}/files/{file_path}- Download a file- Query parameters:
decompress(optional, default: false): Automatically decompress gzip files
- Query parameters:
POST /buckets/{bucket_name}/files/{file_path}- Upload a file- Query parameters:
content_type(optional): Content type (auto-detected if not provided)compress(optional, default: false): Compress file with gzip before uploading
- Query parameters:
DELETE /buckets/{bucket_name}/files/{file_path}- Delete a fileGET /buckets/{bucket_name}/files/{file_path}/info- Get file informationPOST /buckets/{bucket_name}/files/{file_path}/copy- Copy a file- Request body:
{ "destination_bucket": "target-bucket-name", "destination_path": "optional/new/path/file.txt" }
- Request body:
Environment Variables
PORT(default: 8006) - Service portGOOGLE_APPLICATION_CREDENTIALS(optional) - Path to service account JSON file- If not provided, uses default credentials (from environment or gcloud)
Authentication
The service supports two authentication methods:
- Service Account JSON File: Set
GOOGLE_APPLICATION_CREDENTIALSenvironment variable - Default Credentials: Uses application default credentials (from gcloud or environment)
Examples
List all buckets
curl http://localhost:8006/bucketsList files in a bucket
curl "http://localhost:8006/buckets/my-bucket/files?prefix=pdfs/&max_results=50"Upload a file
curl -X POST \
-F "file=@/path/to/file.pdf" \
"http://localhost:8006/buckets/my-bucket/files/pdfs/file.pdf?compress=true"Download a file
curl "http://localhost:8006/buckets/my-bucket/files/pdfs/file.pdf" -o file.pdfDownload and decompress a gzip file
curl "http://localhost:8006/buckets/my-bucket/files/data.json.gz?decompress=true" -o data.jsonDelete a file
curl -X DELETE "http://localhost:8006/buckets/my-bucket/files/pdfs/file.pdf"Copy a file
curl -X POST \
-H "Content-Type: application/json" \
-d '{"destination_bucket": "backup-bucket", "destination_path": "backup/file.pdf"}' \
"http://localhost:8006/buckets/my-bucket/files/pdfs/file.pdf/copy"Docker
Build and run:
docker build -t gcs-service .
docker run -p 8006:8006 \
-e GOOGLE_APPLICATION_CREDENTIALS=/path/to/credentials.json \
-v /path/to/credentials.json:/path/to/credentials.json \
gcs-serviceDocker Compose
The service is included in docker-compose.yml:
gcs-service:
build:
context: ./gcs_service
ports:
- "8006:8006"
environment:
PORT: 8006
GOOGLE_APPLICATION_CREDENTIALS: ${GOOGLE_APPLICATION_CREDENTIALS:-}API Documentation
Once the service is running, visit:
- Swagger UI: http://localhost:8006/docs
- ReDoc: http://localhost:8006/redoc
PDF Parser Service
FastAPI service for parsing PDF manuals and extracting text spans, tables, and schemas.
McHale Vendor Agent Specialist - Personality & Role Definition
Name: McHale Parts Co-Pilot Role: Vendor Agent Specialist Company: McHale / Clinton Tractor Primary Function: Parts search assistant and co-pilot for parts...