week 1 (Part-1) : Folder Structure
I am a CS student learning and exploring this technology field and eagerness to build something.
Folder Structure
Since this project is not built on top of a predefined framework, the folder structure was designed intentionally to keep the codebase modular, scalable, and easy to maintain.
Each directory has a clear responsibility, making the project easy to understand and extend.
βββ π log
βββ π src
β βββ π mycli.egg-info
β β βββ π PKG-INFO
β β βββ π SOURCES.txt
β β βββ π dependency_links.txt
β β βββ π entry_points.txt
β β βββ π top_level.txt
β βββ π setfile
β βββ π GoogleOAuth
β β βββ π auth_server.py
β β βββ π db.py
β β βββ π gmail_api.py
β βββ π commands
β β βββ π gmail_auth.py
β β βββ π organize.py
β β βββ π revert.py
β βββ π core
β β βββ π prediction.py
β βββ π model
β β βββ π doc_classifier_svm.pkl
β β βββ π model.py
β βββ π utils
β β βββ π file_rules.py
β β βββ π history.py
β β βββ π logger.py
β β βββ π reader.py
β βββ π __main__.py
β βββ π cli.py
βββ βοΈ .gitignore
βββ π README.md
βββ βοΈ pyproject.toml
βββ π requirements.txt
π logs/
This directory stores all runtime logs generated by the application.
Purpose:
Helps with debugging
Tracks user actions
Provides traceability when something goes wrong
Keeping logs separate prevents clutter in the main project and makes troubleshooting easier.
π src/
The src directory contains the actual application code.
This follows a best practice used in professional Python projects to prevent import issues and keep the project clean.
π mycli.egg-info/
This folder is auto-generated by Python packaging tools.
Purpose:
Stores metadata about the package
Includes dependency information and entry points
It allows the project to behave like a real, installable CLI tool.
π setfile/
This is the core application package.
Everything related to the CLI and file organization logic lives here.
π commands/
Each command supported by the CLI is implemented in a separate file.
Why this design?
Each file handles exactly one command
Follows the Separation of Concerns principle
Makes it easy to add new commands in the future
For example:
organize.pyhandles file organizationrevert.pyhandles undoing previous operations
This keeps the CLI logic clean and easy to extend.
π core/
This folder contains the heart of the project.
core/
βββ prediction.py
prediction.py is responsible for making intelligent decisions about where files should go.
All higher-level features depend on this logic, which is why it lives in core.
π model/
This directory contains everything related to machine learning.
model/
βββ doc_classifier_svm.pkl
βββ model.py
model.pyloads and manages the ML modeldoc_classifier_svm.pklis the trained SVM model used to classify documents
Using a separate folder for ML assets makes the project easier to manage and retrain.
π utils/
This directory contains reusable helper code used across the project.
These utilities:
Handle logging
Track file history
Read file metadata
Apply file organization rules
This avoids code duplication and keeps the main logic clean.
π GoogleOAuth/
This is an advanced feature of the project.
GoogleOAuth/
βββ auth_server.py
βββ db.py
βββ gmail_api.py
It allows the CLI to:
Authenticate with Google
Access Gmail
Download email attachments
These attachments can then be organized automatically using the same ML-powered system.
This feature is isolated in its own folder so it doesnβt interfere with the main CLI logic.
π cli.py
This is the main entry point of the application.
It:
Parses command-line arguments
Dispatches the correct command from the
commands/folderConnects user input to the internal logic
π main.py
This allows the project to be executed as:
python -m setfile
It makes the package behave like a real CLI application.
π pyproject.toml & requirements.txt
These files define:
Project metadata
Dependencies
Build configuration
They allow the project to be installed and run reliably on any system.
π§ Why this structure works
This structure was chosen to ensure:
Scalability β new commands and features can be added easily
Maintainability β logic is cleanly separated
Professional packaging β the project behaves like a real Python CLI tool
AI integration β ML and prediction logic are cleanly isolated
Even without a framework, this design follows industry-level software architecture principles.
You Can see my project on and suggestions are welcomed :
Github Link : https://github.com/VivekPrajapati-Git/setfile
βThatβs all for today. This concludes Part 1 of this weekβs series. In Part 2, weβll dive deeper into the project workflow and explore how all the components come together.β