Skip to main content

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

  1. Software dependencies

    • Python 3.11 or higher
    • uv
    • ruff code formatter
  2. Clone this repository

  3. 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.14

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sgf-parser 0.0.14
File Size Uploaded Provenance Actions
sgf_parser-0.0.14.tar.gz 659.5 kB Without provenance Details for sgf_parser-0.0.14.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sgf-parser 0.0.14
File Interpreter ABI Platform Actions
sgf_parser-0.0.14-py3-none-any.whl Python 3 none any Details for sgf_parser-0.0.14-py3-none-any.whl

Total release size: 682.1 kB

Release files / sgf_parser-0.0.14.tar.gz

Download URL sgf_parser-0.0.14.tar.gz
Size 659.5 kB
Tags Source
SHA-256 checksum
How to use checksums
6c534677dffbef691d8c14a5956e18a85153b3c27e6a399a5f874ca1e5ad7ef1
BLAKE2b-256 checksum
How to use checksums
4f2b6a896814f80191e20f92cb5fbfb3be5fa9416ccdbdf86352598de27c5463
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","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.14-py3-none-any.whl

Download URL sgf_parser-0.0.14-py3-none-any.whl
Size 22.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1cf6caabf69bffd81b7f0f8188e2d159c3abdd351390b4ed0311b58e5774c217
BLAKE2b-256 checksum
How to use checksums
9ddd7d4103a6b160176d119071318f7b4e9b06f45113dac2b5230c89a97a5364
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","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.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.

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.

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