{"id":34968186,"url":"https://github.com/dlutton/csv-to-mysql-project","last_synced_at":"2025-12-26T23:26:15.181Z","repository":{"id":320808362,"uuid":"1075011572","full_name":"dlutton/csv-to-mysql-project","owner":"dlutton","description":"SWENG 480 CSV to MySQL","archived":false,"fork":false,"pushed_at":"2025-10-14T02:01:02.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-26T02:45:28.394Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/dlutton.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-12T22:22:16.000Z","updated_at":"2025-10-14T02:01:06.000Z","dependencies_parsed_at":"2025-10-26T02:45:30.771Z","dependency_job_id":"e1f5082b-cd2c-40a3-8e3e-35b650922519","html_url":"https://github.com/dlutton/csv-to-mysql-project","commit_stats":null,"previous_names":["dlutton/csv-to-mysql-project"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/dlutton/csv-to-mysql-project","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlutton%2Fcsv-to-mysql-project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlutton%2Fcsv-to-mysql-project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlutton%2Fcsv-to-mysql-project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlutton%2Fcsv-to-mysql-project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dlutton","download_url":"https://codeload.github.com/dlutton/csv-to-mysql-project/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlutton%2Fcsv-to-mysql-project/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28064598,"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","status":"online","status_checked_at":"2025-12-26T02:00:06.189Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-12-26T23:26:10.093Z","updated_at":"2025-12-26T23:26:15.176Z","avatar_url":"https://github.com/dlutton.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cannabinoids Database Project\n\nThis project is a Python backend service to manage cannabinoid data with MySQL, using Docker for easy setup. It reads a CSV file, inserts data into a MySQL database, and allows you to manage the database with Adminer.\n\n---\n\n## Project Structure\n\n```bash\n.\n├── backend/\n│ ├── data/\n│ │ └── cannabinoids.csv\n│ ├── app.py\n│ ├── requirements.txt\n│ └── ...\n├── docker-compose.yml\n├── .env\n└── README.md\n```\n\n---\n\n## Prerequisites\n\n- [Docker](https://www.docker.com/get-started)\n- [Docker Compose](https://docs.docker.com/compose/install/)\n\n---\n\n## Setup\n\n1.**Clone the repository**\n\n```bash\ngit clone \u003cyour-repo-url\u003e\ncd \u003cyour-repo-name\u003e\n```\n\n2.**Create a .env file in the root directory:**\n\n```bash\nDB_ROOT_PASSWORD=rootpassword\nDB_NAME=mydatabase\nDB_USER=myuser\nDB_PASSWORD=mypassword\nDB_PORT=330\n```\n\n⚠️ Keep .env secret; do not commit it to Git.\n\n3.**Place your CSV file in backend/data/cannabinoids.csv**\n\n## Running with Docker\n\nBuild and start containers\n\n```bash\ndocker-compose up --build\n```\n\nThis will:\n\nStart a MySQL database container (db)\n\nStart the Python backend container (python_backend)\n\nWait for the database to be ready\n\nRun Alembic migrations automatically\n\nRead the CSV and insert rows into the database\n\n---\n\n## Stop and remove containers\n\n```bash\ndocker-compose down\n```\n\n## Rebuild containers\n\nIf you make changes to code or dependencies:\n\n```bash\ndocker-compose up --build --force-recreate\n```\n\n---\n\n## Adminer Web Interface\n\nAdminer is included for easy database management.\n\nOpen your browser: http://localhost:8080\n\nLogin using credentials from your .env file:\n\n```bash\nSystem: MySQL\nServer: db\nUsername: myuser\nPassword: mypassword\nDatabase: cannabinoids_db\n```\n\n---\n\n## Example Logs when executed successfully\n\n```bash\npython_backend  | Connecting to MySQL database at db:3306 as myuser\npython_backend  | Waiting for database... ((pymysql.err.OperationalError) (2003, \"Can't connect to MySQL server on 'db' ([Errno 111] Connection refused)\")\npython_backend  | (Background on this error at: https://sqlalche.me/e/20/e3q8))\npython_backend  | ✅ Database is ready\npython_backend  | INFO  [alembic.runtime.migration] Context impl MySQLImpl.\npython_backend  | INFO  [alembic.runtime.migration] Will assume non-transactional DDL.\npython_backend  | ✅ Database is ready!\npython_backend  | Read 25 rows from CSV.\npython_backend  | ✅ Inserted 25 rows into cannabinoids table.\npython_backend  | cannabinoids rows: 25\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdlutton%2Fcsv-to-mysql-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdlutton%2Fcsv-to-mysql-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdlutton%2Fcsv-to-mysql-project/lists"}