Registry / data / resfo
library5.0.1pypypi✓ verified 86d ago

A lazy parser and writer for reservoir simulator Fortran output format (unformatted and formatted). Current version 5.0.1 with strict typing and type stubs. Maintenance via Equinor, release cadence irregular.

pip install resfo
INSTALL
IMPORT
SIG · RESFO
R
resfo
datapythonv5.0.1
Install
3.7s avg
Import
357ms
Disk
89MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v5.0.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.360s · 89.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.7s · import 0.354s · 86MB
89MB installed
● package 89MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

lazy_read
from resfo import lazy_read
from resfo.lazy_read import ...
lazy_read is a top-level function, not a submodule.
read
from resfo import read
import resfo; resfo.read()
read is also top-level, but lazy_read is preferred for large files.
write
from resfo import write
write is top-level; arguments changed in v5: no longer accepts dict for data.
Format
from resfo import Format
Enum for FORMATTED/UNFORMATTED file format.
Entry
from resfo import Entry
TypedDict representing a single keyword entry.

Lazily read an unformatted reservoir output file and print each keyword name and data size.

from resfo import lazy_read, Format # Path to a small .FEGRID file filepath = 'sample.FEGRID' # replace with actual path for entry in lazy_read(filepath, fileformat=Format.UNFORMATTED): print(f"Keyword: {entry.keyword}, Size: {len(entry.data)}")
Debug
Known issues
breakingIn version 5.0.0, write() no longer accepts a dict for the data argument. Use a list of Entry objects instead.
fix
Replace dict with a list of Entry objects: write(filename, [Entry('KEYWORD', numpy_array)], fileformat=Format.FORMATTED)
affects: >=5.0.0
gotchalazy_read returns an iterator, not a list. It reads data lazily; iterating multiple times will reset the file pointer or raise a StopIteration.
fix
If you need random access, use read() instead, which reads all entries into memory.
affects: all
deprecatedPassing a dict to write() is removed in v5. The old pattern write('file', {'KEY': [1,2]}) no longer works.
fix
Use a list of Entry objects: from resfo import Entry; write('file', [Entry('KEY', np.array([1,2]))])
affects: >=5.0.0
gotchaMemory usage: lazy_read keeps only one entry in memory at a time, but the iterator must be consumed completely. If you stop early, the file handle may not be closed immediately.
fix
Always iterate fully or use a context manager if available (not yet, but wrap in try/finally).
affects: all
Errors
Common errors & fixes
TypeError: write() got an unexpected keyword argument 'fileformat'
In older versions, fileformat was a positional argument; in v5 it is a keyword-only argument.
fix
Use write(filename, data, fileformat=Format.FORMATTED) instead of positional.
ModuleNotFoundError: No module named 'resfo.lazy_read'
lazy_read is a function, not a submodule; incorrect import path.
fix
Use 'from resfo import lazy_read'.
ValueError: data parameter must be an iterable of Entry objects, not dict
Version 5 no longer accepts dict for write(). Data must be a list/tuple of Entry.
fix
Construct a list of Entry objects with keyword and data (numpy array).
Upgrade
Version history
5.0.1latest on PyPI · released Dec 12, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
8
OpenAI (training)
1
Resources
resfo — pip install resfo · libregistry