Skip to main content

pyinfraformat Code style: black codecov

pyinfraformat

Python library for reading, writing and analyzing Finnish borehole format Infraformat (version 2.5). Well suited for scientific and research applications.

Installation

Latest (stable) pyinfraformat can be installed with pip

python -m pip install pyinfraformat

The latest (unstable) version can be installed from git with pip (needs git-tools).

python -m pip install git+https://github.com/ahartikainen/pyinfraformat

Library can be installed also by git clone / downloading zip.

git clone https://github.com/ahartikainen/pyinfraformat
cd pyinfraformat
python -m pip install .

To install inplace for development work, use -e command.

python -m pip install -e .

Quickstart

Basic usage

import pyinfraformat as pif
pif.set_logger_level(50) # Suppress non-critical warnings, recommended for large files
holes = pif.from_infraformat("*.tek")
holes = holes.project("TM35FIN")
bounds = holes.bounds
holes.to_infraformat("holes_tm35fin.tek")

bounds = [6672242-200 ,  385795-200, 6672242 +200,  385795+200]
gtk_holes = pif.from_gtk_wfs(bounds, "TM35Fin")
print(gtk_holes) # View holes object
#Infraformat Holes -object:
#  Total of 203 holes
#    - PO ......... 161
#    - HP .........  13
#    - PA .........  12
#    - NO .........   2
#    - NE .........   1
#    - KE .........   5
#    - KR .........   9


html_map = gtk_holes.plot_map()
html_map.save("soundings.html")
html_map # View map in jupyter

image

hole_figure = gtk_holes[10].plot()
hole_figure # View hole in jupyter

image

Plot histograms from laboratory tests

import pandas as pd
bounds = [6672242-2000 ,  385795-2000, 6672242 +2000,  385795+2000]
gtk_holes = pif.from_gtk_wfs(bounds, "TM35FIN", maxholes=25_000)
laboratory_tests = gtk_holes.filter_holes(hole_type=["NO", "NE"], start="1990-01-01")
df = laboratory_tests.get_dataframe()
df['data_Soil type'] = df['data_Soil type'].astype("string")
clay_samples = df[df['data_Soil type'].str.endswith("Sa", na=False)].reset_index()
clay_samples['data_Laboratory w'] = pd.to_numeric(clay_samples['data_Laboratory w'])
fig = clay_samples['data_Laboratory w'].plot.hist(bins='fd')
fig.set_title("Clay samples water content, %")
fig

image

Release files for pyinfraformat 25.7.10

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

Built distribution (wheel)

Table of built distributions (wheels) for pyinfraformat 25.7.10
File Interpreter ABI Platform
pyinfraformat-25.7.10-py3-none-any.whl Python 3 none any Details

Release files / pyinfraformat-25.7.10-py3-none-any.whl

Download URL pyinfraformat-25.7.10-py3-none-any.whl
Size 49.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
135ea8f16abc05e77ddf03a1f3644774c800d2de721db2c40b4231fa3a9fd033
BLAKE2b-256 checksum
How to use checksums
77deb19821524c6d4192f39b49aed88fb23df644db2ff55eed716392f722c37e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.11
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