{"id":25449304,"url":"https://github.com/nel-zi/data_engineering_pretest","last_synced_at":"2025-05-16T08:34:01.554Z","repository":{"id":274183990,"uuid":"920657302","full_name":"Nel-zi/Data_Engineering_Pretest","owner":"Nel-zi","description":"In this project, I analyzed supermarket datasets to uncover branch-level sales patterns, regional trends, and promotion effectiveness. This analysis provided valuable insights that helped drive data-driven strategic decisions.","archived":false,"fork":false,"pushed_at":"2025-01-27T07:56:09.000Z","size":25676,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-17T20:34:49.559Z","etag":null,"topics":["businessinsights","dataanalysis","dataanlaytics","datacleaning","machine-learning","machine-learning-algorithms","machinelearningmodel","machinelearningprojects"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nel-zi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-22T14:48:21.000Z","updated_at":"2025-01-27T07:56:12.000Z","dependencies_parsed_at":"2025-01-25T14:38:52.585Z","dependency_job_id":null,"html_url":"https://github.com/Nel-zi/Data_Engineering_Pretest","commit_stats":null,"previous_names":["nel-zi/data_engineering_pretest"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nel-zi%2FData_Engineering_Pretest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nel-zi%2FData_Engineering_Pretest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nel-zi%2FData_Engineering_Pretest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nel-zi%2FData_Engineering_Pretest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nel-zi","download_url":"https://codeload.github.com/Nel-zi/Data_Engineering_Pretest/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254496081,"owners_count":22080649,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["businessinsights","dataanalysis","dataanlaytics","datacleaning","machine-learning","machine-learning-algorithms","machinelearningmodel","machinelearningprojects"],"created_at":"2025-02-17T20:27:31.232Z","updated_at":"2025-05-16T08:33:56.546Z","avatar_url":"https://github.com/Nel-zi.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Data_Engineering_Pretest\n \n ### **Documentation and Setup Instructions**\n\nThis documentation provides guidance on setting up, running, and understanding the codebase, including instructions for installing dependencies, configuring the environment, and running the analysis.\n\n---\n\n### **1. Prerequisites**\n\nBefore proceeding, ensure you have the following installed:\n- **Python** (version 3.8 or higher)\n- **Git** (if cloning the repository)\n- A code editor or IDE (e.g., VS Code, PyCharm)\n\n---\n\n### **2. Directory Structure**\nHere is an how the project directory is organized:\n\n```\nproject-directory/\n│\n├── Raw_datasets/\n│   ├── items.csv\n│   ├── promotion.csv\n│   ├── sales.csv\n│   ├── supermarkets.csv\n│\n├── src/\n│   ├── Data_Engineering_Pretest.ipynb  # Main script for running analysis\n│   ├── Clean_data.py # Functions for cleaning datasets\n│\n├── requirements.txt    # List of dependencies\n├── .env                # Environment variables (e.g., database credentials)\n├── README.md           # Project overview and usage\n└── Report\n    └── Report on Data Engineering Pretest.pdf   # Final report detailing tasks and insights\n```\n\n---\n\n### **3. Setting Up the Project**\n\n#### **Step 1: Clone the Repository**\nIf the project is hosted on a Git repository, clone it:\n```bash\ngit clone \u003crepository-url\u003e\ncd project-directory\n```\n\n#### **Step 2: Create a Virtual Environment**\nSet up a virtual environment to manage dependencies:\n```bash\npython -m venv venv\nsource venv/bin/activate  # On Linux/Mac\nvenv\\Scripts\\activate     # On Windows\n```\n\n#### **Step 3: Install Dependencies**\nInstall the required libraries using `requirements.txt`:\n```bash\npip install -r requirements.txt\n```\n\n#### **Step 4: Configure Environment Variables**\nCreate a `.env` file (if it doesn’t already exist) in the project root. Add the following variables:\n```\nDB_NAME=your_database_name\nDB_USER=your_username\nDB_PASSWORD=your_password\nDB_HOST=your_host\nDB_PORT=your_port\n```\n\nReplace placeholders with your actual PostgreSQL credentials.\n\n#### **Step 5: Load Data into PostgreSQL**\nUse the `database.py` script to upload cleaned datasets to the PostgreSQL database:\n```bash\npython src/database.py\n```\nThis script:\n- Connects to the PostgreSQL database using credentials in `.env`.\n- Creates tables for items, promotions, sales, and supermarkets.\n- Loads the data from the `data/` folder into the respective tables.\n\n---\n\n### **4. Running the Code**\n\n#### **Step 1: Perform Data Cleaning**\nRun the data cleaning script to preprocess and clean the datasets:\n```bash\npython src/data_cleaning.py\n```\n\n#### **Step 2: Generate Business Insights**\nUse the `analysis.py` script to analyze branch-level sales patterns and promotion effectiveness:\n```bash\npython src/analysis.py\n```\n\n#### **Step 3: Visualize Results**\nRun the visualization script to create charts and heatmaps for promotion effectiveness and sales trends:\n```bash\npython src/visualization.py\n```\n\n#### **Step 4: Run the Main Script**\nAlternatively, you can run the `main.py` script, which combines all the steps:\n```bash\npython src/main.py\n```\n\n---\n\n### **5. Key Configuration Files**\n\n#### **requirements.txt**\nThis file lists all Python dependencies. Here’s an example:\n```\npandas\nnumpy\nmatplotlib\nseaborn\nsqlalchemy\npsycopg2-binary\npython-dotenv\n```\n\nInstall these by running:\n```bash\npip install -r requirements.txt\n```\n\n#### **.env**\nHolds sensitive credentials (e.g., database information). Example:\n```\nDB_NAME=supermarket_data\nDB_USER=admin\nDB_PASSWORD=securepassword\nDB_HOST=localhost\nDB_PORT=5432\n```\n\n---\n\n### **6. Key Features of the Code**\n\n1. **Data Cleaning**:\n   - Handles missing values, duplicates, and data type corrections.\n\n2. **Database Integration**:\n   - Uploads cleaned data into a PostgreSQL database for centralized storage and analysis.\n\n3. **Business Analysis**:\n   - Generates actionable insights, such as branch-level sales patterns and promotion effectiveness.\n\n4. **Visualization**:\n   - Provides visual insights through heatmaps, bar plots, and other charts.\n\n---\n\n### **7. Troubleshooting**\n\n1. **Dependency Issues**:\n   - Ensure you’re using the correct Python version.\n   - If errors occur during installation, update `pip`:\n     ```bash\n     pip install --upgrade pip\n     ```\n\n2. **Database Connection Errors**:\n   - Verify that the PostgreSQL server is running and the `.env` file contains the correct credentials.\n\n3. **Data File Issues**:\n   - Ensure all required CSV files are in the `data/` folder. Missing files will cause errors.\n\n---\n\n### **8. Notes for Future Development**\n1. Add year information to the sales dataset for temporal analysis.\n2. Include additional validation steps for ensuring data quality during extraction.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnel-zi%2Fdata_engineering_pretest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnel-zi%2Fdata_engineering_pretest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnel-zi%2Fdata_engineering_pretest/lists"}