sgf-parser
Parser for data from geotechnical field investigations in the data format specified in Report 3:2012E from the Swedish Geotechnical Society / Svenska Geotekniska Föreningen (SGF).
This package is inspired by the libsgfdata package by EMerald Geomodelling.
Latest releases see CHANGES.md
Installation (end user)
pip install sgf-parser
Basic usage
from sgf_parser import Parser
with open("tests/data/cpt-test-3.cpt", "rt") as file:
# The test file only contains one method
[method] = Parser().parse(file)
print(repr(method))
# <MethodCPT CPT method_data=[<MethodCPTData 1.000>, <MethodCPTData 1.020>, <MethodCPTData 1.040>,
# <MethodCPTData 1.060>, <MethodCPTData 1.080>, <MethodCPTData 1.100>, <MethodCPTData 1.120>, ...,
# <MethodCPTData 24.940>, <MethodCPTData 24.960>, <MethodCPTData 24.980>]>
method.model_dump(exclude={'method_data'}, exclude_defaults=True)
# {'location_name': 'Test', 'project_number': '1234', 'method_type_string': '107A',
# 'conducted_at': datetime.datetime(2019, 9, 5, 11, 5), 'predrilling_depth': Decimal('1.00'),
# 'cone_reference': '5349', 'cone_area_ratio': Decimal('0.844'), 'sleeve_area_ratio': Decimal('0'),
# 'application_class_depth': <ApplicationClass.ONE: 1>, 'application_class_resistance': <ApplicationClass.ONE: 1>,
# 'application_class_friction': <ApplicationClass.ONE: 1>, 'application_class_pressure': <ApplicationClass.ONE: 1>,
# 'depth_top': Decimal('1.000'), 'depth_base': Decimal('24.980'), 'stopcode': 90}
method.stopcode
# 90
len(method.method_data)
# 1200
Getting Started developing
-
Software dependencies
- Python 3.11 or higher
- uv
- ruff code formatter
-
Clone this repository
-
Install
uv sync
Build and Test
Run in the project root folder:
uv run pytest
Build the package wheel:
uv build
Publish
TODOs
- Implement everything
- Do the rest
Contribute
Please start by adding an issue before submitting any pull requests.
Metadata
Release files for sgf-parser 0.0.13
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 | Actions |
|---|---|---|---|---|
| sgf_parser-0.0.13.tar.gz | 657.8 kB | Without provenance | Details for sgf_parser-0.0.13.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sgf_parser-0.0.13-py3-none-any.whl | Python 3 | none | any | Details for sgf_parser-0.0.13-py3-none-any.whl |
Total release size: 680.4 kB
Release files / sgf_parser-0.0.13.tar.gz
| Download URL | sgf_parser-0.0.13.tar.gz |
|---|---|
| Size | 657.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
12e0cbbfd8907d135a171b267b99080e014e094f40d0310e3b1fbb46a1952e68
|
|
BLAKE2b-256 checksum How to use checksums |
ce534a09d9621c2ed41b6905e3bff0a6ddb0da03ef1b95e44902e3949df3318b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / sgf_parser-0.0.13-py3-none-any.whl
| Download URL | sgf_parser-0.0.13-py3-none-any.whl |
|---|---|
| Size | 22.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7e60e6c3ec21df8fd84d8e9dc4e7c26ef7dbf08b3f78cc9e28a7bd2d2858a2ef
|
|
BLAKE2b-256 checksum How to use checksums |
30080644ea0ccf1e2f2f4f3d264beca05b84d9a6a948ac32cac9c34487aa20a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for sgf-parser 0.0.13
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.