Skip to main content

Python interface for AtomForge: load, edit, and view atomic structures

Project description

Load, programmatically edit, and launch the AtomForge GUI to view atomic structures directly from Python.

Quick-start

import atomforge as af

# Load any format (XYZ/extXYZ natively; CIF/VASP/PDB via ase extra)
s = af.load("crystal.cif")

# Build from scratch
s2 = af.Structure()
s2.set_cell(2.87, 2.87, 2.87)   # BCC iron unit cell
s2.add_atom("Fe", 0.0,   0.0,   0.0)
s2.add_atom("Fe", 1.435, 1.435, 1.435)

# Supercell + open in the AtomForge GUI (non-blocking)
s2.repeat(4, 4, 4).view()

# Edit and save
s2.translate(1, 0, 0).save("shifted.xyz")

Formats

XYZ and extended-XYZ are handled natively with no dependencies. CIF, VASP/POSCAR, PDB, LAMMPS, mol2, and all other ASE-supported formats are available via the ase extra:

pip install "atomforge[ase]"

Viewing

structure.view() serialises the structure to a temporary XYZ file and launches the AtomForge executable as a detached subprocess. Set the ATOMFORGE_PATH environment variable to the full path of AtomForge.exe if it is not on PATH.

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

atomforge_py-0.1.0.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

atomforge_py-0.1.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file atomforge_py-0.1.0.tar.gz.

File metadata

  • Download URL: atomforge_py-0.1.0.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for atomforge_py-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9390ca976ca35cab0afa2198534107e53f8567ad8576a8919596b706b47ebea9
MD5 7de9089e628dc0048f25bc04a68adaf6
BLAKE2b-256 c8e25c63424d52b821ab9e4c970bac87d151af05878d15670b4d254963e37c77

See more details on using hashes here.

File details

Details for the file atomforge_py-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: atomforge_py-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for atomforge_py-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a1ad32350cc7c1fa76cf80de97979ed8ae99b471cf5b1a210e48793d0f458f25
MD5 45cfa9da23e70847d4f7b2d2850a92cc
BLAKE2b-256 9dc14ce9beb854cc29eb3185582079719baf047e2d569d3ecefeb3dec194e8e6

See more details on using hashes here.

Supported by

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