{"id":28816721,"url":"https://github.com/pymetheus/sqlalchemy-dbtoolkit","last_synced_at":"2026-04-11T19:32:38.370Z","repository":{"id":299811343,"uuid":"1003741591","full_name":"Pymetheus/sqlalchemy-dbtoolkit","owner":"Pymetheus","description":"Modular toolkit for SQLAlchemy-based database configuration and session management.","archived":false,"fork":false,"pushed_at":"2025-06-18T11:46:23.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-18T12:47:29.916Z","etag":null,"topics":["data-engineering","data-pipeline","database","mysql","orm","postgresql","python","sqlalchemy","sqlite","toolkit"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Pymetheus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"docs/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"docs/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-17T15:41:53.000Z","updated_at":"2025-06-18T11:46:26.000Z","dependencies_parsed_at":"2025-06-18T12:47:34.249Z","dependency_job_id":"9fc4e3fe-6f1b-4019-8fb2-060c6c6d13ad","html_url":"https://github.com/Pymetheus/sqlalchemy-dbtoolkit","commit_stats":null,"previous_names":["pymetheus/sqlalchemy-dbtoolkit"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Pymetheus/sqlalchemy-dbtoolkit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pymetheus%2Fsqlalchemy-dbtoolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pymetheus%2Fsqlalchemy-dbtoolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pymetheus%2Fsqlalchemy-dbtoolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pymetheus%2Fsqlalchemy-dbtoolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pymetheus","download_url":"https://codeload.github.com/Pymetheus/sqlalchemy-dbtoolkit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pymetheus%2Fsqlalchemy-dbtoolkit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260595745,"owners_count":23033789,"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-engineering","data-pipeline","database","mysql","orm","postgresql","python","sqlalchemy","sqlite","toolkit"],"created_at":"2025-06-18T17:06:38.961Z","updated_at":"2025-12-30T22:30:23.341Z","avatar_url":"https://github.com/Pymetheus.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SQLAlchemy Database Toolkit\n\n**A modular toolkit for building, configuring, and managing databases using [SQLAlchemy](https://www.sqlalchemy.org)**\n\nThe SQLAlchemy Database Toolkit simplifies the setup and management across different relational databases.  \nCurrently, it handles configuration loading, engine creation, ORM base registration, session management and CRUD operations.\nIt provides an extensible foundation for rapid database development, prototyping, and integration into data pipelines or applications.  \n\nSupported DBMS under current version:\n- **MySQL**\n- **PostgreSQL**\n- **SQLite**\n\n\n## Table of Contents\n\n- [Requirements](#requirements)\n- [Getting started](#getting-started)\n  - [Installation](#installation)\n  - [Configuration](#configuration)\n  - [Usage](#usage)\n- [Roadmap](#roadmap)\n- [Contributing](#contributing)\n- [License](#license)\n\n\n## Requirements\n\nList of software, libraries, and tools needed to run the project:\n- python \u003e= 3.8\n- sqlalchemy \u003e= 2.0\n- mysql-connector-python \u003e= 9.3.0\n- psycopg2 \u003e= 2.9.0\n- pandas \u003e= 2.2.0\n\n\n## Getting started\n\nFollow the instructions below to set up the project on a local machine.\n\n\n### Installation\n\n1. Install directly from GitHub using pip:   \n```bash\npip install git+https://github.com/pymetheus/sqlalchemy-dbtoolkit.git\n```\n2. Install dependencies:\n\n```bash\npip install -r dep/requirements.txt\n```\n\n\n### Configuration\n\nThe toolkit loads database credentials and paths from the **config.ini** file:  \nPopulate and rename **your_config.ini** in **.config/**\n\n```ini\n[mysql]  \nuser = root  \npassword = password  \nhost = localhost  \nport = 3306  \n\n[postgresql]\nuser = postgres  \npassword = password  \nhost = localhost  \nport = 5432 \n\n[sqlite]  \nsqlite_path = /path/to/sqlite/databases  \n```\n\n\n### Usage\n\nEngine Factory Example:\n```python\nfrom sqlalchemy_dbtoolkit.engine.factory import AlchemyEngineFactory  \n\nengine = AlchemyEngineFactory(dbms='mysql', db_name='analytics_db', config_path='../.config/config.ini').engine\n```\n\nORM Table Management Example:\n```python\nfrom sqlalchemy_dbtoolkit.orm.base import ORMBaseManager\nfrom sqlalchemy import Column, Integer, String\n\nTableManager = ORMBaseManager(engine)\nBase = TableManager.Base\n\nclass YourTable(Base):\n    __tablename__ = 'your_table'\n    id = Column(Integer, primary_key=True)\n    column_1 = Column(String(length=255), nullable=False)\n    column_2 = Column(Integer)\n\nTableManager.create_tables()\n```\n\nORM Session Insert Example:\n```python\nfrom sqlalchemy_dbtoolkit.query.create import InsertManager\n\ninserter = InsertManager(engine)\ninserter.add_row(YourTable, {'column_1': 'value', 'column_2': 42})\n```\n\nORM Session Select Example:\n```python\nfrom sqlalchemy_dbtoolkit.query.read import SelectManager\nselector = SelectManager(engine)\nselection = selector.select_one_by_column(Table=YourTable, column_name='column_1', column_value='value', operator_name='eq')\n```\n\nORM Session Update Example:\n```python\nfrom sqlalchemy_dbtoolkit.query.update import UpdateManager\nupdater = UpdateManager(engine)\nupdates = {'column_2': 43}\nupdated_rows = updater.update_rows(Table=YourTable, column_name='column_1', column_value='value', update_dict=updates, operator_name='eq')\n```\n\nORM Session Delete Example:\n```python\nfrom sqlalchemy_dbtoolkit.query.delete import DeleteManager\ndeleter = DeleteManager(engine)\ndeleted_rows = deleter.delete_rows_by_filter(Table=YourTable, column_name='column_1', column_value='value', operator_name='eq')\n```\n\nInspector Example:\n```python\nfrom sqlalchemy_dbtoolkit.core.inspector import InspectionManager\nInspector = InspectionManager(engine)\ntable_names = Inspector.get_table_names()\nfor table in table_names:\n    table_columns = Inspector.get_columns(table)\n```\n\n\n## Roadmap\n\n- [ ] Pandas Integration: Enable conversion between database queries and pandas DataFrames for analysis and data manipulation  \n- [X] Full CRUD Support: Expand the query layer to include read, update, and delete operations  \n- [ ] SQLAlchemy Core Support: Provide additional utilities to support low-level, fine-grained database interactions  \n- [ ] Integrated Logging: Add structured logging across all components to improve debugging  \n- [ ] Integrate DBMSs: Include support for additional DBMS like mariadb, mssql and oracle\n\n\n## Contributing\n\nContributions to this project are welcome! If you would like to contribute, please open an issue to discuss potential changes or submit a pull request.\nFor more details please visit the [contributing page](docs/CONTRIBUTING.md).\n\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE.md). You are free to use, modify, and distribute this code as permitted by the license.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpymetheus%2Fsqlalchemy-dbtoolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpymetheus%2Fsqlalchemy-dbtoolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpymetheus%2Fsqlalchemy-dbtoolkit/lists"}