pygef

Simple parser for soil properties measurements.
https://github.com/cemsbv/pygef

Category: Natural Resources
Sub Category: Soil and Land

Keywords

gef geotechnical-engineering pygef python

Keywords from Contributors

animations profile measures composable conversion archiving contributing stress-test generate synchronous

Last synced: about 1 hour ago
JSON representation

Repository metadata

Parse soil measurement data

README.md

PYGEF

Code style: black
PyPi Version
Python Version from PEP 621 TOML
Coverage Status

Simple parser for *.GEF and BRO XML files. These are files used for soil
property measurements.

If you find a file that doesn't work with pygef, please make an issue about it or a PR :)

Installation

Latest stable version:

pip install pygef

Cutting-edge version (might break):

pip install git+https://github.com/cemsbv/pygef.git

CPT files

>> > from pygef import read_cpt
>> >  # read gef and xml files
>> > cpt_data = read_cpt("./my-cpt.xml")
>> > cpt_data
CPTData: {'bro_id': 'CPT000000099543',
          'cone_diameter': 44,
          'cone_surface_area': 1500,
          'cone_surface_quotient': 0.67,
          'cone_to_friction_sleeve_distance': 100,
          'cone_to_friction_sleeve_surface_area': 22530,
          'cone_to_friction_sleeve_surface_quotient': 1.0,
          ...
              'zlm_pore_pressure_u3_after': None,
'zlm_pore_pressure_u3_before': None}
>> >  # access the underlying polars DataFrame under the `data` attribute
>> > cpt_data.data.head()
shape: (5, 9)
┌────────────┬───────┬───────────┬────────────┬─────┬────────────┬────────────┬────────────┬────────────┐
│ penetratio ┆ depth ┆ elapsedTi ┆ coneResist ┆ ... ┆ inclinatio ┆ inclinatio ┆ localFrict ┆ frictionRa │
│ nLength    ┆ ---   ┆ me        ┆ ance       ┆     ┆ nNS        ┆ nResultant ┆ ion        ┆ tio        │
│ ---        ┆ f64   ┆ ---       ┆ ---        ┆     ┆ ---        ┆ ---        ┆ ---        ┆ ---        │
│ f64        ┆       ┆ f64       ┆ f64        ┆     ┆ i64        ┆ i64        ┆ f64        ┆ f64        │
╞════════════╪═══════╪═══════════╪════════════╪═════╪════════════╪════════════╪════════════╪════════════╡
0.00.0   ┆ -9.99999
e ┆ -9.99999e5... ┆ -999999    ┆ -999999    ┆ -9.99999e5 ┆ -9.99999e5│            ┆       ┆ 5         ┆            ┆     ┆            ┆            ┆            ┆            │
├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
0.020.0211.02.708...000.030.6├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
0.040.03913.04.29...000.0390.8├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
0.060.05915.05.124...000.0450.9├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
0.080.07917.05.45...000.0491.0└────────────┴───────┴───────────┴────────────┴─────┴────────────┴────────────┴────────────┴────────────┘

Bore files

>> > from pygef import read_bore
>> >  # read gef and xml files
>> > bore_data = read_bore("./my-bore.xml")
>> > bore_data
BoreData: {'bore_hole_completed': True,
           'bore_rock_reached': False,
           'data': (13, 8),
           'delivered_location': Location(srs_name='urn:ogc:def:crs:EPSG::28992', x=158322.139, y=444864.706),
           'delivered_vertical_position_datum': 'nap',
           'delivered_vertical_position_offset': 10.773,
           'delivered_vertical_position_reference_point': 'maaiveld',
           'description_procedure': 'ISO14688d1v2019c2020',
           'final_bore_depth': 12.0,
           'final_sample_depth': 12.0,
           'research_report_date': datetime.date(2021, 10, 19)}
>> >  # access the underlying polars DataFrame under the `data` attribute
>> > bore_data.data.head()
shape: (5, 8)
┌────────────┬────────────┬────────────┬──────────┬────────────┬────────────┬────────────┬─────────┐
│ upper_boun ┆ lower_boun ┆ geotechnic ┆ color    ┆ dispersed_ ┆ organic_ma ┆ sand_media ┆ soil_di │
│ dary       ┆ dary       ┆ al_soil_na ┆ ---      ┆ inhomogeni ┆ tter_conte ┆ n_class    ┆ st      │
│ ---        ┆ ---        ┆ me         ┆ str      ┆ ty         ┆ nt_class   ┆ ---        ┆ ---     │
│ f64        ┆ f64        ┆ ---        ┆          ┆ ---        ┆ ---        ┆ str        ┆ list[f6 │
│            ┆            ┆ str        ┆          ┆ bool       ┆ str        ┆            ┆ 4]      │
╞════════════╪════════════╪════════════╪══════════╪════════════╪════════════╪════════════╪═════════╡
0.01.0        ┆ zwakGrindi ┆ donkergr ┆ false      ┆ nietOrgani ┆ middelgrof ┆ [0.2,   │
│            ┆            ┆ gZand      ┆ ijs      ┆            ┆ sch        ┆ 420
tot630u ┆ 0.0,    │
│            ┆            ┆            ┆          ┆            ┆            ┆ m          ┆ ...│            ┆            ┆            ┆          ┆            ┆            ┆            ┆ 0.0]    │
├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤
1.01.1        ┆ zwakGrindi ┆ donkergr ┆ false      ┆ nietOrgani ┆ middelgrof ┆ [0.2,   │
│            ┆            ┆ gZand      ┆ ijs      ┆            ┆ sch        ┆ 420
tot630u ┆ 0.0,    │
│            ┆            ┆            ┆          ┆            ┆            ┆ m          ┆ ...│            ┆            ┆            ┆          ┆            ┆            ┆            ┆ 0.0]    │
├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤
1.12.0        ┆ zwakZandig ┆ standaar ┆ false      ┆ nietOrgani ┆ null       ┆ [0.0,   │
│            ┆            ┆ eKleiMetGr ┆ dBruin   ┆            ┆ sch        ┆            ┆ 0.1,    │
│            ┆            ┆ ind        ┆          ┆            ┆            ┆            ┆ ...│            ┆            ┆            ┆          ┆            ┆            ┆            ┆ 0.0]    │
├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤
2.03.0        ┆ zwakZandig ┆ standaar ┆ false      ┆ nietOrgani ┆ null       ┆ [0.0,   │
│            ┆            ┆ eKlei      ┆ dGrijs   ┆            ┆ sch        ┆            ┆ 0.0,    │
│            ┆            ┆            ┆          ┆            ┆            ┆            ┆ ...│            ┆            ┆            ┆          ┆            ┆            ┆            ┆ 0.0]    │
├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤
3.04.0        ┆ zwakZandig ┆ donkergr ┆ false      ┆ nietOrgani ┆ null       ┆ [0.0,   │
│            ┆            ┆ eKlei      ┆ ijs      ┆            ┆ sch        ┆            ┆ 0.0,    │
│            ┆            ┆            ┆          ┆            ┆            ┆            ┆ ...│            ┆            ┆            ┆          ┆            ┆            ┆            ┆ 0.0]    │
└────────────┴────────────┴────────────┴──────────┴────────────┴────────────┴────────────┴─────────┘

Plotting

To use the plotting functionality pygef needs to be installed with the [plot]
feature.

pip install pygef[plot]
from pygef import read_cpt, read_bore
from pygef.plotting import plot_cpt, plot_bore

# plot cpt file
plot_cpt(read_cpt("myfile.xml"))

# plot a bore file
plot_bore(read_bore("myfile.xml"))

Documentation

Build the docs:

python -m pip install --upgrade pip setuptools
pip install -r requirements.txt
pip install .

sphinx-build -b html docs public

Format

We format our code with black and isort.

black --config "pyproject.toml" .
isort --settings-path "pyproject.toml" .

Lint

To maintain code quality we use the GitHub super-linter.

To run the linters locally, run the following bash script from the root
directory:

docker run \
--env VALIDATE_ALL_CODEBASE=true \
--env DEFAULT_BRANCH=master \
--env RUN_LOCAL=true \
--env FIX_PYTHON_ISORT=true \
--env FIX_PYTHON_BLACK=true \
--env FIX_YAML_PRETTIER=true \
--env VALIDATE_BASH=false \
--env VALIDATE_BIOME_FIX=false \
--env VALIDATE_BIOME_FORMAT=false \
--env VALIDATE_BIOME_LINT=false \
--env VALIDATE_CSS=false \
--env VALIDATE_CSS_PRETTIER=false \
--env VALIDATE_GRAPHQL=false \
--env VALIDATE_GRAPHQL_PRETTIER=false \
--env VALIDATE_HTML=false \
--env VALIDATE_HTML_PRETTIER=false \
--env VALIDATE_JAVASCRIPT_ES=false \
--env VALIDATE_JAVASCRIPT_PRETTIER=false \
--env VALIDATE_JSCPD=false \
--env VALIDATE_JSONC=false \
--env VALIDATE_JSONC_PRETTIER=false \
--env VALIDATE_JSON_ES=false \
--env VALIDATE_JSON_PRETTIER=false \
--env VALIDATE_JSX=false \
--env VALIDATE_JSX_PRETTIER=false \
--env VALIDATE_MARKDOWN=false \
--env VALIDATE_MARKDOWN_PRETTIER=false \
--env VALIDATE_NATURAL_LANGUAGE=false \
--env VALIDATE_PYTHON_PYLINT=false \
--env VALIDATE_PYTHON_RUFF=false \
--env VALIDATE_PYTHON_RUFF_FORMAT=false \
--env VALIDATE_TSX=false \
--env VALIDATE_TYPESCRIPT_ES=false \
--env VALIDATE_TYPESCRIPT_PRETTIER=false \
--env VALIDATE_VUE=false \
--env VALIDATE_VUE_PRETTIER=false \
--env VALIDATE_YAML=false \
--env LINTER_RULES_PATH=/ \
--env PYTHON_BLACK_CONFIG_FILE=pyproject.toml \
--env PYTHON_ISORT_CONFIG_FILE=pyproject.toml \
--env PYTHON_MYPY_CONFIG_FILE=pyproject.toml \
--env PYTHON_FLAKE8_CONFIG_FILE=.flake8 \
-v $(pwd):/tmp/lint ghcr.io/super-linter/super-linter:v8

UnitTest

Test the software with the use of coverage:

python -m pip install --upgrade pip setuptools
pip install -r requirements.txt
pip install -e .[test] .[map] .[plot]

coverage run -m pytest

Requirements

Requirements are autogenerated by pip-compile with python 3.9

pip-compile --extra=plot --extra=test --extra=docs --extra=lint --extra=map --output-file=requirements.txt pyproject.toml

To update the requirements within the defined ranges, run:

pip-compile --upgrade --extra=plot --extra=test --extra=docs --extra=lint --extra=map --output-file=requirements.txt pyproject.toml

Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: about 8 hours ago

Total Commits: 455
Total Committers: 16
Avg Commits per committer: 28.438
Development Distribution Score (DDS): 0.708

Commits in past year: 41
Committers in past year: 6
Avg Commits per committer in past year: 6.833
Development Distribution Score (DDS) in past year: 0.585

Name Email Commits
ritchie46 r****6@g****m 133
Thomas Versteeg t@v****l 77
dependabot[bot] 4****] 67
martinapippi 4****i 51
Robin Wimmers r****s@c****o 51
Martina Pippi m****i@c****o 20
Thijs Lukkezen t****n@c****o 17
renovate[bot] 2****] 13
maarten-betman m****n@b****m 7
jmmaljaars 5****s 6
Sjonnie Boonstra s****a@a****u 4
Paul Waite 1****7 3
tlukkezen 9****n 2
reflecting-moon c****s@b****m 2
Thomas van der Linden t****n@a****l 1
Rob van Putten b****l@g****m 1

Committer domains:


Issue and Pull Request metadata

Last synced: 2 days ago

Total issues: 36
Total pull requests: 235
Average time to close issues: 10 months
Average time to close pull requests: about 1 month
Total issue authors: 12
Total pull request authors: 10
Average comments per issue: 1.0
Average comments per pull request: 1.27
Merged pull request: 117
Bot issues: 1
Bot pull requests: 170

Past year issues: 6
Past year pull requests: 68
Past year average time to close issues: about 2 months
Past year average time to close pull requests: 22 days
Past year issue authors: 6
Past year pull request authors: 6
Past year average comments per issue: 0.67
Past year average comments per pull request: 0.97
Past year merged pull request: 19
Past year bot issues: 1
Past year bot pull requests: 57

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/cemsbv/pygef

Top Issue Authors

  • tlukkezen (10)
  • RDWimmers (7)
  • tversteeg (5)
  • mariosgeo (3)
  • martinapippi (3)
  • ritchie46 (2)
  • PabloVasconez (1)
  • Swoud (1)
  • reflecting-moon (1)
  • renovate[bot] (1)
  • amo-mhp (1)
  • bro-wi (1)

Top Pull Request Authors

  • dependabot[bot] (134)
  • renovate[bot] (36)
  • RDWimmers (26)
  • ritchie46 (14)
  • tversteeg (10)
  • tlukkezen (8)
  • reflecting-moon (2)
  • PaulW8787 (2)
  • martinapippi (2)
  • maarten-betman (1)

Top Issue Labels

  • bug (14)
  • good first issue (6)
  • python (6)
  • enhancement (5)
  • dependencies (3)
  • help wanted (2)
  • wontfix (1)

Top Pull Request Labels

  • dependencies (140)
  • python (130)
  • github_actions (10)
  • bug (4)
  • enhancement (4)
  • rust (2)

Package metadata

pypi.org: pygef

Parse soil measurument data.

  • Homepage:
  • Documentation: https://pygef.readthedocs.io/
  • Licenses: MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  • Latest release: 0.14.0 (published about 1 month ago)
  • Last Synced: 2025-12-22T20:06:36.512Z (2 days ago)
  • Versions: 42
  • Dependent Packages: 3
  • Dependent Repositories: 2
  • Downloads: 5,888 Last month
  • Rankings:
    • Dependent packages count: 3.117%
    • Downloads: 6.176%
    • Average: 6.972%
    • Dependent repos count: 11.622%
  • Maintainers (2)

Dependencies

setup.py pypi
  • lxml ==4.9.1
  • matplotlib >=
  • polars >=
.github/workflows/deploy_docs.yaml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • peaceiris/actions-gh-pages v3 composite
.github/workflows/release_pypi.yaml actions
  • actions-rs/toolchain v1 composite
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • messense/maturin-action v1 composite
.github/workflows/test.yaml actions
  • actions-rs/cargo v1.0.3 composite
  • actions-rs/toolchain v1.0.7 composite
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • github/super-linter v4 composite
  • messense/maturin-action v1 composite
pyproject.toml pypi
  • gef-file-to-map >=0.1,<0.2
  • lxml >=4.9.1,<5.0
  • matplotlib >=3.6,<4.0
  • polars [pyarrow]>0.16.14,<0.19
requirements.txt pypi
  • affine ==2.4.0
  • alabaster ==0.7.13
  • asteroid-sphinx-theme ==0.0.3
  • asttokens ==2.2.1
  • attrs ==22.2.0
  • babel ==2.12.1
  • backcall ==0.2.0
  • black ==23.1.0
  • certifi ==2022.12.7
  • charset-normalizer ==3.1.0
  • click ==8.1.3
  • click-plugins ==1.1.1
  • cligj ==0.7.2
  • contextily ==1.3.0
  • contourpy ==1.0.7
  • coverage ==6.5.0
  • coveralls ==3.3.1
  • cycler ==0.11.0
  • decorator ==5.1.1
  • docopt ==0.6.2
  • docutils ==0.18.1
  • exceptiongroup ==1.1.1
  • executing ==1.2.0
  • fonttools ==4.39.4
  • gef-file-to-map ==0.1.0
  • geographiclib ==2.0
  • geopy ==2.3.0
  • idna ==3.4
  • imagesize ==1.4.1
  • importlib-metadata ==6.1.0
  • importlib-resources ==5.12.0
  • iniconfig ==2.0.0
  • ipython ==8.11.0
  • isort ==5.12.0
  • jedi ==0.18.2
  • jinja2 ==3.1.2
  • joblib ==1.2.0
  • kiwisolver ==1.4.4
  • lxml ==4.9.2
  • markupsafe ==2.1.2
  • matplotlib ==3.7.1
  • matplotlib-inline ==0.1.6
  • mercantile ==1.2.1
  • mypy-extensions ==1.0.0
  • numpy ==1.24.2
  • packaging ==23.0
  • parso ==0.8.3
  • pathspec ==0.11.1
  • pexpect ==4.8.0
  • pickleshare ==0.7.5
  • pillow ==9.5.0
  • platformdirs ==3.5.1
  • pluggy ==1.0.0
  • polars ==0.18.1
  • prompt-toolkit ==3.0.38
  • ptyprocess ==0.7.0
  • pure-eval ==0.2.2
  • pyarrow ==11.0.0
  • pygments ==2.14.0
  • pyparsing ==3.0.9
  • pytest ==7.2.2
  • python-dateutil ==2.8.2
  • rasterio ==1.3.6
  • requests ==2.31.0
  • six ==1.16.0
  • snowballstemmer ==2.2.0
  • snuggs ==1.4.7
  • sphinx ==6.1.3
  • sphinx-autodoc-typehints ==1.22
  • sphinx-rtd-theme ==1.2.0
  • sphinxcontrib-applehelp ==1.0.4
  • sphinxcontrib-devhelp ==1.0.2
  • sphinxcontrib-htmlhelp ==2.0.1
  • sphinxcontrib-jquery ==4.1
  • sphinxcontrib-jsmath ==1.0.1
  • sphinxcontrib-qthelp ==1.0.3
  • sphinxcontrib-serializinghtml ==1.1.5
  • stack-data ==0.6.2
  • tomli ==2.0.1
  • traitlets ==5.9.0
  • typing-extensions ==4.5.0
  • urllib3 ==1.26.15
  • wcwidth ==0.2.6
  • xyzservices ==2023.2.0
  • zipp ==3.15.0

Score: 15.283089931700347