Alina Zhidkovskaya and Evgeny Blokhin
Tilde Materials Informatics and Materials Platform for Data Science LLC
dft-organizer is a command-line tool to manage data from density functional theory calculations using CRYSTAL and FLEUR engines.
It automates:
- Archiving calculation directories with 7z compression
- Parsing output files to generate detailed error reports and CSV summaries
- Cleaning up original calculation directories after archiving
It also supports unpacking 7z archives and restoring archived calculation directories recursively, with optional AiiDA UUID tracking.
Requires Python ≥ 3.11
Dependencies:
- click ≥ 8.1
- polars
- 7z (command-line tool)
Install via pip:
pip install .
dft-pack --path <directory_path> [--report|--no-report] [--aiida|--no-aiida] [--skip-errors|--no-skip-errors]
--pathPath to the calculation directory--reportGenerate error report and summary (default)--no-reportSkip report generation--aiidaExtract UUID from AiiDA directory structure--no-aiidaDo not extract UUID--skip-errorsSkip calculations with errors to create summary table
Creates:
<directory_name>.7zreport_crystal_<timestamp>.txtand/orreport_fleur_<timestamp>.txtsummary_<timestamp>.csv
dft-unpack --path <archive_or_directory_path> [--report|--no-report] [--aiida|--no-aiida] [--skip-errors|--no-skip-errors]
--pathPath to a .7z archive or directory with archives--reportGenerate summary and error reports after extraction (default)--no-reportSkip report generation--aiidaExtract UUID from AiiDA directory structure--no-aiidaDo not extract UUID--skip-errorsSkip calculations with errors to create summary table
Creates under parent directory:
summary_<timestamp>.csvreport_crystal_<timestamp>.txtreport_fleur_<timestamp>.txt
Example:
dft-report --path /data/aiida_data --aiida --skip-errors
dft-report --path <directory_path> [--aiida|--no-aiida] [--skip-errors|--no-skip-errors]
--pathRoot directory containing calculations--aiidaExtract UUID from AiiDA directory structure--no-aiidaDo not extract UUID--skip-errorsSkip calculations with errors to create summary table
Creates under parent directory:
summary_<timestamp>.csvreport_crystal_<timestamp>.txtreport_fleur_<timestamp>.txt
from pathlib import Path
from dft_organizer.core import archive_and_remove
archive_and_remove(
Path("./my_calc_dir"),
engine="crystal",
make_report=True,
aiida=True,
skip_errors=True
)
from pathlib import Path
from dft_organizer.core import restore_archives_iterative
restore_archives_iterative(
Path("./archive_dir.7z"),
engine="crystal",
generate_reports=True,
aiida=True,
skip_errors=False
)
from dft_organizer.core import generate_reports_only
from pathlib import Path
generate_reports_only(Path("/data/aiida"), aiida=True, skip_errors=True)
Generate report for a specific calculation UUID:
dft-pack report \
--path aiida_playground_data \
--uuid 0ea8a6be-7199-4c3e-9263-fae76e8d081e \
--engine crystal
Output files:
summary_uuid_<uuid>_<timestamp>.csverrors_uuid_<uuid>_<timestamp>.txt
total_energyTotal energy in eV (from CRYSTALenergy).energy_hartreeTotal energy converted to Hartree (total_energy / 27.2114).bandgapBand gap value from the last conduction entry (if available).durationCalculation wall-clock time (if reported by CRYSTAL).a,b,cLattice parameters in Å for the final structure.alpha,beta,gammaLattice angles in degrees for the final structure.chemical_formulaReduced chemical formula of the final structure (from ASE).sum_sq_dispSum of squared atomic displacements between first and last structure.rmsd_dispRoot-mean-square displacement between first and last structure.output_pathFull path to the main OUTPUT file for this calculation.uuidCalculation UUID (only in AiiDA mode, extracted from directory layout).