# π Telegram Data Processing Pipeline
This project is designed to scrape, clean, and store Telegram e-commerce data in a structured format for analysis. The pipeline consists of data scraping, cleaning, and storage in a database.
## π Project Structure
```
WEEK7/
βββ data/ # Raw and cleaned data storage
β βββ CheMed123_data.csv
β βββ DoctorsET_data.csv
β βββ EAHCI_data.csv
β βββ lobelia4cosmetics_data.csv
β βββ yetenaweg_data.csv
β βββ cleaned_telegram_data.csv # Cleaned merged dataset
βββ logs/ # Logging directory
βββ notebook/ # Jupyter Notebooks for analysis
β βββ data_cleaning_loading.ipynb
βββ scripts/ # Python scripts for processing
β βββ data_cleaning.py # Functions for data cleaning
β βββ database_setup.py # Database connection and table creation
β βββ scrape_data.py # Telegram data scraper
βββ .env # Environment variables
βββ .gitignore # Files to ignore in version control
βββ channels.json # List of Telegram channels
βββ requirements.txt # Required Python dependencies
βββ run_scraper.sh # Shell script to execute scraper
βββ README.md # Project documentation
```
## π How to Run the Project
1οΈβ£ Set Up the Environment
Ensure you have Python 3.8+ installed. Create a virtual environment and install dependencies:
```bash
python -m venv .venv
source .venv/bin/activate # On Windows use: .venv\Scripts\activate
pip install -r requirements.txt
```
2οΈβ£ Configure Environment Variables
Create a .env file inside the project directory:
```bash
DB_NAME=your_database
DB_USER=your_user
DB_PASSWORD=your_password
DB_HOST=localhost
DB_PORT=5432
```
3οΈβ£ Scrape Data from Telegram
Run the scraper to collect messages and store them in CSV format:
```bash
python scripts/scrape_data.py
```
4οΈβ£ Clean the β¦