{"id":27390164,"url":"https://github.com/yankh764/revenue-data-analysis","last_synced_at":"2026-04-30T14:34:55.729Z","repository":{"id":287721468,"uuid":"965553027","full_name":"yankh764/revenue-data-analysis","owner":"yankh764","description":"A take home assignment of improving a revenue data pipeline","archived":false,"fork":false,"pushed_at":"2025-04-13T14:11:18.000Z","size":1203,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-13T15:24:43.023Z","etag":null,"topics":["data-analysis","docker","python","sql","take-home-assignment"],"latest_commit_sha":null,"homepage":"","language":"Python","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/yankh764.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,"zenodo":null}},"created_at":"2025-04-13T12:21:00.000Z","updated_at":"2025-04-13T14:11:21.000Z","dependencies_parsed_at":"2025-04-13T15:24:49.714Z","dependency_job_id":"b58e3287-ad1b-44c5-8367-bf4351e0e995","html_url":"https://github.com/yankh764/revenue-data-analysis","commit_stats":null,"previous_names":["yankh764/revenue-data-analysis"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yankh764%2Frevenue-data-analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yankh764%2Frevenue-data-analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yankh764%2Frevenue-data-analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yankh764%2Frevenue-data-analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yankh764","download_url":"https://codeload.github.com/yankh764/revenue-data-analysis/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248769746,"owners_count":21158862,"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":["data-analysis","docker","python","sql","take-home-assignment"],"created_at":"2025-04-13T19:39:11.873Z","updated_at":"2026-04-30T14:34:55.723Z","avatar_url":"https://github.com/yankh764.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Revenue Data Analysis\nThis repository contains a data analysis solution for understanding revenue attribution issues in a billing system. \nThe project analyzes invoice, position, and customer data to identify discrepancies and propose improvements to the existing data pipeline.\n\n## Setup Instructions\n### Prerequisites\n- Docker\n- Python 3.8+\n- Git\n\n### Getting Started\n1. Clone the repository:\n```bash\ngit clone https://github.com/yankh764/revenue-data-analysis\ncd revenue-data-analysis\n```\n\n2. Create and activate a virtual environment:\n```bash\npython -m venv venv\n# Activate on macOS/Linux\nsource venv/bin/activate\n```\n\n3. Install the required Python packages:\n```bash\npip install -r requirements.txt\n```\n\n4. Create an `.env` file based on the provided `.env.example`:\n```bash\ncp .env.example .env\n```\n\n### Database Setup\n1. Pull and run the Microsoft SQL Server Docker image:\n```bash\ndocker pull mcr.microsoft.com/mssql/server:latest\ndocker run -v ./sql:/sql -e \"ACCEPT_EULA=Y\" -e \"SA_PASSWORD=SimplePassword123\" \\\n   -p 1433:1433 --name sql1 --hostname sql1 \\\n   -d mcr.microsoft.com/mssql/server:latest\n```\n\n2. Create the database and required tables:\n```bash\ndocker exec -it sql1 /opt/mssql-tools18/bin/sqlcmd -C \\\n   -S localhost -U sa -P SimplePassword123 -i /sql/schema.sql\n```\n\nAlternatively, you can use a database management tool like Azure Data Studio to execute the SQL script.\n\n### Data Loading\nWith your virtual environment activated and database set up, run the data loader script to populate the database with the sample data:\n```bash\npython -m scripts.data_loader\n```\n\nThis script will read the CSV files from the `data` directory and load them into the corresponding tables in the database.\n\n\n### Running the Analysis Queries\nTo run the analysis queries against your database:\n```bash\ndocker exec -it sql1 /opt/mssql-tools18/bin/sqlcmd -C \\\n   -S localhost -U sa -P SimplePassword123 -i /sql/analysis.sql\n```\n\nYou can also run individual queries from the analysis.sql file using your preferred database client.\n\n## Project Structure\n```\nrevenue-data-analysis/\n├── docs                       # Documentation files for analysis and enhancement proposals\n│   ├── analysis_findings.md   # Data analysis findings\n│   ├── pipeline_proposal.md   # Enhanced data pipeline proposal\n│   └── modern_tooling.md      # Modern tooling proposal (optional)\n├── data                       # Source CSV files (mock data)\n│   ├── customers.csv          # Customer information\n│   ├── invoices.csv           # Invoice data\n│   └── positions.csv          # Invoice line items\n├── scripts                    # Python scripts\n│   ├── __init__.py\n│   ├── data_loader.py         # Script for loading data into database\n│   ├── data_quality.py        # Script for checking and reporting data quality (proposal)\n│   └── data_validator.py      # Script for simple preprocessing and data validation (proposal)\n├── sql                        # SQL scripts\n│   ├── schema.sql             # Database schema definition\n│   ├── analysis.sql           # Data analysis queries\n│   ├── quality.sql            # Data quality table (proposal)\n│   └── view.sql               # Data report view (proposal)\n├── requirements.txt           # Python dependencies\n└── .env.example               # Template for required environment variables (DB credenitals)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyankh764%2Frevenue-data-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyankh764%2Frevenue-data-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyankh764%2Frevenue-data-analysis/lists"}