gdsii.library — interface to a GDSII library
This module contains class that represents a GDSII library.
- class gdsii.library.Library(version, name, physical_unit, logical_unit, mod_time=None, acc_time=None)
Bases:
listGDSII library class. This class is derived from
listand can contain one one more instances ofgdsii.structure.Structure.- GDS syntax for the library:
- __init__(version, name, physical_unit, logical_unit, mod_time=None, acc_time=None)
Initialize the library. mod_time and acc_time are set to current UTC time by default.
- Instance attributes:
- version
GDSII file verion (
int). Number as found in a GDSII file. For example value is 5 for GDSII v5 and 0x600 for GDSII v6.
- name
Library name (
bytes).
- physical_unit
Size of database unit in meters (
float).
- logical_unit
Size of user unit in database units (
float).
- mod_time
Last modification time (
datetime).
- acc_time
Last access time (
datetime).
- libdirsize
Number of pages in the library directory (
int, optional).
- srfname
Name of spacing rules file (
bytes, optional).
- acls
ACL data (
listof tuples(GID, UID, ACCESS), optional).
- reflibs
Names of reference libraries (
bytes, optional). See GDSII stream format documentation for format.
- fonts
Names of font definition files (
bytes, optional). The content is not parsed, see GDSII stream format documentation for format.
- attrtable
Name of attribute definition file (
bytes, optional).
- generations
Number of copies for deleted structures (
int, optional)
- format
- Library format (
int, optional). Possible values: 0 – GDSII archive format
1 – GDSII filtered format
2 – EDSIII archive format
3 – EDSIII filtered format
- Library format (
- masks
Masks for filtered format (
listofbytes, optional).
- classmethod load(stream)
Load a GDS library from a file.
- Parameters:
stream – a
fileor file-like object opened for reading in binary mode.- Returns:
a new library.
- save(stream)
Save the library into a file.
- Parameters:
stream – a
fileor file-like object opened for writing in binary mode.