Caltech Intermediate Form parser in pure Python
Currently, CIFT is a utility for use in unit tests of RAIMAD, a different project I am working on. As such, it is only guaranteed to support CIF files that RAIMAD produces, and not all CIF files in general.
Turning CIFT into a general-purpose CIF parser is a long-term future goal.
- Basic parsing
-
P
(polygons) -
B
(box)- rotation
- Comments
- Subroutines (
DS
andDF
) - Translation and rotation (subroutines)
-
- Inspection
- Get CIF file as a list of geometries on each layer
- Get CIF file as a tree representing subroutine calls
- Pure Python, no dependencies
- easy to understand code
mypy --strict
has no complaints- in abscence of a CIF spec, emulate KLayout's CIF parser as closely as possible.
- "CIFT", pronounced like "sift". Think of putting a CIF file into a sieve and letting the syntax crystallize into grains of sand that fall away to reveal the geometries it represents.
You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see http://creativecommons.org/publicdomain/zero/1.0/.
Future versions may switch to a difference license.