Skip to main content

stormsewer

Storm sewer hydrology and hydraulics for Python: Rational method, Manning, standard-step HGL/EGL backwater, and HEC-22 inlets. The same Rust engine that powers the StormSewer desktop app, exposed as a native extension — no Python dependencies, no server.

pip install stormsewer

Primitives

Float in, float out. Useful for replacing a spreadsheet column.

import stormsewer as ss

ss.intensity(60, 10, 0.8, 12)          # IDF: i = a/(t+b)^c  ->  5.0607 in/hr
ss.rational_q(0.70, 5.0607, 1.0)       # Q = C i A           ->  3.5425 cfs
ss.manning_capacity(1.25, 0.013, 0.005)  # just-full capacity ->  4.5801 cfs
ss.normal_depth(3.5425, 1.25, 0.013, 0.005)  # -> 0.8254 ft (None if it won't fit)
ss.critical_depth(3.5425, 1.25)
ss.circular_geometry(1.25, 0.8254)
# {'area': 0.8597, 'wetted_perimeter': ..., 'hydraulic_radius': ..., 'top_width': ...}

Pass si=True for metric: the Manning factor becomes 1.0 and g becomes 9.81.

ss.manning_capacity(0.4, 0.013, 0.005, si=True)   # m3/s

Whole networks

import stormsewer as ss
import pandas as pd

result = ss.analyze_project(ss.demo_project_json())

pipes = pd.DataFrame(result["pipes"])
print(pipes[["id", "design_q", "capacity", "pct_full", "velocity", "hgl_up"]])

nodes = pd.DataFrame(result["nodes"])
print(nodes[nodes.floods])          # anything surcharging to the surface

analyze_file("project.ssproj") reads a file saved by the desktop app, and analyze_ssn(text) takes the plain-text network format:

ss.analyze_ssn("""
IDF        60 10 0.8
TAILWATER  100.5
MINTC      10

NODE N1   inlet    0    0  104.0  110.0  1.0  0.70  12
NODE OUT  outfall  300  0  102.5  108.5

PIPE P1   N1  OUT  300  1.25  0.013
""")

Each pipe dict carries id, from, to, slope, total_ca, tc, travel_time, intensity, design_q, capacity, pct_full, velocity, normal_depth, critical_depth, hgl_up, hgl_dn, and surcharged. Each node dict carries id, tc, rim, hgl, freeboard, and floods.

Constants

K_MANNING_US (1.49), K_MANNING_SI (1.0), G_US (32.2), G_SI (9.81).

StormSewer uses K = 1.49, matching FHWA HDS-5 and HEC-22 rather than the 1.486 some spreadsheets use — a 0.27% difference in capacity. See VALIDATION.md, which works every number on a reference network by hand.

What this is not

It computes the published equations; it does not decide whether the Rational method suits your site, what C to use, or which storm to design for. Those stay with the engineer sealing the drawing.

License

GPL-3.0-or-later, like the rest of StormSewer.

Download files

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

Source Distribution

stormsewer-0.9.4.tar.gz (500.9 kB view details)

Uploaded Source

Built Distributions

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

stormsewer-0.9.4-cp39-abi3-win_amd64.whl (265.8 kB view details)

Uploaded CPython 3.9+Windows x86-64

stormsewer-0.9.4-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (411.5 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

stormsewer-0.9.4-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (708.6 kB view details)

Uploaded CPython 3.9+macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

File details

Details for the file stormsewer-0.9.4.tar.gz.

File metadata

  • Download URL: stormsewer-0.9.4.tar.gz
  • Upload date:
  • Size: 500.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.15.0

File hashes

Hashes for stormsewer-0.9.4.tar.gz
Algorithm Hash digest
SHA256 457e9b1f53c20af90bb0eacb4fcc68313e6ed95c14ab9d488f5206d85b9200ef
MD5 4c343c8cdfbedfba91396113e53d8b10
BLAKE2b-256 df4f87920e803ace8e62ed1793ab3b5cd6e09249994881c094f5a61ede7e9aea

See more details on using hashes here.

File details

Details for the file stormsewer-0.9.4-cp39-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for stormsewer-0.9.4-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 61f2814845e892b9edb948d6e4e6c622dc0b45aa5e7a066c223f8a07fa4112b3
MD5 2ff1b1a99c0229ec98127336dc03da51
BLAKE2b-256 43c158f2b3389a48f182d9c74c2f8154ebcc51708dec8c8f5f4fa4e0943154ed

See more details on using hashes here.

File details

Details for the file stormsewer-0.9.4-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for stormsewer-0.9.4-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f061c8239ba0e5dd602b5600820b1c7b2a6e9906669dc3f0e84e1de2d628122f
MD5 613e88a86ae3f344686a9a026cfc2b5f
BLAKE2b-256 7c551e743ebc9f54fb1e4569100d3507ecce3a766034035f824f3ffaf610bb2a

See more details on using hashes here.

File details

Details for the file stormsewer-0.9.4-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for stormsewer-0.9.4-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 1795ff783bb5b04c6c13ff8c378be6fe62579ef34f27ffbfdd7d814cb522d8c2
MD5 cc67259087411016aa5723b20c3c417b
BLAKE2b-256 1e947a0281f5a1fcaceec7d243bd4cb0dd78adf0d97eff3acdb5e33910abe226

See more details on using hashes here.

Release history Release notifications | RSS feed

0.9.7

4 files

0.9.5

4 files

This release

0.9.4 This release

4 files

0.9.3

4 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page