- Project Overview
- Key Features
- Prerequisites
- File Structure
- How to Use
- Next Steps
- Contributing
- License
- Contact
This project automates work order management by integrating Asana and Google Drive APIs. It streamlines task creation, updates, and organization, ensuring efficient workflows at FX Industries.
- Fetches tasks from Asana's
QUOTED JOBSsection. - Updates and moves tasks between stages (
StagingtoQUOTED JOBS).
- Locates and duplicates work order templates.
- Populates templates with task data, pulls new work order numbers, and organizes files into folders based on client name and date.
- Automatically generates and prints new work orders.
.envfile securely stores API keys.- Sensitive files are excluded from version control via
.gitignore.
- Python 3.8+ is required.
- Use a virtual environment (venv) for dependencies:
python3 -m venv env source env/bin/activate
- Install the required packages by running:
pip install -r requirements.txt
- Register an application at Asana Developers.
- Save the following credentials in
.env:ASANA_CLIENT_ID=<your_client_id> ASANA_CLIENT_SECRET=<your_client_secret> ASANA_REDIRECT_URI=http://localhost:8081
- Enable the Google Drive API in the Google Cloud Console.
- Download
client_secret_<project_id>.jsonand save it in theconfig/secrets/directory. - Add this to
.env:GOOGLE_APPLICATION_CREDENTIALS=config/secrets/client_secret_<project_id>.json
Add the following entries to .gitignore:
.env
config/secrets/asana_token.json
config/secrets/client_secret_<project_id>.json
token.json
project-root/
|-- config/
| |-- secrets/
| |-- asana_token.json # Asana OAuth tokens
| |-- client_secret_<id>.json # Google API credentials
|-- scripts/
| |-- asana_authenticate.py # Handles Asana OAuth
| |-- main_workflow.py # Main script orchestrating workflow
| |-- folder_management.py # Google Drive folder management
| |-- google_docs_api.py # Template population logic
|-- data/
| |-- asana_auth_code.txt # Asana authentication code
|-- tests/
| |-- test_asana_api.py
| |-- test_env.py
|-- .env # Environment variables
|-- requirements.txt # Python dependencies
|-- README.md # Project documentation
Run the following script to authenticate with Asana and store the token:
python scripts/asana_authenticate.pyEnsure GOOGLE_APPLICATION_CREDENTIALS is set in .env. The first API call will prompt you to authenticate.
Run the main script to automate the workflow:
python scripts/main_workflow.py- Logs: Check logs for errors or debugging information.
- Common Issues:
- Missing dependencies: Run
pip install -r requirements.txt. - API authentication errors: Reauthenticate and verify tokens.
- Missing dependencies: Run
- Implement token refresh logic for both APIs.
- Enhance error handling with detailed logs and retries.
- Add unit tests for individual modules.
- Fork the repository.
- Create a feature branch:
git checkout -b feature-name
- Commit your changes:
git commit -m 'Add feature' - Push to the branch:
git push origin feature-name
- Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
Developer: John DuCrest
Email: john@fxindustries.net