Skip to main content

Python library to read-write HEC-DSS database file

Project description

About pydsstools

pydsstools is a Cython based Python library to manipulate HEC-DSS database file. It supports regular/irregular time-series, paired data series and spatial grid records. It is compatible with 64-bit Python on Windows 10 and Ubuntu like linux distributions. For the later, zlib, math, quadmath, and gfortran libraries must be installed. dssvue python library provides graphical user interface for HEC-DSS. There is also a Rust binding hecdss for HEC-DSS.

About HEC-DSS [1]

HEC-DSS is designed to be optimal for storing and retrieving large sets, or series, of data. HEC-DSS is not a relational database, but a database that is designed to retrieve and store large amounts of data quickly that are not necessarily interlinked to other sets of data, like relational databases are. Additionally, HEC-DSS provides a flexible set of utility programs and is easy to add to a user's application program. These are the features that distinguish HEC-DSS from most commercial relational database programs and make it optimal for scientific applications.

HEC-DSS uses a block of sequential data as the basic unit of storage. Each block contains a series of values of a single variable over a time span appropriate for most applications. The basic concept underlying HEC-DSS is the organization of data into records of continuous, applications-related elements as opposed to individually addressable data items. This approach is more efficient for scientific applications than a relational database system because it avoids the processing and storage overhead required to assemble an equivalent record from a relational database.

Data is stored in blocks, or records, within a file and each record is identified by a unique name called a "pathname." Each time data is stored or retrieved from the file, its pathname is used to access its data. Information about the record (e.g., units) is stored in a "header array." This includes the name of the program writing the data, the number of times the data has been written to, and the last written date and time. HEC-DSS documents stored data completely via information contained in the pathname and stored in the header so no additional information is required to identify it. One data set is not directly related to another so there is no need to update other areas of the database when a new data set is stored. The self-documenting nature of the database allows information to be recognized and understood months or years after it was stored.

Because of the self-documenting nature of the pathname and the conventions adopted, there is no need for a data dictionary or data definition file as required with other database systems. In fact, there are no database creation tasks or any database setup. Both HEC-DSS utility programs and applications that use HEC-DSS will generate and configure HEC-DSS database files automatically. There is also no pre-allocation of space; the software automatically expands the file size as needed.

HEC-DSS references data sets, or records, by their pathnames. A pathname may consist of up to 391 characters and is, by convention, separated into six parts, which may be up to 64 characters each. Each part is delimited by a slashe "/", and is labeled "A" through "F", as follows: /A/B/C/D/E/F/.

A list of the pathnames in a DSS file is called a "catalog." In version 6, the catalog was a separate file; in version 7, the catalog is constructed directly from pathnames in the file.

Multi-user access mode is handled automatically by HEC-DSS. The user does not need to do anything to turn it on. Multi-user access allows multiple users, multiple processes, to read and write to the same HEC-DSS file at the same time. This is true for a network drive as well as a local drive. You can have a shared network HEC-DSS file that has several processes reading and writing to it at the same time. The only drawback is that file access may be slower, depending on the operating system.

  1. USACE, Hydrologic Engineering Center (July, 2019). HEC Data Storage System Guide (Draft).

Changes

changelog

Documentation

📖 The full documentation (generated with Sphinx) will be published soon.
In the meantime, please refer to the examples and the changelog for usage details and updates.

Build from source

Download the source files, open the command prompt in the root directory, and enter the following command. Note that the command prompt must be setup with build tools and python environment.

python -m build 

Installation from PyPI

pip install pydsstools

Contributing

All contributions, bug reports, bug fixes, documentation improvements, enhancements and ideas are welcome. Feel free to ask questions on my email.

License

This program is a free software: you can modify and/or redistribute it under MIT license.

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

pydsstools-3.0.0b2.tar.gz (8.2 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pydsstools-3.0.0b2-cp311-cp311-win_amd64.whl (9.4 MB view details)

Uploaded CPython 3.11Windows x86-64

pydsstools-3.0.0b2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

File details

Details for the file pydsstools-3.0.0b2.tar.gz.

File metadata

  • Download URL: pydsstools-3.0.0b2.tar.gz
  • Upload date:
  • Size: 8.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pydsstools-3.0.0b2.tar.gz
Algorithm Hash digest
SHA256 8a134d70e68e1a46bfe12187b1710a15141559dac677777f330b2d9ef9f199eb
MD5 1948d81fde0c44832b0aae992bc56133
BLAKE2b-256 36de102d3f42ff07535c6070222ff87c8b9aa2dc6ffe950609ec3042fbffa7bf

See more details on using hashes here.

File details

Details for the file pydsstools-3.0.0b2-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for pydsstools-3.0.0b2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 fc10116039e7bdc48f1b59d37fee1e94746ad47d234c95c89d8990ae6a67c964
MD5 21ae86701c1466b383dd0002d505d719
BLAKE2b-256 7215dc8418faee48dd34897b7307879ff25772a35fd4a2ea611c3982df0220dc

See more details on using hashes here.

File details

Details for the file pydsstools-3.0.0b2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pydsstools-3.0.0b2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 262a02cfaf8a37f4ccbdf0751c09e364fbb5b5a15dffb0eae5279bd7596abf8b
MD5 1694d8b4c8dfd404d7d27636e5932dfc
BLAKE2b-256 ebb5e03b59cfe11a0825750b574f7f4d0e38780e542acf07e75149f68bbfd703

See more details on using hashes here.

Supported by

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