Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
common-package
Manage
Activity
Members
Labels
Plan
Issues
4
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GSHS Utilities
common-package
Commits
e682aee5
Commit
e682aee5
authored
8 months ago
by
Grant
Browse files
Options
Downloads
Patches
Plain Diff
update it
parent
c43695e9
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Pipfile
+1
-1
1 addition, 1 deletion
Pipfile
src/common/mixins/multiple.py
+24
-0
24 additions, 0 deletions
src/common/mixins/multiple.py
src/pyproject.toml
+0
-46
0 additions, 46 deletions
src/pyproject.toml
with
25 additions
and
47 deletions
Pipfile
+
1
−
1
View file @
e682aee5
...
...
@@ -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
=
"*"
...
...
This diff is collapsed.
Click to expand it.
src/common/mixins/multiple.py
+
24
−
0
View file @
e682aee5
...
...
@@ -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
()
This diff is collapsed.
Click to expand it.
src/pyproject.toml
deleted
100644 → 0
+
0
−
46
View file @
c43695e9
[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'
]
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment