4,2 KiB
Book Map
This document provides a high-level overview of the repository's scripts, their functionalities, and the data flow between them.
Device and Data Flow Map
This section illustrates the connections between your local machine, the cloud services, and the scripts in this repository.
gdrive_cleanup.py
- Purpose: To audit and clean up your Google Drive by identifying large and duplicate files.
- Action:
- Authenticates with your Google account using OAuth 2.0.
- Scans your Google Drive files based on your specified criteria (e.g., file size, duplicates).
- Provides a report of the findings.
- Can move files to the trash (but does not permanently delete them).
- Target: Google Drive.
- Next Steps:
- Review the generated reports (
.csv,.json). - Create a list of file IDs to be trashed.
- Run the
trashcommand with the list of file IDs.
- Review the generated reports (
dropbox_to_onedrive.py
- Purpose: To import a shared folder from Dropbox into your OneDrive.
- Action:
- Downloads the Dropbox shared folder as a ZIP file.
- Extracts the ZIP file locally.
- Authenticates with your Microsoft account using OAuth 2.0.
- Uploads the extracted files to a specified folder in your OneDrive.
- Target: Dropbox (read-only), OneDrive (write).
- Next Steps:
- Verify that the files have been successfully uploaded to your OneDrive.
trading_data_manager.py
- Purpose: To automate local file management for trading logs, raw exports, and reports.
- Action:
- Creates a consistent local folder structure under
trading_data/. - Converts
raw_csv/*.csvintoreports/*.xlsx. - Moves older logs and raw files into
trash/(quarantine). - Archives older reports into
archive/YYYY/MM/. - Writes a per-run log into
automation_logs/.
- Creates a consistent local folder structure under
- Target: Local filesystem only (no cloud APIs).
- Next Steps:
- Copy
trading_data_config.example.jsontotrading_data_config.jsonand tune retention days. - Run a dry-run first:
python3 trading_data_manager.py run - Schedule daily runs (cron / Task Scheduler) once you’re happy with the output.
- Copy
Repository Instruction and Map
This section provides instructions on how to set up the repository and where to find the key scripts.
Automated Setup
This repository includes setup scripts to automate the creation of a virtual environment and the installation of dependencies.
For Linux and macOS:
# Make the script executable
chmod +x setup.sh
# Run the setup script
./setup.sh
For Windows:
# Run the setup script
setup.bat
After the setup is complete, you will need to activate the virtual environment in your current shell:
- Linux and macOS:
source .venv/bin/activate - Windows:
.venv\Scripts\activate.bat
Manual Setup
If you prefer to set up the environment manually, follow these steps:
-
Clone the repository:
git clone https://github.com/USERNAME/REPOSITORY.git cd REPOSITORY -
Create and activate a virtual environment:
python3 -m venv .venv # On Linux/macOS source .venv/bin/activate # On Windows .venv\Scripts\activate.bat -
Install dependencies:
pip install -r requirements.txt
Next Steps: OAuth Credentials
After setting up the environment, you will need to configure the necessary OAuth credentials for the scripts to function:
- For
gdrive_cleanup.py, follow the instructions in theREADME.mdto createcredentials.json. - For
dropbox_to_onedrive.py, follow the instructions in theREADME.mdto set theONEDRIVE_CLIENT_IDenvironment variable.
File and Script Locations
gdrive_cleanup.py: The main script for auditing and cleaning up Google Drive.dropbox_to_onedrive.py: The main script for importing Dropbox shared folders to OneDrive.requirements.txt: A list of the Python dependencies required to run the scripts.guidebook/: The directory containing this guide book.
GitHub Agents Setup
guidebook/04_org_copilot_agents_setup.md: A comprehensive guide for setting up GitHub Copilot and Jules agents at the organization level.