This document explains the newly organized project structure and how to navigate and use it effectively.
This workspace was reorganized from a flat structure with 100+ files into a logical, maintainable structure following Python project best practices.
excel_stock_updater.py- Main stock price extractor (kept in root)outstanding_shares_updater.py- Main shares extractor (kept in root)requirements.txt- Dependencies (kept in root)README.md- Updated with new structure documentation
├── 📂 src/ # All source code modules
├── 📂 tests/ # All test files and test data
├── 📂 ai_integration/ # AI integration and improvement scripts
├── 📂 logs/ # All log files and analysis reports
├── 📂 html_debug/ # HTML debug and page source files
├── 📂 summaries/ # Implementation and feature summaries
├── 📂 docs/ # Additional documentation
├── 📂 data/ # Excel data files (input/output)
├── 📂 batch_files/ # Batch execution scripts
├── 📂 backups/ # Backup files
├── 📂 config/ # Configuration files
├── 📂 bf4py/, bf4pym/ # External libraries (preserved)
├── excel_stock_updater.py # 🔥 MAIN SCRIPT
├── outstanding_shares_updater.py # 🔥 MAIN SCRIPT
├── requirements.txt # Dependencies
└── README.md # Documentation
-
outstanding_shares_updater.py- ✅ Updated imports:
from src.sixgroup_shares_extractor import ... - ✅ Updated data paths:
data/Custodians.xlsx
- ✅ Updated imports:
-
excel_stock_updater.py- ✅ Updated data paths:
data/Custodians.xlsx
- ✅ Updated data paths:
-
Source modules in
src/- ✅ Updated to relative imports:
from .module_name import ...
- ✅ Updated to relative imports:
-
Test files in
tests/- ✅ Updated imports:
from src.module_name import ...
- ✅ Updated imports:
-
Batch files
- ✅ Enhanced user interface and messaging
The main functionality works exactly the same:
# Run both extractors (recommended)
./batch_files/run_updater_with_shares.bat
# Or run individually
python excel_stock_updater.py
python outstanding_shares_updater.pyWhen importing modules in your own scripts:
# From root directory (where main scripts are)
from src.sixgroup_shares_extractor import extract_sixgroup_shares
from src.custom_domain_extractors import extract_with_custom_function
# For CLI usage
python src/sixgroup_cli.py <URL>- Input:
data/Custodians.xlsx(your data file) - Output:
data/Custodians_Results.xlsx(results)
# Run specific tests
python tests/test_sixgroup_extractor.py
python tests/quick_demo_test.py
# Or use individual test files from tests/- Logical Grouping: Related files are together
- Clear Separation: Tests, docs, logs, code are separated
- Easy Navigation: Find what you need quickly
- Proper Python Package Structure:
src/with__init__.py - Clean Imports: No more scattered imports
- Version Control: Better for Git/source control
- Industry Standard: Follows Python packaging guidelines
- Documentation Focused: Easy to find relevant docs
- Testing Organized: All tests in one place
| Old Location | New Location | Purpose |
|---|---|---|
custom_domain_extractors.py |
src/custom_domain_extractors.py |
Source module |
test_*.py |
tests/test_*.py |
Test files |
*_log_*.txt |
logs/*_log_*.txt |
Log files |
*.html |
html_debug/*.html |
Debug HTML |
*_summary.md |
summaries/*_summary.md |
Documentation |
*.bat |
batch_files/*.bat |
Batch scripts |
Custodians*.xlsx |
data/Custodians*.xlsx |
Data files |
If you get import errors, make sure you're running from the root directory:
cd "path/to/little test - v19"
python outstanding_shares_updater.pyThe main scripts now look for data files in data/ directory. Make sure your Excel files are in data/Custodians.xlsx.
For custom development, ensure you have the current directory in your Python path:
import sys
sys.path.append('.') # Add current directory
from src.module_name import function_name- 🔥
excel_stock_updater.py- Main stock price extraction - 🔥
outstanding_shares_updater.py- Main shares extraction - 📊
data/Custodians.xlsx- Your input data - 📊
data/Custodians_Results.xlsx- Generated results - 📖
README.md- Full documentation
batch_files/- Easy-to-run batch scriptsdata/- Your Excel files go herelogs/- Check here for run logs and errorssummaries/- Implementation documentation
src/- All source code modulestests/- Test files and test dataai_integration/- AI enhancement scriptsdocs/- Technical documentation
Important: This reorganization is purely structural. All functionality remains identical:
- ✅ Same extraction capabilities
- ✅ Same AI fallback features
- ✅ Same batch file operations
- ✅ Same output formats
- ✅ Same success rates
The code works exactly the same - it's just much better organized!