Exemple #1
0
import matplotlib.pyplot as plt
from matplotlib import dates

from ODM2.services import *
from ODMconnection import dbconnection

this_file = os.path.realpath(__file__)
directory = os.path.dirname(this_file)
sys.path.insert(0, directory)


# Create a connection to the ODM2 database
# ----------------------------------------


session_factory = dbconnection.createConnection('mysql', 'jws.uwrl.usu.edu', 'odm2', 'ODM', 'ODM123!!')
#session_factory = dbconnection.createConnection('postgresql', 'localhost', 'ODM2', 'odm', 'odm')
#session_factory = dbconnection.createConnection('mysql', 'localhost', 'odm2', 'ODM', 'odm')




# Create a connection for each of the schemas. Currently the schemas each have a different
# connection but it will be changed to all the services sharing a connection
# ----------------------------------------------------------------------------------------

# session = scoped_session(session_factory)

_session = session_factory.getSession()
_engine = session_factory.engine
Exemple #2
0
this_file = os.path.realpath(__file__)
directory = os.path.dirname(this_file)
sys.path.insert(0, directory)


from ODM2.Core.services import readCore as CSread
from ODM2.Core.services import CoreServices
from ODM2.SamplingFeatures.services import readSamplingFeatures as SFread
from ODM2.Results.services import readResults as Rread

from ODMconnection import dbconnection


# create connection to the database
conn = dbconnection.createConnection("mssql", "(local)", "TestODM2", "ODM", "odm")
# conn = dbconnection.createConnection('postgresql', 'castro-server.bluezone.usu.edu', 'ODM2', 'postgres', 'postgres')

# create a connection for each of the schemas. Currently the schemas each of a different
# connection but it will be changed to all the services sharing a connection
core_read = CSread(conn)
core = CoreServices(conn)
result_read = Rread(conn)
sampfeat_read = SFread(conn)


# run some basic sample queries.
vars = core.read.getAllVariables()
print "Get all variable: ", vars
people = core_read.getAllPersons()
print "Get all People: ", people
Exemple #3
0
from ODM2.LabAnalyses.services import readLabAnalyses as LAread
from ODM2.Results.services import readResults as Rread
from ODM2.Sensors.services import readSensors as Sread
from ODM2.CV.services import readCV as CVread

from ODM2.DataQuality.model import Dataquality


from ODMconnection import dbconnection





#conn = dbconnection.createConnection('mssql', '(local)', 'TestODM2', 'ODM', 'odm')
conn = dbconnection.createConnection('postgresql', 'localhost:5432', 'TestODM2', 'postgres', 'odm')



cs = CSread(conn)
sf = SFread(conn)
dq =DQread(conn)
anno = Annoread(conn)
eq = EQread(conn)
pr = PRread(conn)
ep = EPread(conn)
ei = EIread(conn)
la = LAread(conn)
r = Rread(conn)
cv = CVread(conn)
s = Sread(conn)
Exemple #4
0
from ODM2.ExtensionProperties.services import readExtensionProperties as EPread
from ODM2.ExternalIdentifiers.services import readExternalIdentifiers as EIread
from ODM2.LabAnalyses.services import readLabAnalyses as LAread
from ODM2.Results.services import readResults as Rread
from ODM2.Sensors.services import readSensors as Sread
from ODM2.CV.services import readCV as CVread

from ODM2.DataQuality.model import Dataquality


from ODMconnection import dbconnection




conn = dbconnection.createConnection('postgresql', 'castro-server.bluezone.usu.edu', 'ODM2', 'postgres', 'postgres')


#create a connection for each of the schemas. Currently the schemas each of a different
#connection but it will be changed to all the services sharing a connection
cs = CSread(conn)
sf = SFread(conn)
dq =DQread(conn)
anno = Annoread(conn)
eq = EQread(conn)
pr = PRread(conn)
ep = EPread(conn)
ei = EIread(conn)
la = LAread(conn)
r = Rread(conn)
cv = CVread(conn)
Exemple #5
0
import os
import matplotlib.pyplot as plt
from matplotlib import dates
from ODM2.Core.services import readCore as CSread
from ODM2.Core.services import CoreServices
from ODM2.SamplingFeatures.services import readSamplingFeatures as SFread
from ODM2.Results.services import readResults as Rread
from ODMconnection import dbconnection

this_file = os.path.realpath(__file__)
directory = os.path.dirname(this_file)
sys.path.insert(0, directory)

# Create a connection to the ODM2 database
# ----------------------------------------
conn = dbconnection.createConnection('mysql', 'localhost', 'odm2', 'ODM',
                                     'ODM123!!')
#conn = dbconnection.createConnection('mysql', 'jws.uwrl.usu.edu', 'odm2', 'ODM', 'ODM123!!')
#conn = dbconnection.createConnection('mssql', '(local)', 'ODM2SS', 'ODM', 'odm')
#conn = dbconnection.createConnection('postgresql', 'arroyo.uwrl.usu.edu:5432', 'ODMSS', 'Stephanie', 'odm')
#conn = dbconnection.createConnection('mysql', '127.0.0.1:3306', 'ODM2', 'Stephanie', 'odm')

# Create a connection for each of the schemas. Currently the schemas each have a different
# connection but it will be changed to all the services sharing a connection
# ----------------------------------------------------------------------------------------
core_read = CSread(conn)
core = CoreServices(conn)
result_read = Rread(conn)
sampfeat_read = SFread(conn)

# Run some basic sample queries.
# ------------------------------
Exemple #6
0
import sys
import os

this_file = os.path.realpath(__file__)
directory = os.path.dirname(this_file)
sys.path.insert(0, directory)

from ODM2.Core.services import readCore as CSread
from ODM2.Core.services import CoreServices
from ODM2.SamplingFeatures.services import readSamplingFeatures as SFread
from ODM2.Results.services import readResults as Rread

from ODMconnection import dbconnection

#create connection to the database
conn = dbconnection.createConnection('mssql', '(local)', 'TestODM2', 'ODM',
                                     'odm')
#conn = dbconnection.createConnection('postgresql', 'castro-server.bluezone.usu.edu', 'ODM2', 'postgres', 'postgres')

#create a connection for each of the schemas. Currently the schemas each of a different
#connection but it will be changed to all the services sharing a connection
core_read = CSread(conn)
core = CoreServices(conn)
result_read = Rread(conn)
sampfeat_read = SFread(conn)

#run some basic sample queries.
vars = core.read.getAllVariables()
print "Get all variable: ", vars
people = core_read.getAllPersons()
print "Get all People: ", people
Exemple #7
0
import matplotlib.pyplot as plt
from matplotlib import dates
from ODM2.Core.services import readCore as CSread
from ODM2.Core.services import CoreServices
from ODM2.SamplingFeatures.services import readSamplingFeatures as SFread
from ODM2.Results.services import readResults as Rread
from ODMconnection import dbconnection

this_file = os.path.realpath(__file__)
directory = os.path.dirname(this_file)
sys.path.insert(0, directory)


# Create a connection to the ODM2 database
# ----------------------------------------
conn = dbconnection.createConnection('mysql', 'localhost', 'odm2', 'ODM', 'ODM123!!')
#conn = dbconnection.createConnection('mysql', 'jws.uwrl.usu.edu', 'odm2', 'ODM', 'ODM123!!')
#conn = dbconnection.createConnection('mssql', '(local)', 'ODM2SS', 'ODM', 'odm')
#conn = dbconnection.createConnection('postgresql', 'arroyo.uwrl.usu.edu:5432', 'ODMSS', 'Stephanie', 'odm')
#conn = dbconnection.createConnection('mysql', '127.0.0.1:3306', 'ODM2', 'Stephanie', 'odm')


# Create a connection for each of the schemas. Currently the schemas each have a different
# connection but it will be changed to all the services sharing a connection
# ----------------------------------------------------------------------------------------
core_read = CSread(conn)
core = CoreServices(conn)
result_read = Rread(conn)
sampfeat_read = SFread(conn)