Automate the management of customer data, document generation, and calendar event creation for property incpections.
This repository contains a set of Python scripts that streamline the handling of customer data for property inspections. The scripts perform the following tasks:
- Directory and File Management: Create directories based on property designations and copy relevant template files.
- Document Updates: Update Word documents with accurate property information.
- Google Calendar Integration: Automatically create calendar events based on inspection schedules.
- Automated Directory Creation: Generates directories for each property and populates them with necessary template files.
- Dynamic Document Editing: Updates
.docx
files with property-specific information. - Google Calendar Integration: Schedules inspection events directly into Google Calendar API.
- Progress Tracking: Provides real-time feedback on processing progress.
-
Clone the Repository:
git clone https://github.com/yourusername/kundregister-automation.git cd kundregister-automation
-
Create a Virtual Environment (Optional but Recommended):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install Required Dependencies:
pip install -r requirements.txt
-
Excel File Setup:
- Ensure your Excel file (
kundregister.xlsx
) is placed inside thekunder
directory. - The Excel file should contain the following columns:
Fastighetsbeteckning
Saljare
Kopare
Besiktningsdag
Klockan
Adress
Kommun
Fastighetsägare
Uppdragsgivare
Postadress
E-post
Telefon
Uppdragsnummer
Kostnad
- Ensure your Excel file (
-
Template Files:
- Place your template
.docx
files inside thekunder/mallar
directory. - Name templates with prefixes
saljare_
orkopare_
to categorize them accordingly.
- Place your template
-
Google Calendar API Setup:
- Obtain
credentials.json
from the Google Cloud Console. - Place
credentials.json
in the root directory of the project. - The script will generate
token.pickle
after the first successful authentication.
- Obtain
Run the scripts sequentially to perform all tasks:
-
Part 1: Directory and File Management
python script_part1.py
-
Part 2: Document Updates
python script_part2.py
-
Part 3: Google Calendar Integration
python script_part3.py
Alternatively, if all parts are combined into a single script, simply run:
python main_script.py
- For non-coding setup create an Automator.app script (MacOS) that launches the env and runs the script:
kundregister-automation/
│
├── kunder/
│ ├── kundregister.xlsx
│ ├── mallar/
│ │ ├── saljare_template1.docx
│ │ └── kopare_template1.docx
│ ├── Fastighetsbeteckning1/
│ │ ├── saljare_template1.docx
│ │ └── kopare_template1.docx
│ └── ...
│
├── events.json
├── credentials.json
├── token.pickle
├── requirements.txt
├── script_part1.py
├── script_part2.py
├── script_part3.py
└── README.md
Install all dependencies using:
pip install -r requirements.txt