OfficeDispatch is an automated python script for detecting and uploading PowerPoint, Excel, and Word files to GitHub.
- Configuration Loading and Validation: Loads configuration from
config.json
. If the file does not exist or the configuration is invalid, it uses default settings. - File Processing: Detects and copies new PowerPoint, Excel, and Word files to the target folder.
- GitHub Upload: Uploads new files to the specified GitHub repository.
-
Clone this repository:
git clone https://github.com/LtgXs/office_dispatch.git cd your_repo_name
-
Install dependencies:
pip install -r requirements.txt
-
Configure the
config.json
file:{ "repo_name": "your_repo_name", "github_token": "enter_your_github_token_here", "json_file_path": "path/to/your/command.json", "default_screenshot_path": "C:/path/to/default_screenshot_directory", "retry_interval": 10, "check_interval": 30, "fetch_interval": 60, "RemoteExc": {"enabled": False, "interval": 120} }
-
Run the script:
python OfficeDispatch.py
-
The script will automatically detect new PowerPoint, Excel, and Word files and upload them to GitHub.
repo_name
: The name of the GitHub repository.github_token
: The GitHub access token. Notice: Token will be encrypted by the script after first run, you can change your password in the scriptretry_interval
: The retry interval (in seconds) when initializing COM objects fails.check_interval
: The interval (in seconds) for detecting new files.
All log messages are written to the log.txt
file, including timestamps and detailed information.
Contributions are welcome! Please fork this repository and submit a pull request.