Skip to main content

Toolkit to read Zemax OpticStudio files.

Project description

ZmxTools

Build Status Documentation Status PyPI - Python Version PyPI - License PyPI PyPI - Status PyPI - Wheel PyPI - Downloads GitHub code size in bytes GitHub last commit Libraries.io dependency status for latest release wemake-python-styleguide codecov

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 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.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

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.5.tar.gz (22.2 kB view hashes)

Uploaded Source

Built Distribution

zmxtools-0.1.5-py3-none-any.whl (21.6 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