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
transforms archiving measur generic optimize compose observation conversion animals projection
Last synced: about 13 hours ago
JSON representation
Repository metadata
Parse soil measurement data
- Host: GitHub
- URL: https://github.com/cemsbv/pygef
- Owner: cemsbv
- License: mit
- Created: 2018-02-10T10:41:31.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2025-04-25T03:30:35.000Z (2 days ago)
- Last Synced: 2025-04-25T04:24:45.192Z (2 days ago)
- Topics: gef, geotechnical-engineering, pygef, python
- Language: Python
- Homepage: https://cemsbv.github.io/pygef
- Size: 16.7 MB
- Stars: 33
- Watchers: 2
- Forks: 18
- Open Issues: 11
- Releases: 32
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
README.md
PYGEF
Simple parser for *.gef files. These are ASCII based files used for soil properties measurements.
Compatible with Python 3.9.
Recently added the parsing of xml boreholes file, the xml parsing is still in a preliminary phase,
not all the files are supported. If you find a file that doesn't work with pygef, please make an issue about it or 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.0 ┆ 0.0 ┆ -9.99999
e ┆ -9.99999e5 ┆ ... ┆ -999999 ┆ -999999 ┆ -9.99999e5 ┆ -9.99999e5 │
│ ┆ ┆ 5 ┆ ┆ ┆ ┆ ┆ ┆ │
├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
│ 0.02 ┆ 0.02 ┆ 11.0 ┆ 2.708 ┆ ... ┆ 0 ┆ 0 ┆ 0.03 ┆ 0.6 │
├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
│ 0.04 ┆ 0.039 ┆ 13.0 ┆ 4.29 ┆ ... ┆ 0 ┆ 0 ┆ 0.039 ┆ 0.8 │
├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
│ 0.06 ┆ 0.059 ┆ 15.0 ┆ 5.124 ┆ ... ┆ 0 ┆ 0 ┆ 0.045 ┆ 0.9 │
├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
│ 0.08 ┆ 0.079 ┆ 17.0 ┆ 5.45 ┆ ... ┆ 0 ┆ 0 ┆ 0.049 ┆ 1.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.0 ┆ 1.0 ┆ zwakGrindi ┆ donkergr ┆ false ┆ nietOrgani ┆ middelgrof ┆ [0.2, │
│ ┆ ┆ gZand ┆ ijs ┆ ┆ sch ┆ 420
tot630u ┆ 0.0, │
│ ┆ ┆ ┆ ┆ ┆ ┆ m ┆ ... │
│ ┆ ┆ ┆ ┆ ┆ ┆ ┆ 0.0] │
├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤
│ 1.0 ┆ 1.1 ┆ zwakGrindi ┆ donkergr ┆ false ┆ nietOrgani ┆ middelgrof ┆ [0.2, │
│ ┆ ┆ gZand ┆ ijs ┆ ┆ sch ┆ 420
tot630u ┆ 0.0, │
│ ┆ ┆ ┆ ┆ ┆ ┆ m ┆ ... │
│ ┆ ┆ ┆ ┆ ┆ ┆ ┆ 0.0] │
├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤
│ 1.1 ┆ 2.0 ┆ zwakZandig ┆ standaar ┆ false ┆ nietOrgani ┆ null ┆ [0.0, │
│ ┆ ┆ eKleiMetGr ┆ dBruin ┆ ┆ sch ┆ ┆ 0.1, │
│ ┆ ┆ ind ┆ ┆ ┆ ┆ ┆ ... │
│ ┆ ┆ ┆ ┆ ┆ ┆ ┆ 0.0] │
├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤
│ 2.0 ┆ 3.0 ┆ zwakZandig ┆ standaar ┆ false ┆ nietOrgani ┆ null ┆ [0.0, │
│ ┆ ┆ eKlei ┆ dGrijs ┆ ┆ sch ┆ ┆ 0.0, │
│ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ... │
│ ┆ ┆ ┆ ┆ ┆ ┆ ┆ 0.0] │
├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤
│ 3.0 ┆ 4.0 ┆ zwakZandig ┆ donkergr ┆ false ┆ nietOrgani ┆ null ┆ [0.0, │
│ ┆ ┆ eKlei ┆ ijs ┆ ┆ sch ┆ ┆ 0.0, │
│ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ... │
│ ┆ ┆ ┆ ┆ ┆ ┆ ┆ 0.0] │
└────────────┴────────────┴────────────┴──────────┴────────────┴────────────┴────────────┴─────────┘
Plotting
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=false \
--env RUN_LOCAL=true \
--env VALIDATE_JSCPD=false \
--env VALIDATE_CSS=false \
--env VALIDATE_BASH=false \
--env VALIDATE_YAML=false \
--env VALIDATE_PYTHON_PYLINT=false \
--env VALIDATE_NATURAL_LANGUAGE=false \
--env VALIDATE_MARKDOWN=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:v6
UnitTest
Test the software with the use of coverage:
python -m pip install --upgrade pip setuptools
pip install -r requirements.txt
pip install .[test] .[map]
coverage run -m pytest
Requirements
Requirements are autogenerated by pip-compile
with python 3.9
pip-compile --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=test --extra=docs --extra=lint --extra=map --output-file=requirements.txt pyproject.toml
Owner metadata
- Name: CEMS
- Login: cemsbv
- Email: [email protected]
- Kind: organization
- Description: CEMS offers geotechnical software as a service through REST APIs, to be used as a trusted component in scalable automated engineering processes.
- Website: https://cemsbv.nl
- Location: Netherlands
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/92314127?v=4
- Repositories: 16
- Last ynced at: 2024-04-24T06:33:34.976Z
- Profile URL: https://github.com/cemsbv
GitHub Events
Total
- Create event: 21
- Release event: 1
- Issues event: 3
- Watch event: 3
- Delete event: 18
- Issue comment event: 73
- Push event: 28
- Pull request event: 38
Last Year
- Create event: 21
- Release event: 1
- Issues event: 3
- Watch event: 3
- Delete event: 18
- Issue comment event: 73
- Push event: 28
- Pull request event: 38
Committers metadata
Last synced: 4 days ago
Total Commits: 418
Total Committers: 13
Avg Commits per committer: 32.154
Development Distribution Score (DDS): 0.682
Commits in past year: 30
Committers in past year: 4
Avg Commits per committer in past year: 7.5
Development Distribution Score (DDS) in past year: 0.367
Name | Commits | |
---|---|---|
ritchie46 | r****6@g****m | 133 |
dependabot[bot] | 4****] | 66 |
Thomas Versteeg | t@v****l | 64 |
martinapippi | 4****i | 51 |
Robin Wimmers | r****s@c****o | 46 |
Martina Pippi | m****i@c****o | 20 |
Thijs Lukkezen | t****n@c****o | 17 |
maarten-betman | m****n@b****m | 7 |
jmmaljaars | 5****s | 6 |
Sjonnie Boonstra | s****a@a****u | 4 |
tlukkezen | 9****n | 2 |
Rob van Putten | b****l@g****m | 1 |
Thomas van der Linden | t****n@a****l | 1 |
Committer domains:
- cemsbv.io: 3
- amsterdam.nl: 1
- abt.eu: 1
- boskalis.com: 1
- versteeg.email: 1
Issue and Pull Request metadata
Last synced: 1 day ago
Total issues: 34
Total pull requests: 168
Average time to close issues: 9 months
Average time to close pull requests: about 1 month
Total issue authors: 10
Total pull request authors: 8
Average comments per issue: 1.09
Average comments per pull request: 1.51
Merged pull request: 94
Bot issues: 1
Bot pull requests: 112
Past year issues: 5
Past year pull requests: 51
Past year average time to close issues: 1 day
Past year average time to close pull requests: 26 days
Past year issue authors: 3
Past year pull request authors: 5
Past year average comments per issue: 0.6
Past year average comments per pull request: 1.24
Past year merged pull request: 28
Past year bot issues: 1
Past year bot pull requests: 45
Top Issue Authors
- tlukkezen (10)
- RDWimmers (7)
- tversteeg (4)
- mariosgeo (4)
- martinapippi (3)
- ritchie46 (2)
- Swoud (1)
- rubenjonk (1)
- renovate[bot] (1)
- amo-mhp (1)
Top Pull Request Authors
- dependabot[bot] (106)
- RDWimmers (23)
- ritchie46 (14)
- tversteeg (8)
- tlukkezen (7)
- renovate[bot] (6)
- martinapippi (3)
- maarten-betman (1)
Top Issue Labels
- bug (18)
- python (5)
- enhancement (5)
- good first issue (5)
- dependencies (4)
- help wanted (2)
- wontfix (1)
Top Pull Request Labels
- dependencies (108)
- python (102)
- github_actions (6)
- bug (3)
- rust (2)
- enhancement (1)
Package metadata
- Total packages: 1
-
Total downloads:
- pypi: 3,286 last-month
- Total dependent packages: 3
- Total dependent repositories: 2
- Total versions: 38
- Total maintainers: 2
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.11.1 (published 19 days ago)
- Last Synced: 2025-04-25T13:05:16.922Z (1 day ago)
- Versions: 38
- Dependent Packages: 3
- Dependent Repositories: 2
- Downloads: 3,286 Last month
-
Rankings:
- Dependent packages count: 3.117%
- Downloads: 6.176%
- Average: 6.972%
- Dependent repos count: 11.622%
- Maintainers (2)
Dependencies
- lxml ==4.9.1
- matplotlib >=
- polars >=
- actions/checkout v3 composite
- actions/setup-python v4 composite
- peaceiris/actions-gh-pages v3 composite
- actions-rs/toolchain v1 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- messense/maturin-action v1 composite
- 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
- 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
- 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: 14.448693273756161