Atomorph
Atomorph
Atomorph is a tool for converting and manipulating atomic structure files. It supports conversions between various file formats, as well as handling atomic constraints.
Current Version: 1.0.4
Features
- Support for multiple file formats (VASP, XYZ, EXTXYZ, etc.)
- Multi-frame structure file processing
- Atomic constraints (fixed layers, specific elements, specific indices)
- Atom sorting
- Parallel processing
- Batch conversion of multiple files
- Directory traversal with pattern matching
- Both command-line and Python API interfaces
- Simplified command syntax with aliases
- Detailed logging and error handling
- Comprehensive documentation with bilingual support
Installation
pip install atomorph
Usage
Command-line Usage
Basic conversion (with short command):
atomorph c input.xyz output.vasp
Specify formats:
atomorph convert input.xyz output.vasp -if xyz -of vasp
Fix specific elements (with short parameters):
atomorph c input.xyz output.vasp -c "elements:C,H"
Sort atoms ascending (with short parameters):
atomorph c input.xyz output.vasp -s asc
Custom element order (with short parameters):
atomorph c input.xyz output.vasp -e "Si,O,H"
Batch Conversion
Convert all POSCAR files in a directory:
atomorph b input_dir/ output_dir/ -p POSCAR -of xyz
Convert with recursive search:
atomorph batch input_dir/ output_dir/ -p "*.vasp" -of xyz
Merge all structures into one file:
atomorph b input_dir/ output_dir/ -p POSCAR -of xyz -m
Python API Usage
from atomorph import StructureConverter, batch_convert
# Basic conversion
converter = StructureConverter()
converter.convert(
input_path="input.xyz",
output_path="output.vasp"
)
# Batch conversion
batch_convert(
input_dir="input_dir/",
output_dir="output_dir/",
pattern="POSCAR",
output_format="xyz"
)
# Merge all structures into one file
batch_convert(
input_dir="input_dir/",
output_dir="output_dir/",
pattern="*.vasp",
output_format="xyz",
merge_output=True
)
Version History
See CHANGELOG.md for a complete version history.
License
MIT
Atomorph 中文说明
Atomorph是一个用于转换和操作原子结构文件的工具,支持多种文件格式间的转换,以及原子约束的处理。
当前版本: 1.0.3
特性
- 支持多种文件格式转换(VASP, XYZ, EXTXYZ等)
- 支持多帧结构文件处理
- 支持原子约束(固定层、指定元素、指定索引)
- 支持原子排序
- 支持并行处理
- 支持批量转换多个文件
- 支持使用模式匹配遍历目录
- 命令行和Python API两种使用方式
- 简化的命令语法和别名
- 详细的日志和错误处理
- 全面的双语文档支持
安装
pip install atomorph
使用方法
命令行使用
基本转换(使用简短命令):
atomorph c input.xyz output.vasp
指定格式:
atomorph convert input.xyz output.vasp -if xyz -of vasp
固定特定元素(使用简短参数):
atomorph c input.xyz output.vasp -c "elements:C,H"
按升序排序原子(使用简短参数):
atomorph c input.xyz output.vasp -s asc
自定义元素顺序(使用简短参数):
atomorph c input.xyz output.vasp -e "Si,O,H"
批量转换
转换目录中的所有POSCAR文件:
atomorph b input_dir/ output_dir/ -p POSCAR -of xyz
递归搜索并转换文件:
atomorph batch input_dir/ output_dir/ -p "*.vasp" -of xyz
将所有结构合并为一个文件:
atomorph b input_dir/ output_dir/ -p POSCAR -of xyz -m
Python API使用
from atomorph import StructureConverter, batch_convert
# 基本转换
converter = StructureConverter()
converter.convert(
input_path="input.xyz",
output_path="output.vasp"
)
# 批量转换
batch_convert(
input_dir="input_dir/",
output_dir="output_dir/",
pattern="POSCAR",
output_format="xyz"
)
# 合并所有结构为一个文件
batch_convert(
input_dir="input_dir/",
output_dir="output_dir/",
pattern="*.vasp",
output_format="xyz",
merge_output=True
)
版本历史
完整的版本历史请参见CHANGELOG.md。
许可证
MIT
Metadata
Release files for atomorph 1.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| atomorph-1.0.5.tar.gz | 47.5 kB | Without provenance | Details for atomorph-1.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| atomorph-1.0.5-py3-none-any.whl | Python 3 | none | any | Details for atomorph-1.0.5-py3-none-any.whl |
Total release size: 101.1 kB
Release files / atomorph-1.0.5.tar.gz
| Download URL | atomorph-1.0.5.tar.gz |
|---|---|
| Size | 47.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
54780586767fcf4e3e86e8e90348819ac1092dd424166b6bde3e672e1e239a03
|
|
BLAKE2b-256 checksum How to use checksums |
6c36cd9d2e62086d87f98c40d9721ac495396fa13b94a39668daa5aeb9eb4e1a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Release files / atomorph-1.0.5-py3-none-any.whl
| Download URL | atomorph-1.0.5-py3-none-any.whl |
|---|---|
| Size | 53.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a7029d811f8f71838f3f60675b5a52ab287ddb53883a8924751634b28c923739
|
|
BLAKE2b-256 checksum How to use checksums |
5877cf7bcf81feef15b3698fd9391e0dcf2dba9b6649d69729751473605f3b32
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Security for atomorph 1.0.5
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.