Loading Pipfile +1 −1 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ verify_ssl = true name = "pypi" [packages] common = {editable = true, path = "./src"} common = {editable = true, path = "./src", extras = ["all"]} [dev-packages] pytest = "*" Loading src/common/mixins/multiple.py +24 −0 Original line number Diff line number Diff line Loading @@ -129,3 +129,27 @@ class MultiDatabase: ] for future in futures: future.result() # this will raise an exception if any op fails, may want to catch and report if __name__ == "__main__": db_1 = { "type": "postgres", "id": "vadb-harpua", "PG_DATABASE": "vadb", "PG_USER": "varo", "PG_PASSWORD": "CorrectStapleBatteryHorse1234", "PG_HOST": "harpua.ornl.gov", "PG_PORT": "5432", } db_2 = { "type": "postgres", "id": "vadb-edh01", "PG_DATABASE": "vadb", "PG_USER": "varo", "PG_PASSWORD": "CorrectStapleBatteryHorse1234", "PG_HOST": "edh01.ornl.gov", "PG_PORT": "5432", } mdb = MultiDatabase(configs=[db_1, db_2]) mdb.databases["vadb-harpua"].open() mdb.databases["vadb-edh01"].open() src/pyproject.tomldeleted 100644 → 0 +0 −46 Original line number Diff line number Diff line [build-system] requires = [ "cffi==1.16.0", "setuptools==68.2.2", "wheel==0.41.2" ] build-backend = "setuptools.build_meta" [project] name = "common_package" authors = [ {name = "Jonathan Huihui", email = "huihuijk@ornl.gov"}, {name = "Josh Grant", email = "grantjn@ornl.gov"} ] # update version information here version = "0.3.1" description = "Package to perform everyday tasks - logging, accessing database, etc." readme = "README.md" requires-python = ">=3.9" keywords = ["mixins", "logging", "database", "mysqlmixin", "postgresmixin", "pandasmixin"] license = {file = "LICENSE"} classifiers = [ "Intended Audience :: Developers", "Programming Language :: Python", "Topic :: Software Development :: Build Tools" ] dependencies = [ "rich==10.11.0", "pandas==2.1.4", "SQLAlchemy~=2.0.23" ] [project.optional-dependencies] postgres = ["psycopg2-binary==2.9.9"] mssql = ["pymssql==2.2.11"] all = ["psycopg2-binary==2.9.9", "pymssql==2.2.11"] [project.urls] Source = "https://code.ornl.gov/nset-utilities/common-package" [tool.setuptools.packages.find] where = [] include = ['common', 'common.mixins'] Loading
Pipfile +1 −1 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ verify_ssl = true name = "pypi" [packages] common = {editable = true, path = "./src"} common = {editable = true, path = "./src", extras = ["all"]} [dev-packages] pytest = "*" Loading
src/common/mixins/multiple.py +24 −0 Original line number Diff line number Diff line Loading @@ -129,3 +129,27 @@ class MultiDatabase: ] for future in futures: future.result() # this will raise an exception if any op fails, may want to catch and report if __name__ == "__main__": db_1 = { "type": "postgres", "id": "vadb-harpua", "PG_DATABASE": "vadb", "PG_USER": "varo", "PG_PASSWORD": "CorrectStapleBatteryHorse1234", "PG_HOST": "harpua.ornl.gov", "PG_PORT": "5432", } db_2 = { "type": "postgres", "id": "vadb-edh01", "PG_DATABASE": "vadb", "PG_USER": "varo", "PG_PASSWORD": "CorrectStapleBatteryHorse1234", "PG_HOST": "edh01.ornl.gov", "PG_PORT": "5432", } mdb = MultiDatabase(configs=[db_1, db_2]) mdb.databases["vadb-harpua"].open() mdb.databases["vadb-edh01"].open()
src/pyproject.tomldeleted 100644 → 0 +0 −46 Original line number Diff line number Diff line [build-system] requires = [ "cffi==1.16.0", "setuptools==68.2.2", "wheel==0.41.2" ] build-backend = "setuptools.build_meta" [project] name = "common_package" authors = [ {name = "Jonathan Huihui", email = "huihuijk@ornl.gov"}, {name = "Josh Grant", email = "grantjn@ornl.gov"} ] # update version information here version = "0.3.1" description = "Package to perform everyday tasks - logging, accessing database, etc." readme = "README.md" requires-python = ">=3.9" keywords = ["mixins", "logging", "database", "mysqlmixin", "postgresmixin", "pandasmixin"] license = {file = "LICENSE"} classifiers = [ "Intended Audience :: Developers", "Programming Language :: Python", "Topic :: Software Development :: Build Tools" ] dependencies = [ "rich==10.11.0", "pandas==2.1.4", "SQLAlchemy~=2.0.23" ] [project.optional-dependencies] postgres = ["psycopg2-binary==2.9.9"] mssql = ["pymssql==2.2.11"] all = ["psycopg2-binary==2.9.9", "pymssql==2.2.11"] [project.urls] Source = "https://code.ornl.gov/nset-utilities/common-package" [tool.setuptools.packages.find] where = [] include = ['common', 'common.mixins']