Introduction
Pytemscript is a Python package designed around standard and advanced scripting interfaces of Thermo Fisher Scientific and FEI transmission electron microscopes. The functionality is limited to the functionality of the original COM scripting interfaces. For detailed information about TEM scripting see the documentation accompanying your microscope.
The pytemscript package provides a client API to connect both locally and remotely to the microscope PC. Currently, the minimum supported Python version is 3.4, so you should be able to control TEM instruments operating Windows XP or newer OS. This allows us to support scripting on a wide range of TEM platforms including Tecnai, Talos and Titan.
This is a GPL fork of the original BSD-licensed project: https://github.com/niermann/temscript New changes and this whole product is distributed under either version 3 of the GPL License, or (at your option) any later version.
Documentation
The source code is available at https://github.com/azazellochg/pytemscript
The documentation can be found at https://pytemscript.readthedocs.io
Quick example
Execute this on the microscope PC to create an instance of the local Microscope class:
from pytemscript.microscope import Microscope
microscope = Microscope()
Show the current acceleration voltage:
microscope.gun.voltage
300.0
Move beam:
shift = microscope.optics.illumination.beam_shift
shift += (0.4, 0.2)
shift *= 2
microscope.optics.illumination.beam_shift = shift
Take an image:
image = microscope.acquisition.acquire_tem_image("BM-Ceta",
size=AcqImageSize.FULL, # <-- see enumerations
exp_time=0.5,
binning=2)
image.save("img.mrc")
Disclaimer
Copyright (c) 2012-2021 by Tore Niermann Contact: tore.niermann (at) tu-berlin.de
Copyright (c) 2022-2026 by Grigory Sharov Contact: gsharov (at) mrclmb.ac.uk
All product and company names are trademarks or registered trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Metadata
Release files for pytemscript 3.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pytemscript-3.0.1.tar.gz | 75.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pytemscript-3.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 156.3 kB
Release files / pytemscript-3.0.1.tar.gz
| Download URL | pytemscript-3.0.1.tar.gz |
|---|---|
| Size | 75.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bc13a03f99506778dbc91c087489a5bedc23f273811c34fe5f8295407f6e1403
|
|
BLAKE2b-256 checksum How to use checksums |
8f831576a3746e2d0da2b630c2ca423810c0e9acd22985e609fc502f93258a62
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 29, 2026.
Transparency logRelease files / pytemscript-3.0.1-py3-none-any.whl
| Download URL | pytemscript-3.0.1-py3-none-any.whl |
|---|---|
| Size | 80.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7ae47ff10dbd14bbff1fb390d0ca7db9fc8a77872471ec00bffbe523013392c5
|
|
BLAKE2b-256 checksum How to use checksums |
563033c4dfd6d0141a72ac256ce0da86f80f8fbad58a0d732b752f8b1773e830
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 29, 2026.
Transparency log