Skip to main content

Functions to extract data from Hydstra

Project description

pyhydllp is a package that contains many Python functions for extracting data from Hydstra.

Installation

Install via pip:

pip install pyhydllp

Or conda:

conda install -c mullenkamp pyhydllp

Requirements

At a minimum to access the base functions, pyhydllp requires a 32bit python installation and the Pandas package.

To access the MSSQL functionality, the pdsql package is required:

conda install -c mullenkamp pdsql

Usage

Most functions can be accessed and initialized from the hyd class:

from pyhydllp import hyd

ini_path = r'\\fileservices02\ManagedShares\Data\Hydstra\prod\hyd'
dll_path = r'\\fileservices02\ManagedShares\Data\Hydstra\prod\hyd\sys\run'
username = ''
password = ''
hydllp_filename = 'hydllp.dll'
hyaccess_filename = 'Hyaccess.ini'
hyconfig_filename = 'HYCONFIG.INI'

hyd1 = hyd(ini_path, dll_path, hydllp_filename=hydllp_filename,
           hyaccess_filename=hyaccess_filename, hyconfig_filename=hyconfig_filename,
           username=username, password=password)

Then all of the functions can be accessed via the newly initiated hyd1 object. The following example won’t work outside of ECan:

sites = [70105, 69607]
varfrom = 100 # the 100 code is water level
varto = 140 # the 140 code is flow
from_mod_date = '2018-01-01'
to_mod_date = '2018-03-26'

sites_var = hyd1.get_variable_list(sites)

print(sites_var)

ch1 = hyd1.ts_data_changes(varto=[varfrom], sites=sites, from_mod_date=from_mod_date,
                           to_mod_date=to_mod_date)
print(ch1)

tsdata = hyd1.get_ts_data(sites=sites, start=from_mod_date, end=to_mod_date, varfrom=varfrom, varto=varto)

print(tsdata)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyhydllp-1.0.9.tar.gz (19.7 kB view details)

Uploaded Source

File details

Details for the file pyhydllp-1.0.9.tar.gz.

File metadata

  • Download URL: pyhydllp-1.0.9.tar.gz
  • Upload date:
  • Size: 19.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.6

File hashes

Hashes for pyhydllp-1.0.9.tar.gz
Algorithm Hash digest
SHA256 7915d1f99030b937cfdcc82ead5e6116f8b5ea84b6dde6e0883090f9bfd3d9f7
MD5 bf8c1987b7044ba710669c578e483b03
BLAKE2b-256 7bf42de19e3d09f26a35877bcfee8de955ce13a667921a85924de5efabf77323

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page