This project provides tools and scripts to automate interactions with Unanet's API, enabling seamless data extraction, authentication, and report generation. Designed for teams looking to integrate Unanet with Microsoft 365, Pipedrive, and other business systems, this repository offers reusable Python and PowerShell scripts for automation.
This repository provides tools and scripts to automate interactions with Unanet's API, including authentication, data retrieval, and report generation. The goal is to streamline operations for businesses using Unanet and improve integration with other systems like Microsoft 365 and Pipedrive.
- API Authentication: Secure token-based authentication to Unanet.
- Automated Data Extraction: Retrieve project data, time entries, and reports.
- Report Generation: Use Python and OpenAI to summarize timecard comments into structured Monthly Activity Reports.
- Integration with Microsoft 365: Automate file handling in SharePoint and OneDrive.
- Error Handling & Logging: Built-in retry logic for handling Unanet’s API inconsistencies.
- Python 3.8+
- Homebrew (for macOS users)
- Required Python Libraries
pip install requests aiopenapi3 httpx pandas python-docx tenacity dotenv
To interact with Unanet’s API, you need to authenticate using an API token.
import requests
username = 'your_username'
password = 'your_password'
response = requests.post('https://[company].unanet.biz/platform/rest/login', json={
'username': username,
'password': password
})
if response.status_code == 200:
token = response.json().get('authenticationToken')
print(f'Your API Token: {token}')
else:
print(f'Authentication failed: {response.text}')
This script dynamically loads Unanet’s API spec and fetches available endpoints.
import asyncio
from aiopenapi3 import OpenAPI
async def main():
spec_url = "https://[company].unanet.biz/platform/swagger/"
async with OpenAPI.load(spec_url) as api:
print("Available API endpoints:")
for path in api.paths.keys():
print(path)
asyncio.run(main())
If Unanet's API is well-documented, you can generate an SDK using OpenAPI Generator CLI.
brew install openapi-generator-cli
openapi-generator-cli generate -i https://[company].unanet.biz/platform/swagger/ -g python -o unanet_sdk
from unanet_sdk import ApiClient, Configuration
config = Configuration()
config.api_key['Authorization'] = "Bearer YOUR_ACCESS_TOKEN"
client = ApiClient(config)
response = client.call_api('/projects', 'GET')
print(response)
For users who want to automate file management in SharePoint, Power Automate flows can:
- Move generated reports to project lead folders.
- Trigger scripts when a new file is uploaded.
Example Power Automate Actions:
- Watch a SharePoint folder for new CSV uploads.
- Call an HTTP Request to a Python API to generate reports.
- Save the output to SharePoint and notify users via Teams.
- Fork this repository.
- Create a feature branch (
git checkout -b feature-xyz
). - Commit your changes (
git commit -m 'Add new feature'
). - Push to the branch (
git push origin feature-xyz
). - Open a Pull Request.
- Improve API documentation parsing for Unanet
- Add real-time logging for API requests
- Enhance error-handling for API failures
- Power Automate templates for SharePoint integration
- Open-source a CLI tool for Unanet API users
MIT License - Free to use and modify.