Skip to main content

Parser for the Swedish Geotechnical Society / Svenska Geotekniska Föreningen (SGF) data format

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sgf_parser-0.0.10.tar.gz (665.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sgf_parser-0.0.10-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

File details

Details for the file sgf_parser-0.0.10.tar.gz.

File metadata

  • Download URL: sgf_parser-0.0.10.tar.gz
  • Upload date:
  • Size: 665.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"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}

File hashes

Hashes for sgf_parser-0.0.10.tar.gz
Algorithm Hash digest
SHA256 f8f239db8996026d6f7d24f6cf55c0a69299515e69c71c735d0b9265af3d532e
MD5 8f112706ef2de20c83aca04ede31c6a2
BLAKE2b-256 c60e2bd75ed089612a0694eb8d587c0c61db343714623227b5c7188c591711b3

See more details on using hashes here.

File details

Details for the file sgf_parser-0.0.10-py3-none-any.whl.

File metadata

  • Download URL: sgf_parser-0.0.10-py3-none-any.whl
  • Upload date:
  • Size: 22.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"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}

File hashes

Hashes for sgf_parser-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 abcc8e063dc4b03c242397c9879dbc986476673a88aa41a366b7aab42d23b6a0
MD5 2c2bfe3a7bde04fe7b8772e62db69451
BLAKE2b-256 d0e2eccbf6f826607021dbe78c70afecdebc24aec0d4387bceea273944ab6a2a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page