Combined Bitbucket template with Python-specific patterns for comprehensive file exclusion coverage. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| templates | ||
| .gitignore | ||
| AI COMPANION Metafile Server Grabber.blueprint.json | ||
| app.py | ||
| INSTALL.md | ||
| README.md | ||
| requirements.txt | ||
| run.py | ||
| start.sh | ||
Meta File Server Query Application
A Python Flask web application that replicates the Make.com workflow for querying the Oliver metafile server to retrieve job information based on deliverable numbers.
Features
- Two-stage workflow: First fetches XML to extract client information, then retrieves JSON data
- Secure authentication: Uses MD5 checksum authentication matching the original blueprint
- Clean web interface: Simple HTML form with responsive design
- Error handling: Comprehensive error handling for network issues, SSL problems, and parsing errors
- Portable: Self-contained with virtual environment for easy deployment
Quick Start
Option 1: Use the startup script
./start.sh
Option 2: Manual setup
# Create and activate virtual environment
python3 -m venv meta-server-venv
source meta-server-venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Run the application
python run.py
Then open your browser to: http://localhost:5000
Usage
- Enter a job/deliverable number in the web form
- Click "Query Job Information"
- The application will:
- Fetch the XML file from the metafile server
- Extract the client name from the jobpath
- Retrieve the corresponding JSON data using the client information
- Display the results in a formatted view
API Endpoints
GET /- Main web interfaceGET /api/job/<job_number>- Retrieve job information as JSONGET /api/health- Health check endpoint
Example API Response
{
"success": true,
"job_number": "6046034",
"client": "ADIDAS",
"data": {
"JobSpecification": {
// ... job data ...
}
}
}
Configuration
The application uses these default settings:
- Metafile Server:
https://metafile.oliver.solutions/getFile - API Key:
$14W0TF~8FL(from original blueprint) - Port: 5000
- SSL Verification: Disabled (due to certificate issues)
Project Structure
META-FILE-SERVER-QUERY/
├── app.py # Main Flask application
├── run.py # Application runner
├── start.sh # Startup script
├── requirements.txt # Python dependencies
├── templates/
│ └── index.html # Web interface
├── static/ # Static assets (empty)
└── meta-server-venv/ # Python virtual environment
Technical Details
Workflow Process
-
XML Retrieval:
- Constructs URL:
{base_url}?root=XML&path={job_number}.xml&keyid=1&cs={checksum} - Checksum:
MD5(api_key + "XML/" + filename)
- Constructs URL:
-
Client Extraction:
- Parses XML for
Set-PropertywithProperty="jobpath" - Extracts client name using regex:
([A-Z][A-Z0-9_]*?)(?=/CAMPAIGNS/)
- Parses XML for
-
JSON Retrieval:
- Constructs URL:
{base_url}?root=JSON_STORE&sub={client}&path={job_number}.json&keyid=1&cs={checksum} - Checksum:
MD5(api_key + "JSON_STORE/" + client + "/" + filename)
- Constructs URL:
Error Handling
- SSL certificate verification disabled for metafile.oliver.solutions
- Network timeout protection (30 seconds)
- XML parsing error handling
- JSON parsing error handling
- HTTP status code validation
Moving to Production
To deploy this application:
- Copy the entire directory to your target server
- Install Python 3.7+ on the target system
- Run the startup script:
./start.sh - For production: Consider using a WSGI server like Gunicorn:
pip install gunicorn gunicorn -w 4 -b 0.0.0.0:5000 app:app
Troubleshooting
SSL Certificate Issues
The application automatically handles SSL certificate verification issues by disabling verification. This is necessary because the metafile server has certificate problems.
Connection Timeouts
The application has a 30-second timeout for requests. If you experience frequent timeouts, check your network connection to the metafile server.
Missing Job Data
If a job number returns an error, verify:
- The job number exists in the XML system
- The corresponding JSON file exists in the JSON_STORE
- The client name extraction is working correctly
Development
To modify or extend the application:
- Activate the virtual environment:
source meta-server-venv/bin/activate - Make your changes to
app.pyortemplates/index.html - Test your changes:
python run.py - The server will automatically reload in debug mode
Converted from Make.com blueprint: "AI COMPANION Metafile Server Grabber"