Skip to content

maria-lagerholm/byggok_workflow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kundregister Automation Scripts

Automate the management of customer data, document generation, and calendar event creation for property incpections.

Table of Contents

Overview

This repository contains a set of Python scripts that streamline the handling of customer data for property inspections. The scripts perform the following tasks:

  1. Directory and File Management: Create directories based on property designations and copy relevant template files.
  2. Document Updates: Update Word documents with accurate property information.
  3. Google Calendar Integration: Automatically create calendar events based on inspection schedules.

Features

  • 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.

Installation

  1. Clone the Repository:

    git clone https://github.com/yourusername/kundregister-automation.git
    cd kundregister-automation
  2. Create a Virtual Environment (Optional but Recommended):

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install Required Dependencies:

    pip install -r requirements.txt

Configuration

  1. Excel File Setup:

    • Ensure your Excel file (kundregister.xlsx) is placed inside the kunder 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
  2. Template Files:

    • Place your template .docx files inside the kunder/mallar directory.
    • Name templates with prefixes saljare_ or kopare_ to categorize them accordingly.
  3. 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.

Usage

Run the scripts sequentially to perform all tasks:

  1. Part 1: Directory and File Management

    python script_part1.py
  2. Part 2: Document Updates

    python script_part2.py
  3. 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
  1. For non-coding setup create an Automator.app script (MacOS) that launches the env and runs the script:

Project Structure

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

Dependencies

Install all dependencies using:

pip install -r requirements.txt

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages