Skip to content

psrc/psrcelmerpy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

psrcelmerpy:

make database connections easier

Installation

Install with:

pip install git+https://github.com/psrc/psrcelmerpy.git

Examples

Establish a connection to Elmer

import psrcelmerpy
e_conn = psrcelmerpy.ElmerConn()

Establish a connection to ElmerGeo

import psrcelmerpy
eg_conn = psrcelmerpy.ElmerGeoConn()

Retrieve a Table from Elmer (and view the results)

e_conn = psrcelmerpy.ElmerConn()
df = e_conn.get_table(schema='ofm', table_name='publication_dim')
print(df)

Run an ad-hoc query in Elmer

df_count = e_conn.get_query('select count(*) as rec_count from ofm.publication_dim')
print(df_count)

Retrieve a geodataframe based on a feature class from ElmerGeo

In this example we are using layer "micen" (Manufacturing/Industrial Centers)

eg_conn = psrcelmerpy.ElmerGeoConn()
gdf = eg_conn.read_geolayer('micen')

List all the feature classes available in ElmerGeo:

eg_conn = psrcelmerpy.ElmerGeoConn()
f_classes = eg_conn.list_feature_classes()

About

Tools for accessing Elmer in Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages