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.12

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.12
File Size Uploaded Provenance Actions
sgf_parser-0.0.12.tar.gz 657.6 kB Without provenance Details for sgf_parser-0.0.12.tar.gz

Built distribution (wheel)

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

Total release size: 680.1 kB

Release files / sgf_parser-0.0.12.tar.gz

Download URL sgf_parser-0.0.12.tar.gz
Size 657.6 kB
Tags Source
SHA-256 checksum
How to use checksums
58080b55558674ba1b1f17906f4aca324671b0afa1988d08ce33dc647d72ed76
BLAKE2b-256 checksum
How to use checksums
06bfdd8fa91a1b7b9a4910d9bf0df0b16c971f704a26858f5e37f456957c5eeb
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.12-py3-none-any.whl

Download URL sgf_parser-0.0.12-py3-none-any.whl
Size 22.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6a54fa96245c986a36e05504a2c8a2653ed14d8f20639bb728151c8f668f9271
BLAKE2b-256 checksum
How to use checksums
931c1d1e7827af4736991120db8f7cbe7923a2fcb2dcd678b5d7f3ea19145ebb
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.12

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