Skip to main content

Toolkit to read Zemax OpticStudio files.

Project description

ZmxTools

Build Status codecov Python Version wemake-python-styleguide

A toolkit to read Zemax files.

Currently this is limited to unpacking ZAR archives. To parse the files contained within the archive, 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 unzar command.
  • Repack a ZAR file as a standard zip file using the unzar -z command.
  • Use as a pure Python 3 library.
  • Fully typed with annotations and checked with mypy, PEP561 compatible

Installation

Prerequisites

  • Python 3.7 (tested on Python 3.8)
  • pip, the Python package manager

To install zmxtools, just run the following command in a command shell:

pip install zmxtools

Usage

This package can be used directly from a terminal shell or from your own Python code.

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

Input and output can be specified.

unzar -h
unzar -i mylens.zar -o some/where/else/

More information and alternative options:

unzar -h
unzar -i mylens.zar -o some/where/else/

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

The latest version of the source code can be found on github: https://github.com/tttom/zmxtools

License

This code is distributed under the agpl3: GNU Affero General Public License

Credits

Related Software

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

zmxtools-0.1.1.tar.gz (19.8 kB view hashes)

Uploaded Source

Built Distribution

zmxtools-0.1.1-py3-none-any.whl (19.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page