Fortio
A Python IO for Fortran Unformatted Binary Files with Variable-Length Records.
Features
- read and write Fortran unformatted file
- auto-detect endianness(byteorder)
- allow reading data into pre-allocated buffers
- allow skipping over records or jumping to wanted record directly without reading data
- support subrecords (which is necessary for long record whose size larger than 4GB with signed 4 bytes integer header)
- support numpy.memmap array for fast loading
Installation
pip install fortio
Usage
from fortio import FortranFile
with FortranFile(filename) as f:
a = f.read_record('i4')
f.skip_record()
b = f.read_record('f8')
Functions
-
FortranFile(filename, mode='r', header_dtype='uint32', auto_endian=True, check_file=True)
-
methods
- write_record(data)
- read_record(dtype='byte', shape=None, rec=None, memmap=False)
- mmap_record(dtype='byte', shape=None, rec=None)
- read_record_into(into, offset=None, rec=None)
- get_record_size(rec=None)
- skip_record(nrec=1)
- goto_record(rec=None)
- close()
- flush()
-
properties
- file
- filesize
- mode
- header_dtype
- long_records
- closed
- byteorder
-
internal properties and methods
- _fp
- _offsets
- _lengths
- _read_header()
- _check_byteorder()
- _check_file()
- _read_record_data(data)
Metadata
Release files for fortio 0.4
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 |
|---|---|---|---|---|
| fortio-0.4.tar.gz | 4.8 kB | Without provenance | Details for fortio-0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fortio-0.4-py3-none-any.whl | Python 3 | none | any | Details for fortio-0.4-py3-none-any.whl |
Total release size: 16.8 kB
Release files / fortio-0.4.tar.gz
| Download URL | fortio-0.4.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e143fbb8cc2644550b3b08ecef62eae190daf82377b5527a68d04037be934650
|
|
BLAKE2b-256 checksum How to use checksums |
68256504a059363ea7a31e2ceadb2d096c571803f9bb43c257f0fe9ebc2276d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
|
Release files / fortio-0.4-py3-none-any.whl
| Download URL | fortio-0.4-py3-none-any.whl |
|---|---|
| Size | 12.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bd851a3ee5a59ed61343212506b3c7d29c4c9934a79002c063a1311882718ec5
|
|
BLAKE2b-256 checksum How to use checksums |
2375adf609fa59c4329ac361aee82c17cc86de7b93b3098e84d3dc2dd6ac9b10
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
|
Security for fortio 0.4
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.