imlresi
Tools for dealing with IML-Resi PowerDrill data using python.
THIS PACKAGE IS UNOFFICAL AND HAS BEEN DEVELOPED INDEPENDENT OF IML
Current limitations:
- Focus is on actual measurements made by the tool rather than meta-info.
- Poor support for data generated in PD-Tools (e.g. "assessments").
Install
https://pypi.org/project/imlresi/
pip install imlresi
Optional extras:
| extra | for |
|---|---|
imlresi[delta] |
Delta Lake export with the pure-Python delta-rs engine |
imlresi[spark] |
Delta Lake export through PySpark (e.g. Microsoft Fabric notebooks) |
imlresi[plot] |
Trace.plot() |
imlresi[test] |
running the test suite |
Use
Traces
Trace reads a single measurement in any of IML's formats: binary .rgp
(firmware up to 1.32), JSON .rgp (later firmware), .pdc (IML's iPad
app) and the two PD-Tools text exports.
from imlresi import Trace
tr = Trace()
tr.read('trace.rgp')
tr.drill, tr.feed # drill and feed amplitude profiles
tr.get_drilltime() # instrument clock time
tr.get_latlon() # from a .pdc location stamp
tr.to_json() # as IML's JSON trace format
tr.hash() # md5 of to_json(), e.g. as a database key
Trace.process_using_resiapi(uri) sends the trace to a Resi API server and
keeps the result, which is then available as e.g. tr.get_ubdia(). A server
that wants a login gets it with auth=(name, key) (only over https://):
tr.process_using_resiapi("https://resiapi.aliente.ch/predict",
auth=(os.environ["RESI_API_USER"], os.environ["RESI_API_KEY"]))
.Resi files
A .Resi file is the project file of the FWPA web app: an R list saved with
saveRDS(), holding a summary table (df) plus the traces and results for
each measurement.
from imlresi import ResiResultSet, save_traces_to_dotresi, change_instrument_id
rs = ResiResultSet('project.Resi')
for r in rs:
r.FileName, r.TreeID, r.DOB, r.drill
r.recompute_den_trace() # recompute the density profile
rs.to_dotresi('copy.Resi')
# build a .Resi file from raw traces, e.g. to upload to the web app
save_traces_to_dotresi([tr], 'new.Resi')
change_instrument_id('project.Resi', 'PD500-0755', output_filepath='fixed.Resi')
The same conversion from the command line:
traces2resi *.rgp -o new.Resi
Databases
rs.to_duckdb('resi.duckdb') # traces, results, rings, boards tables
rs = ResiResultSet.from_duckdb('resi.duckdb')
rs.to_deltalake('Tables/resi', mode='merge') # needs imlresi[delta] or imlresi[spark]
to_deltalake uses PySpark when a Spark session is active and delta-rs
otherwise; pass engine='deltalake' or engine='spark' to choose, and
storage_options imply delta-rs. Merging never replaces an existing table;
only mode='overwrite' does.
Units
FeedSpeed is stored in mm/min in .Resi files, DuckDB and Delta tables, as
the web app does. Traces report it in cm/min (Trace.get_feedspeed()). See
CHANGELOG.md about data written by 0.0.45 and earlier.
Development
pip install -e '.[test,spark]'
pytest
The Spark tests need a JDK and are skipped without PySpark.
Metadata
Release files for imlresi 0.0.47
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 |
|---|---|---|---|---|
| imlresi-0.0.47.tar.gz | 69.7 kB | Without provenance | Details for imlresi-0.0.47.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| imlresi-0.0.47-py3-none-any.whl | Python 3 | none | any | Details for imlresi-0.0.47-py3-none-any.whl |
Total release size: 112.0 kB
Release files / imlresi-0.0.47.tar.gz
| Download URL | imlresi-0.0.47.tar.gz |
|---|---|
| Size | 69.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b991753b90c8e33272b920dd56cb2495d020f57dcba4b32f1128a64f157186f3
|
|
BLAKE2b-256 checksum How to use checksums |
5c518349dd52126691e7f35846830f694965cad9aa10f6e8b3008ce854fb7351
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.8
|
Release files / imlresi-0.0.47-py3-none-any.whl
| Download URL | imlresi-0.0.47-py3-none-any.whl |
|---|---|
| Size | 42.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
36ff962b9eb96b35ff5a1a70ba22a7f37598e6b39f0cc27c125393e42967ec46
|
|
BLAKE2b-256 checksum How to use checksums |
b49702de6da8085bfec631b35e6be4704a3f67a948fe98c86a7eedda16026247
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.8
|
Security for imlresi 0.0.47
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.