hangtu
Plots and analyses for geotechnical engineers, in US or SI units. hangtu works on plain pandas DataFrames and CSV files now; reading AGS4 data files directly comes in a later release.
Status: pre-alpha. The plot framework, the property profile and the property-by-geology-unit plot are built. The rest of the first release is in progress (see Roadmap). Function names and arguments may still change.
What it does now
- Property profile (
ht.plot.profile): any property against depth or elevation, colored by geology unit, on a linear or log axis. Optional strata bands, water levels, published ranges, design lines and a summary table. - Property by geology unit (
ht.plot.geology_unit_comparison): the spread of a property in each geology unit, as percentiles or a box plot, optionally against baseline values from a report. - Units that follow the data: declare each column's units once (
ht.read_csv(..., units=...)) and every plot converts to US or SI display units. hangtu never guesses a unit. - Nothing is dropped silently: values beyond the axis limits, blanks and "less than" values are drawn or counted on the figure.
- Printable sheets (
ht.Sheet): several plots on one tabloid or letter page, saved as PDF, PNG or SVG. - CSV templates (
ht.template) with the column names each plot expects, andht.columns()to list and describe them.
Every figure is an ordinary matplotlib figure, so you can keep editing it with matplotlib.
Install
pip install hangtu # or: uv add hangtu
hangtu needs Python 3.12 or later and runs on Windows, macOS and Linux.
Quickstart
Start from a template, fill it in (in Excel or anything else that saves CSV), then plot it:
import hangtu as ht
ht.template("permeability").to_csv("perm.csv", index=False) # an empty CSV to fill in
lengths = ["depth", "depth_top", "depth_base", "ground_level", "elevation"]
k = ht.read_csv(
"perm.csv",
units={**dict.fromkeys(lengths, "ft"), "hydraulic_conductivity": "cm/s"},
)
fig, ax = ht.plot.profile(k, "hydraulic_conductivity", preset="hydraulic_conductivity")
fig.savefig("permeability.png")
fig, ax = ht.plot.geology_unit_comparison(k, "hydraulic_conductivity", display_units="SI")
Roadmap
hangtu is released plot-first: plots are what engineers use day to day, and they only need a DataFrame, so they come before AGS ingest.
| Version | Content |
|---|---|
| v0.1 (in progress) | Plot framework; property profile and property by geology unit (done); SPT profile, SPT histograms, plasticity chart, grain size curves and water content profile; the analyses behind them (SPT N60 and classes, USCS plasticity classes, D10/D30/D60, Cu and Cc) |
| v0.2 | Read AGS4 files (4.0.3–4.2) into a SQLite database, with data-quality checks and ready-made SPT, index property, grain size and permeability datasets that feed the plots directly |
| v0.3 | Statistics: distribution fitting, group comparisons, Eurocode 7 characteristic values |
| Later | Triaxial and consolidation, AGSi export, DIGGS input, and more |
The full specification is in SPEC.md, and each plot has its own spec in docs/plots.
Who it's for
Geotechnical engineers comfortable writing short Python scripts. The library assumes scripting skills picked up in engineering or science work, not a software-development background.
License
MIT
Metadata
Release files for hangtu 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| hangtu-0.0.1.tar.gz | 60.0 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hangtu-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 130.7 kB
Release files / hangtu-0.0.1.tar.gz
| Download URL | hangtu-0.0.1.tar.gz |
|---|---|
| Size | 60.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ef56e4b1c5d60c6207d65be290a6abd886af1b914ec1fa6dc7b621fe45a37a50
|
|
BLAKE2b-256 checksum How to use checksums |
f8406149e47546c6e492f5d108ea3d16c0c952ff1566fe8bffcf60a4586d8d92
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.
Transparency logRelease files / hangtu-0.0.1-py3-none-any.whl
| Download URL | hangtu-0.0.1-py3-none-any.whl |
|---|---|
| Size | 70.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0d6031af8a4f5facf77e23497058ea276ced739643a5d40b36c4587f95b5c78e
|
|
BLAKE2b-256 checksum How to use checksums |
f269abd13c14a2138619d9bf309f7e7a09f32325ebe2433572046dfb89175d85
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.
Transparency logSecurity for hangtu 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for hangtu-0.0.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.