Skip to main content

Fast numerical operations implemented in Cython

Project description

fastofreader

Fast readers for OpenFOAM mesh files implemented in Cython. Currently supports:

  • faces: reads integer index groups from OpenFOAM faces files
  • points: reads triplets of floats from OpenFOAM points files
  • boundary: reads boundary metadata (nFaces, startFace) from OpenFOAM boundary files

Designed to be simple, dependency-free, and fast.

Author: Tomas Vicar tomasvicar@gmail.com

Installation

For development (editable):

pip install -e .

This builds the Cython extension once and links it in editable mode.

Usage

from fastofreader import (
	read_faces,
	read_points,
	read_faces_from_text,
	read_points_from_text,
	read_boundary,
)

# Faces from file
faces = read_faces("faces_test_file")
print(len(faces), faces[0][:4])

# Points from file
pts = read_points("points_test_file")
print(len(pts), pts[0])

# Boundary file
bounds = read_boundary("boundary_test_file")
print(list(bounds.items())[:1])

# In-memory variants
faces2 = read_faces_from_text("(1 2 3) (4, 5, 6)")
pts2 = read_points_from_text("(0 0 0) (1e-5 0 0)")

API

  • read_faces(path: str) -> list[list[int]]
    • Reads all integer groups enclosed in parentheses from a file. Returns a list of groups.
  • read_faces_from_text(text: str) -> list[list[int]]
    • Same as above but takes a string input.
  • read_points(path: str) -> list[list[float]]
    • Reads point coordinates as triplets (x y z) from a file. Returns a list of [x, y, z].
  • read_points_from_text(text: str) -> list[list[float]]
    • Same as above but takes a string input.
  • read_boundary(path: str) -> dict[str, dict[str, int]]
    • Parses OpenFOAM boundary file into {name: {"nFaces": int, "startFace": int}}.

Notes:

  • Parsers ignore the OpenFOAM header and the outer count/parenthesis wrapper.
  • Faces parser accepts separators as whitespace, commas, or semicolons.

Performance tips

  • Prefer file-based functions (read_faces, read_points) to avoid extra encoding/decoding.
  • Use CPython 3.10+ for best performance.

Development

Requirements are declared in pyproject.toml and built via setuptools. Common tasks:

# Editable install
python -m pip install -e .

# Run tests
pytest -q

License

MIT

Instalace (vývoj)

pip install -e .

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

fastofreader-0.2.0.tar.gz (72.8 kB view details)

Uploaded Source

Built Distributions

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

fastofreader-0.2.0-pp311-pypy311_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (94.7 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

fastofreader-0.2.0-pp311-pypy311_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (95.3 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

fastofreader-0.2.0-pp310-pypy310_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (94.4 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

fastofreader-0.2.0-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (95.0 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

fastofreader-0.2.0-cp313-cp313-musllinux_1_2_x86_64.whl (210.9 kB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

fastofreader-0.2.0-cp313-cp313-musllinux_1_2_i686.whl (204.7 kB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ i686

fastofreader-0.2.0-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (206.5 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

fastofreader-0.2.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (201.4 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

fastofreader-0.2.0-cp312-cp312-musllinux_1_2_x86_64.whl (216.0 kB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

fastofreader-0.2.0-cp312-cp312-musllinux_1_2_i686.whl (210.7 kB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ i686

fastofreader-0.2.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (212.6 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

fastofreader-0.2.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (207.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

fastofreader-0.2.0-cp311-cp311-musllinux_1_2_x86_64.whl (209.3 kB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

fastofreader-0.2.0-cp311-cp311-musllinux_1_2_i686.whl (204.0 kB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ i686

fastofreader-0.2.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (203.5 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

fastofreader-0.2.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (200.2 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

fastofreader-0.2.0-cp310-cp310-musllinux_1_2_x86_64.whl (199.0 kB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

fastofreader-0.2.0-cp310-cp310-musllinux_1_2_i686.whl (196.0 kB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ i686

fastofreader-0.2.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (196.2 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

fastofreader-0.2.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (192.8 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

File details

Details for the file fastofreader-0.2.0.tar.gz.

File metadata

  • Download URL: fastofreader-0.2.0.tar.gz
  • Upload date:
  • Size: 72.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fastofreader-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5219ca3e8efdef70f28e2012d640885a6323e15e6353c7aaa16412057a34f4a2
MD5 12f0af5fe6a24f5d9ef20578e5fe661b
BLAKE2b-256 513d59d7f039aab7870db15599d54b62be52de1e47ca4e43094eac6195158632

See more details on using hashes here.

File details

Details for the file fastofreader-0.2.0-pp311-pypy311_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fastofreader-0.2.0-pp311-pypy311_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 22b7eda280889ec85335727974f6da706d2a787be1d6c670fec5b2e58e79d8d9
MD5 a0a37c639c06a20dbd231802045edc43
BLAKE2b-256 8d57f741cbda1a5d8503aef1780ce3c0c808aac283c37aad351af925c2c6c573

See more details on using hashes here.

File details

Details for the file fastofreader-0.2.0-pp311-pypy311_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for fastofreader-0.2.0-pp311-pypy311_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 9fa2e818d62990962710f63e5e7da3d3b5ba753309a3f3c33925b9a202962664
MD5 dc3fe509e127a3bf2d8edfe5edca1879
BLAKE2b-256 6a69042ba64b288ef24ef389196021b06474578e1ffb714b0cf74495a88b0590

See more details on using hashes here.

File details

Details for the file fastofreader-0.2.0-pp310-pypy310_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fastofreader-0.2.0-pp310-pypy310_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bba858db0f815e3c1d2d86ee72b7f31d793609672635fd07ab7c36b622472893
MD5 a58aaef873f2477bb222779b0c3063a3
BLAKE2b-256 d0c923879c7214559d1eacb09331c35a6ab9feca794cf29bdecb37830eff6282

See more details on using hashes here.

File details

Details for the file fastofreader-0.2.0-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for fastofreader-0.2.0-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 6becfd31bcd0c047c9c8757533a567ee5a531db20c1c608eefaa469fc2a35f02
MD5 9ed58c672d7a8a0b682b85eac0f11c69
BLAKE2b-256 5c98374792324a94e744753667d918caa4032096de41be32f3eb0082516719a9

See more details on using hashes here.

File details

Details for the file fastofreader-0.2.0-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for fastofreader-0.2.0-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 44aba5ff64c6a61cb64dcab112699294283cee8be2e2bf4eac24f0de13999f0b
MD5 57bc863c968853db4d1e6fc28193ff0c
BLAKE2b-256 6498c7be703cdbbdcc059c4552387f5c9a752d3e96e803a2b1ede1f10ca63968

See more details on using hashes here.

File details

Details for the file fastofreader-0.2.0-cp313-cp313-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for fastofreader-0.2.0-cp313-cp313-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 445488db50267d1e8918d3286a41a10ee6096f17b6b3ab9c64542357084cdca4
MD5 810dae65954824c4c179cf90759b2562
BLAKE2b-256 2170d5f23178784e2685375ec852b5db480afce1b92424c9cd235cf254b41360

See more details on using hashes here.

File details

Details for the file fastofreader-0.2.0-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fastofreader-0.2.0-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 35511770eb2d0fdf46c87ddcf03e90e9b3dff40a71f6d6dea914c9ceb467f54f
MD5 263dce2d84b426a4929e4ded70616e21
BLAKE2b-256 4de1796c59c67f36f629fa9808f66ffffdcefbd27762492a3520b4aba885f2d8

See more details on using hashes here.

File details

Details for the file fastofreader-0.2.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for fastofreader-0.2.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 c86105f0cd0fc741dccff36de04a2b3e4f3eec2b54ee4a1f33f6d2411ac95547
MD5 4a8516347ac9efa76b4f536ef05a6f68
BLAKE2b-256 85881871a1fb3d87873992e27a54c48dc25058b5a930e34e94c6c2d9326d290e

See more details on using hashes here.

File details

Details for the file fastofreader-0.2.0-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for fastofreader-0.2.0-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 29dfd6f7c22780beececb71fce1d6ba00c40936e97c9824de575e08bf47092db
MD5 6f3ce7b1c571c83018949fe2b45d531d
BLAKE2b-256 f53ab938cf0238460d0d7204a6e016dbf034ef168d786365e1362c35310da82d

See more details on using hashes here.

File details

Details for the file fastofreader-0.2.0-cp312-cp312-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for fastofreader-0.2.0-cp312-cp312-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 3cad64a98cb8fb3db8137401da8b49ac831be7275aa0b68fb9711d953592a511
MD5 2e4dbb02f9292704bce16477d010d3f8
BLAKE2b-256 cea358c062b4552f453c88644b5ea2acf03af64d88fb985aa0c4189d77835ede

See more details on using hashes here.

File details

Details for the file fastofreader-0.2.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fastofreader-0.2.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a23d49722111ff718131860282ef54fda79650271ecd4bf4c1b7d83516dc538b
MD5 182995e49f9421ae88db7397c597f470
BLAKE2b-256 fe1d4240b9bba684ae2c0d7f86671db6cf6ab5b5815628d1d1f2222f9f90470a

See more details on using hashes here.

File details

Details for the file fastofreader-0.2.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for fastofreader-0.2.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 f681e5aa330985b4a4c0bb12988097dc1ddf5263f1c0bae5fe6294a7dd1872be
MD5 c690ab13e6447678c19e8f8c7591d360
BLAKE2b-256 39eef8156e8f475cdefe7900e86d3cbea35b3cf185fe36b5fcf3876541816b04

See more details on using hashes here.

File details

Details for the file fastofreader-0.2.0-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for fastofreader-0.2.0-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 7c2a364702a68282ffef0e55b3d60216673666489ef93882602dd7572d213b63
MD5 5329b1fb84750bc836124483c4cd5610
BLAKE2b-256 7b78a14d1408289c22d2fe52bb6863d7fc796371cc753b8fcd807903b963b9cd

See more details on using hashes here.

File details

Details for the file fastofreader-0.2.0-cp311-cp311-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for fastofreader-0.2.0-cp311-cp311-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 e47f984935954693bc522abbf14fa74143fe89ce9d9907d76c45187e96a8d665
MD5 091459aed706d5350a007ebacd34ce15
BLAKE2b-256 10aad76c1101cf5cd4062fffba3570a5ebf15c40096e771264a0ec93b88c027b

See more details on using hashes here.

File details

Details for the file fastofreader-0.2.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fastofreader-0.2.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a5d646ea735f11656703c8032f63caf85fcfe9e9a130c0e07e27f2eec4a0d667
MD5 8d7399e4995143f91c15370f2591168f
BLAKE2b-256 58dcf80c3d97b591ca723672e577f090c411433f76a4bcb95bd3037c7b91dd60

See more details on using hashes here.

File details

Details for the file fastofreader-0.2.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for fastofreader-0.2.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 40eabeabf17be99f37b92064fcf61e76eb14d7ee612287fe45d6ba0ad9aadfb8
MD5 5ea8faad5d20bb826e38293b4442e2d7
BLAKE2b-256 7dfdd89c53330e14f119bd9abe5a036119e88154a7aa8d4618059903093658f1

See more details on using hashes here.

File details

Details for the file fastofreader-0.2.0-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for fastofreader-0.2.0-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 15ee99f6c27ccd63e3f5260bf2a98985d359cd8813e9971888db50f84cb4962d
MD5 a96fbf13d16d6451d22acb4fc6425839
BLAKE2b-256 2b31dda693b6c59a565e0520ab1437aac11127ce2ec415b759331a0a7e905515

See more details on using hashes here.

File details

Details for the file fastofreader-0.2.0-cp310-cp310-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for fastofreader-0.2.0-cp310-cp310-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 cf102f5a38288a1812a65b64300624cb742669acf3426164eaa9fef586959389
MD5 714d94489c2b23b3a9dfdbfbee54c9e7
BLAKE2b-256 b023b625f2a1179b8b2eef1890df999ffbc4941f1b04dee7b9119d4e4021067c

See more details on using hashes here.

File details

Details for the file fastofreader-0.2.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fastofreader-0.2.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9ba625eca9b5e2fbf803d34f5af5a330175375929e3f84a0da13e65c38793daa
MD5 50f25d2e7340b08e6652ffdf4d0a3f15
BLAKE2b-256 63dcb500b1fc0858cabc4ed3575987d51270271947bc455a8c647a178d928041

See more details on using hashes here.

File details

Details for the file fastofreader-0.2.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for fastofreader-0.2.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 4416970709df40312db6f4dbbddc82e9ca60a46e2cef33b2c35d403a7639ecf1
MD5 85979b40d20cca9c6e371e3677ec987b
BLAKE2b-256 90640e03adc5f4dc1528a3191a91724b6d45fe34f41137c20b49cf615dc9864b

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