ZmxTools
A toolkit to read Zemax files.
Currently, this is limited to unpacking ZAR archives. For further processing of the archive's contents, e.g. ZMX or AGF glass files, please check the list of related software below.
Features
- Unpack a Zemax OpticStudio® Archive ZAR file using the
unzarcommand. - Repack a ZAR file as a standard zip file using the
unzar -zcommand. - Use as a pure Python 3 library.
- Fully typed with annotations and checked with mypy, PEP561 compatible
Installation
Prerequisites
- Python 3.8 or higher
- pip, the Python package manager
To install zmxtools, just run the following command in a command shell:
pip install zmxtools
The zmxtools library will color-code test output when the coloredlogs package is installed. You can optionally
install it with
pip install coloredlogs
Usage
This package can be used directly from a terminal shell or from your own Python code. Example files can be found on manufacturer's sites such as Thorlabs Inc.
Command line shell
The command unzar is added to the path upon installation. It permits the extraction of the zar-file to a sub-directory
as well as its conversion to a standard zip-file. For example, extracting to the sub-directory mylens is done using
unzar mylens.zar
Repacking the same zar-archive as a standard zip-archive mylens.zip is done with:
unzar mylens.zar -z
Multiple input files and an alternative output directory can be specified:
unzar -i *.zar -o some/where/else/
Find out more information and alternative options using:
unzar -h
As a Python library
Extraction and repacking can be done programmatically as follows:
from zmxtools import zar
zar.extract('mylens.zar')
zar.repack('mylens.zar')
zar.read('mylens.zar')
Python pathlib.Path objects can be used instead of strings.
Online documentation
The latest version of the API Documentation is published on https://zmxtools.readthedocs.io/. The documentation is generated automatically in the docs/ directory from the source code.
Contributing to the source code
The complete source code can be found on github: https://github.com/tttom/zmxtools. Check out Contributing for details.
License
This code is distributed under the agpl3: GNU Affero General Public License
Credits
- Wouter Vermaelen for decoding the ZAR header and finding LZW compressed contents.
- Bertrand Bordage for sharing this gist.
- This project was generated with
wemake-python-package. Current template version is: cfbc9ea21c725ba5b14c33c1f52d886cfde94416. See what is updated since then.
Related Software
- Optical ToolKit reads Zemax .zmx files.
- RayTracing reads Zemax .zmx files.
- Zemax Glass reads Zemax .agf files.
- RayOptics reads Zemax .zmx and CODE-V .seq files.
- RayOpt reads Zemax .zmx as well as OSLO files.
- OpticsPy does not read Zemax .zmx files but reads CODE-V .seq files and glass information from data downloaded from https://www.refractiveindex.info/.
- OpticalGlass reads glass manufacturer Excel sheets.
Metadata
Release files for zmxtools 0.1.5
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 |
|---|---|---|---|---|
| zmxtools-0.1.5.tar.gz | 22.2 kB | Without provenance | Details for zmxtools-0.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| zmxtools-0.1.5-py3-none-any.whl | Python 3 | none | any | Details for zmxtools-0.1.5-py3-none-any.whl |
Total release size: 43.7 kB
Release files / zmxtools-0.1.5.tar.gz
| Download URL | zmxtools-0.1.5.tar.gz |
|---|---|
| Size | 22.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3635f077939b754073e8612be78bf3e22a0c5bb855eeb14f48a146825839a97e
|
|
BLAKE2b-256 checksum How to use checksums |
9e7571ac464a533af4f378e24739690b561879626bd8b1a472f24dc28be945ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.1 CPython/3.10.7 Linux/5.19.0-38-generic
|
Release files / zmxtools-0.1.5-py3-none-any.whl
| Download URL | zmxtools-0.1.5-py3-none-any.whl |
|---|---|
| Size | 21.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bc4f63e986bc22315c0dac1f34064dbdcf8f44fb401b03e2b6ca5c6318c4bea9
|
|
BLAKE2b-256 checksum How to use checksums |
e6c047d130b4fd943d9607db8045722dcd413b8f23d1cd54012ea0631f2b9224
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.1 CPython/3.10.7 Linux/5.19.0-38-generic
|
Security for zmxtools 0.1.5
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.