{"id":27531225,"url":"https://github.com/richardschoen/python_dbibmiodbc","last_synced_at":"2026-04-28T23:38:02.604Z","repository":{"id":237129534,"uuid":"793870401","full_name":"richardschoen/python_dbibmiodbc","owner":"richardschoen","description":"Python IBM i ODBC Database Class and Application Subclass for Structured Business App Logic","archived":false,"fork":false,"pushed_at":"2024-04-30T03:48:57.000Z","size":41,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-03T20:39:05.839Z","etag":null,"topics":["as400","class","database","db2","fastapi","flask","ibmi","odbc","pyodbc","python","re-usability","rest-api","restful-api","wrapper"],"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/richardschoen.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":"2024-04-30T02:59:04.000Z","updated_at":"2024-04-30T03:49:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"7b041d9a-d716-4a2e-91e5-9274ab49dd2f","html_url":"https://github.com/richardschoen/python_dbibmiodbc","commit_stats":null,"previous_names":["richardschoen/python_dbibmiodbc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/richardschoen/python_dbibmiodbc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richardschoen%2Fpython_dbibmiodbc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richardschoen%2Fpython_dbibmiodbc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richardschoen%2Fpython_dbibmiodbc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richardschoen%2Fpython_dbibmiodbc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/richardschoen","download_url":"https://codeload.github.com/richardschoen/python_dbibmiodbc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richardschoen%2Fpython_dbibmiodbc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32404340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T19:38:08.556Z","status":"ssl_error","status_checked_at":"2026-04-28T19:37:55.688Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["as400","class","database","db2","fastapi","flask","ibmi","odbc","pyodbc","python","re-usability","rest-api","restful-api","wrapper"],"created_at":"2025-04-18T17:49:20.708Z","updated_at":"2026-04-28T23:38:02.576Z","avatar_url":"https://github.com/richardschoen.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python IBM i ODBC Database Access Class and Application Subclass\nThis repository contains a sample Python IBM i ODBC Database Class and an Application Subclass for creating structured business app logic that is logically separated from the core IBM i ODBC class.   \n\nThe intent of these classes is to wrap up some of the complexity of ODBC data access in Python and allow database access for IBM i via ODBC to be made easy with only a few lines of code. \n\nThere are also a couple of scripts to actually exercise the ODBC driver wrapper class and the DbApp class. The scripts can be called from a command line in QShell or PASE or run on Windows, Linux or MacOS if you have the IBM i Access ODBC driver loaded. \n\nThe scripts utilze the Python pyodbc ODBC wrapper and the IBM i Access ODBC Driver for connectivity.   \n\n## Sample Python Script Project Files\nThe database code classes should work on IBM i, Windows, Linux or MacOS as long as the IBM i Access ODBC Driver is configured and working and Python 3 and pyodbc are installed. \n\n```dbibmiodbc.py``` - This module contains a class named: DbIbmOdbc. This class is a wrapper for base ODBC database functionality without any other specific business logic. The wrapper uses pyodbc and the IBM i Access ODBC Driver for connectivity. \n  \n```dbapp.py``` - This module contains a class named: DbApp. This class inherits the DbIbmOdbc class and  should be used to create your own business specific application queries and business logic. \n\n```odbccrud_qcustcdt.py``` - This is a sample command line CLI script to exercise the DbIbmiOdbc and sample DbApp classes. The script will inert, update and delete a sample record from the QIWS.QCUSTCDT table and output the command results to the console.   \n\nThe ODBC connection string in the script is configured for a DSN of *LOCAL so the script can be run right from the IBM i system as a QShell or PASE commandl line call. It will use the current logged in user's credentials.\n \nEx call: ```python3 odbccrud_qcustcdt.py```\n\n```odbcread_qcustcdt.py ``` - This is a sample command line CLI script  exercise the DbIbmiOdbc and sample DbApp classes. The script will read all records from the QIWS.QCUSTCDT table and output the data to the command line as JSON.    \n\nThe ODBC connection string in the script is configured for a DSN of *LOCAL so the script can be run right from the IBM i system as a QShell or PASE commandl line call. It will use the current logged in user's credentials.   \n\n Ex call: ```python3 odbcread_qcustcdt.py```\n\n ```customers.sql``` - This SQL script can be used to create a table named ```QIWS.CUSTOMERS``` if you would rather use a custom table instead of using ```QIWS.QCUSTCDT```. If you do create the ```QIWS.CUSTOMERS``` table and want to use it, you will need to go through the ```DbApp.py``` file and replace everywhere is says: ```QCUSTCDT``` for the table name with ```CUSTOMERS```.\n\n## Installing the App Repository on Your IBM i System\nInstall ```unixODBC``` open source management packages.   \n\nInstall ```Python``` open source management packages if not already installed.    \n\nInstall ```pyodbc``` pip module:  ```pip3 install pyodbc```   \n\nClone the repository on your IBM i system from an SSH, QShell or PASE terminal window.  \n```\ncd /\ngit clone https://github.com/richardschoen/python_dbibmiodbc.git  \n```\n\nRun the sample scripts\n```\ncd /python_dbibmiodbc\npython3 odbcread_qcustcdt.py\npython3 odbccrud_qcustcdt.py\n```\n\n ## Using the Database Classes in Your Own Python Projects\nThe only files needed to use the database classes in your own projects are: ```dbibmiodbc.py``` and ```dbapp.py```.\n\nThe classes should work fine with command line apps, Flask apps, FastAPI apps or other apps where database access to an IBM i is needed.    \n\nI'm not sure about using this class with the Django web framework, but if Django can utilize custom database call frameworks then it should work. I will test with Django at some point but that's not the main framework I use for Python web development. \n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frichardschoen%2Fpython_dbibmiodbc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frichardschoen%2Fpython_dbibmiodbc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frichardschoen%2Fpython_dbibmiodbc/lists"}