zmxtools


Namezmxtools JSON
Version 0.1.5 PyPI version JSON
download
home_pagehttps://github.com/tttom/zmxtools
SummaryToolkit to read Zemax OpticStudio files.
upload_time2023-04-08 16:00:57
maintainer
docs_urlNone
authorTom Vettenburg
requires_python>=3.8,<4.0
licenseAGPL3
keywords optical design lens design zemax zemax archive (zar)
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ZmxTools

[![Build Status](https://github.com/tttom/zmxtools/workflows/test/badge.svg?branch=main)](https://github.com/tttom/zmxtools/actions?query=workflow%3Atest)
[![Documentation Status](https://readthedocs.org/projects/zmxtools/badge/?version=latest)](https://readthedocs.org/projects/zmxtools)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/zmxtools)](https://www.python.org/downloads)
[![PyPI - License](https://img.shields.io/pypi/l/zmxtools)](https://opensource.org/licenses/AGPL-3.0)
[![PyPI](https://img.shields.io/pypi/v/zmxtools?label=version&color=808000)](https://github.com/tttom/ZmxTools/tree/master/python)
[![PyPI - Status](https://img.shields.io/pypi/status/zmxtools)](https://pypi.org/project/zmxtools/tree/master/python)
[![PyPI - Wheel](https://img.shields.io/pypi/wheel/zmxtools?label=python%20wheel)](https://pypi.org/project/zmxtools/#files)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/zmxtools)](https://pypi.org/project/zmxtools/)
[![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/tttom/ZmxTools)](https://github.com/tttom/ZmxTools)
[![GitHub last commit](https://img.shields.io/github/last-commit/tttom/ZmxTools)](https://github.com/tttom/ZmxTools)
[![Libraries.io dependency status for latest release](https://img.shields.io/librariesio/release/pypi/zmxtools)](https://libraries.io/pypi/zmxtools)
[![wemake-python-styleguide](https://img.shields.io/badge/style-wemake-000000.svg)](https://github.com/wemake-services/wemake-python-styleguide)
[![codecov](https://codecov.io/gh/tttom/zmxtools/branch/main/graph/badge.svg)](https://codecov.io/gh/tttom/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](#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](https://www.python.org/dev/peps/pep-0561/)

## Installation
### Prerequisites
- Python 3.8 or higher
- pip, the Python package manager

To install `zmxtools`, just run the following command in a command shell:
```bash
pip install zmxtools
```
The `zmxtools` library will color-code test output when the `coloredlogs` package is installed. You can optionally 
install it with
```bash
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](https://www.thorlabs.com).

### 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 
```console
unzar mylens.zar
```
Repacking the same zar-archive as a standard zip-archive `mylens.zip` is done with:
```console
unzar mylens.zar -z
```
Multiple input files and an alternative output directory can be specified: 
```console
unzar -i *.zar -o some/where/else/
```
Find out more information and alternative options using:
```console
unzar -h
```

### As a Python library
Extraction and repacking can be done programmatically as follows:
```python
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](docs) from the source code. 

## Contributing to the source code
The complete source code can be found on [github: https://github.com/tttom/zmxtools](https://github.com/tttom/zmxtools).
Check out [Contributing](CONTRIBUTING.md) for details.

## License
This code is distributed under the
[agpl3: GNU Affero General Public License](https://www.gnu.org/licenses/agpl-3.0.en.html)

## Credits
- [Wouter Vermaelen](https://github.com/m9710797) for decoding the ZAR header and finding LZW compressed contents.
- [Bertrand Bordage](https://github.com/BertrandBordage) for sharing this [gist](https://gist.github.com/BertrandBordage/611a915e034c47aa5d38911fc0bc7df9).
- This project was generated with [`wemake-python-package`](https://github.com/wemake-services/wemake-python-package). Current template version is: [cfbc9ea21c725ba5b14c33c1f52d886cfde94416](https://github.com/wemake-services/wemake-python-package/tree/cfbc9ea21c725ba5b14c33c1f52d886cfde94416). See what is [updated](https://github.com/wemake-services/wemake-python-package/compare/cfbc9ea21c725ba5b14c33c1f52d886cfde94416...master) since then.

## Related Software
- [Optical ToolKit](https://github.com/draustin/otk) reads Zemax .zmx files.
- [RayTracing](https://github.com/DCC-Lab/RayTracing) reads Zemax .zmx files.
- [Zemax Glass](https://github.com/nzhagen/zemaxglass) reads Zemax .agf files.
- [RayOptics](https://github.com/mjhoptics/ray-optics) reads Zemax .zmx and CODE-V .seq files.
- [RayOpt](https://github.com/quartiq/rayopt) reads Zemax .zmx as well as OSLO files.
- [OpticsPy](https://github.com/Sterncat/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](https://github.com/mjhoptics/opticalglass) reads glass manufacturer Excel sheets.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/tttom/zmxtools",
    "name": "zmxtools",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "Optical Design,Lens Design,Zemax,Zemax Archive (ZAR)",
    "author": "Tom Vettenburg",
    "author_email": "tom.vettenburg@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/9e/75/71ac464a533af4f378e24739690b561879626bd8b1a472f24dc28be945ca/zmxtools-0.1.5.tar.gz",
    "platform": null,
    "description": "# ZmxTools\n\n[![Build Status](https://github.com/tttom/zmxtools/workflows/test/badge.svg?branch=main)](https://github.com/tttom/zmxtools/actions?query=workflow%3Atest)\n[![Documentation Status](https://readthedocs.org/projects/zmxtools/badge/?version=latest)](https://readthedocs.org/projects/zmxtools)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/zmxtools)](https://www.python.org/downloads)\n[![PyPI - License](https://img.shields.io/pypi/l/zmxtools)](https://opensource.org/licenses/AGPL-3.0)\n[![PyPI](https://img.shields.io/pypi/v/zmxtools?label=version&color=808000)](https://github.com/tttom/ZmxTools/tree/master/python)\n[![PyPI - Status](https://img.shields.io/pypi/status/zmxtools)](https://pypi.org/project/zmxtools/tree/master/python)\n[![PyPI - Wheel](https://img.shields.io/pypi/wheel/zmxtools?label=python%20wheel)](https://pypi.org/project/zmxtools/#files)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/zmxtools)](https://pypi.org/project/zmxtools/)\n[![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/tttom/ZmxTools)](https://github.com/tttom/ZmxTools)\n[![GitHub last commit](https://img.shields.io/github/last-commit/tttom/ZmxTools)](https://github.com/tttom/ZmxTools)\n[![Libraries.io dependency status for latest release](https://img.shields.io/librariesio/release/pypi/zmxtools)](https://libraries.io/pypi/zmxtools)\n[![wemake-python-styleguide](https://img.shields.io/badge/style-wemake-000000.svg)](https://github.com/wemake-services/wemake-python-styleguide)\n[![codecov](https://codecov.io/gh/tttom/zmxtools/branch/main/graph/badge.svg)](https://codecov.io/gh/tttom/zmxtools)\n\n### A toolkit to read Zemax files.\n\nCurrently, this is limited to unpacking ZAR archives. For further processing of the archive's contents, e.g. ZMX or AGF \nglass files, please check the [list of related software](#related-software) below.\n\n## Features\n- Unpack a Zemax OpticStudio\u00ae Archive ZAR file using the `unzar` command.\n- Repack a ZAR file as a standard zip file using the `unzar -z` command.\n- Use as a pure Python 3 library.\n- Fully typed with annotations and checked with mypy, [PEP561 compatible](https://www.python.org/dev/peps/pep-0561/)\n\n## Installation\n### Prerequisites\n- Python 3.8 or higher\n- pip, the Python package manager\n\nTo install `zmxtools`, just run the following command in a command shell:\n```bash\npip install zmxtools\n```\nThe `zmxtools` library will color-code test output when the `coloredlogs` package is installed. You can optionally \ninstall it with\n```bash\npip install coloredlogs\n```\n\n## Usage\nThis package can be used directly from a terminal shell or from your own Python code.\nExample files can be found on manufacturer's sites such as [Thorlabs Inc](https://www.thorlabs.com).\n\n### Command line shell\nThe command `unzar` is added to the path upon installation. It permits the extraction of the zar-file to a sub-directory\nas well as its conversion to a standard zip-file. For example, extracting to the sub-directory `mylens` is done using \n```console\nunzar mylens.zar\n```\nRepacking the same zar-archive as a standard zip-archive `mylens.zip` is done with:\n```console\nunzar mylens.zar -z\n```\nMultiple input files and an alternative output directory can be specified: \n```console\nunzar -i *.zar -o some/where/else/\n```\nFind out more information and alternative options using:\n```console\nunzar -h\n```\n\n### As a Python library\nExtraction and repacking can be done programmatically as follows:\n```python\nfrom zmxtools import zar\n\nzar.extract('mylens.zar')\nzar.repack('mylens.zar')\nzar.read('mylens.zar')\n```\nPython `pathlib.Path` objects can be used instead of strings.\n\n## Online documentation\nThe latest version of the API Documentation is published on https://zmxtools.readthedocs.io/.\nThe documentation is generated automatically in the [docs/ directory](docs) from the source code. \n\n## Contributing to the source code\nThe complete source code can be found on [github: https://github.com/tttom/zmxtools](https://github.com/tttom/zmxtools).\nCheck out [Contributing](CONTRIBUTING.md) for details.\n\n## License\nThis code is distributed under the\n[agpl3: GNU Affero General Public License](https://www.gnu.org/licenses/agpl-3.0.en.html)\n\n## Credits\n- [Wouter Vermaelen](https://github.com/m9710797) for decoding the ZAR header and finding LZW compressed contents.\n- [Bertrand Bordage](https://github.com/BertrandBordage) for sharing this [gist](https://gist.github.com/BertrandBordage/611a915e034c47aa5d38911fc0bc7df9).\n- This project was generated with [`wemake-python-package`](https://github.com/wemake-services/wemake-python-package). Current template version is: [cfbc9ea21c725ba5b14c33c1f52d886cfde94416](https://github.com/wemake-services/wemake-python-package/tree/cfbc9ea21c725ba5b14c33c1f52d886cfde94416). See what is [updated](https://github.com/wemake-services/wemake-python-package/compare/cfbc9ea21c725ba5b14c33c1f52d886cfde94416...master) since then.\n\n## Related Software\n- [Optical ToolKit](https://github.com/draustin/otk) reads Zemax .zmx files.\n- [RayTracing](https://github.com/DCC-Lab/RayTracing) reads Zemax .zmx files.\n- [Zemax Glass](https://github.com/nzhagen/zemaxglass) reads Zemax .agf files.\n- [RayOptics](https://github.com/mjhoptics/ray-optics) reads Zemax .zmx and CODE-V .seq files.\n- [RayOpt](https://github.com/quartiq/rayopt) reads Zemax .zmx as well as OSLO files.\n- [OpticsPy](https://github.com/Sterncat/opticspy) does not read Zemax .zmx files but reads CODE-V .seq files and\n  glass information from data downloaded from https://www.refractiveindex.info/.\n- [OpticalGlass](https://github.com/mjhoptics/opticalglass) reads glass manufacturer Excel sheets.\n",
    "bugtrack_url": null,
    "license": "AGPL3",
    "summary": "Toolkit to read Zemax OpticStudio files.",
    "version": "0.1.5",
    "split_keywords": [
        "optical design",
        "lens design",
        "zemax",
        "zemax archive (zar)"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e6c047d130b4fd943d9607db8045722dcd413b8f23d1cd54012ea0631f2b9224",
                "md5": "f3db27191e16a42082f909aa92d5f320",
                "sha256": "bc4f63e986bc22315c0dac1f34064dbdcf8f44fb401b03e2b6ca5c6318c4bea9"
            },
            "downloads": -1,
            "filename": "zmxtools-0.1.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f3db27191e16a42082f909aa92d5f320",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 21555,
            "upload_time": "2023-04-08T16:00:55",
            "upload_time_iso_8601": "2023-04-08T16:00:55.577967Z",
            "url": "https://files.pythonhosted.org/packages/e6/c0/47d130b4fd943d9607db8045722dcd413b8f23d1cd54012ea0631f2b9224/zmxtools-0.1.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9e7571ac464a533af4f378e24739690b561879626bd8b1a472f24dc28be945ca",
                "md5": "f24cf0d7cbe864bf37e143655aa95820",
                "sha256": "3635f077939b754073e8612be78bf3e22a0c5bb855eeb14f48a146825839a97e"
            },
            "downloads": -1,
            "filename": "zmxtools-0.1.5.tar.gz",
            "has_sig": false,
            "md5_digest": "f24cf0d7cbe864bf37e143655aa95820",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 22180,
            "upload_time": "2023-04-08T16:00:57",
            "upload_time_iso_8601": "2023-04-08T16:00:57.621251Z",
            "url": "https://files.pythonhosted.org/packages/9e/75/71ac464a533af4f378e24739690b561879626bd8b1a472f24dc28be945ca/zmxtools-0.1.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-08 16:00:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "tttom",
    "github_project": "zmxtools",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "zmxtools"
}
        
Elapsed time: 0.08869s