A python wrapper for matgen dft API
Project description
matgen_rester
A python wrapper for Matgen DFT API. This code requires a python version >= 3.6
Prerequisites
The following python library must be installed to run the script
installation
pip install matgen-rester
Usage
1. import matgen_rester module
import matgen_rester as mr
example
with mr.MatgenRester(username="test",password="only for example") as m:
##return one structure
structure = q.get_structure_by_matid(matid='mat_3',fields=["matid","formula"])
##return list of data
list = q.get_structure_with_filter(elements="Ba-S", filter={"_nelements":"O-Ti"}, fields=['matid'], pages=5, pageno=0)
list2 =q.get_structure_with_filter(elements="Ba-S", filter={"_voume":[0,100],"_crystal_system":["cubic","tetragonal","hexagonal","trigonal","orthorhombic","monoclinic","triclinic","amorphous"]}, fields=['matid'], pages=5, pageno=0)
attributes
username, password
: matgen accounttoken
: user can get token key after logged in from matgenmatid
: matgen id of the structurefields
: return data fields, such as matid, icsd_id, formula, conventional_cell, conventional_cell_site, primitive_cell, primitive_cell_site, crystal_system, point_group,density, cif_data, magnetization, bandStructure, densityOfStates, poscar_cc, poscar_pc, same_file, poscar, kpoints_relax, kpoints_scf, kpathelements
: the set of elements that the compound must have ','_nelements
: the set of excluded elements that the compound must have ','
2. used in command line
example
python matgenrester.py -id mat_3
optional arguments:
-h, --help show this help message and exit
-e E, --elements E find the structures that contain the specific
elements, for more than one elements, connect elements
by '-', ex. Ba-S
-ne NE, --nelements NE
find the structures that do not contain the specific
elements,for more than one elements, connect elements
by '-', ex. Ba-S
-id ID, --matid ID find structures that have the same matid,ex.mat_1
-p P specify the number of return data
-s S specify the page index after pagination
-cs CS, --crystalSystem CS
filter data by its crystal system, such as cubic,tetra
gonal,hexagonal,trigonal,orthorhombic,monoclinic,tricl
inic,amorphous
-sg SG, --spaceGroup SG
filter data by its space group, specify space group
type, such as P1,P-1,P2,P21,C2,Pm,Pc,Cm,Cc,P2/m,P21m,P
2/c,P21c,C2/m,C2/c,P222,P2221,P21212,P212121,C222,C222
1,F222,I222,I212121,Pmm2,Pmc21,Pcc2,Pma2,Pca21,Pnc2,Pm
n21,Pba2,Pna21,Pnn2,Cmm2,Cmc21,Ccc2,Amm2,Abm2,Ama2,Aba
2,Fmm2,Fdd2,Imm2,Iba2,Ima2,Pmmm,Pnnn,Pccm,Pban,Pmma,Pn
na,Pmna,Pcca,Pbam,Pccn,Pbcm,Pnnm,Pmmn,Pbcn,Pbca,Pnma,C
mmm,Cmcm,Cmca,Cccm,Cmma,Ccca,Fmmm,Fddd,Immm,Ibam,Ibcm,
Imma,P4,P41,P42,P43,I4,I41,P-4,I-4,P4/m,P42/m,P4/n,P42
/n,I4/m,I41/a,P422,P4212,P4122,P41212,P4222,P42212,P43
22,P43212,I422,I4212,P4mm,P4bm,P42cm,P42nm,P4cc,P4nc,P
42mc,P42bc,I4mm,I4cm,I41md,I41cd,P-42m,P-42c,P-421m,P-
421c,I-42m,I-42d,P-4m2,P-4c2,P-4b2,P-4n2,I-4m2,I-4c2,P
4/mmm,P4/mcc,P4/nbm,P4/nnc,P4/mbm,P4/mnc,P4/nmm,P4/ncc
,P42/mmc,P42/mcm,P42/nbc,P42/nnm,P42/mbc,P42/mcm,P42/n
mc,P42/ncm,I4/mmm,I4/mcm,I41/amd,I41/acd,P3,P31,P32,R3
,P-3,R-3,P312,P3112,P3212,P321,P3121,P3221,R32,P31m,P3
1c,P3m1,P3c1,R3m,R3c,P-31m,P-31c,P-3m1,P-3c1,R-3m,R-3c
,P6,P61,P62,P63,P64,P65,P-6,P6/m,P63/m,P622,P6122,P622
2,P6322,P6422,P6522,P6mm,P6cc,P63cm,P63mc,P-6m2,P-6c2,
P-62m,P62c,P6/mmm,P6/mcc,P63/mcm,P63/mmc,P23,P213,F23,
I23,I213,Pm-3,Pn-3,Pa-3,Fm-3,Fd-3,Im-3,Ia-3,P432,P4232
,P4332,P4132,F432,F4132,I432,I4132,P-43m,P-43n,F-43m,F
-43c,I-43m,I-43d,Pm-3m,Pn-3n,Pm-3n,Pn-3m,Fm-3m,Fm-3m,F
d-3m,Fd-3c,Im-3m,Ia-3d
-v V, --volume V filter data by its volume, specify volume scope, such
as 0,100
-f F specify return data fields, such as matid, icsd_id,
formula, conventional_cell, conventional_cell_site, pr
imitive_cell,primitive_cell_site,crystal_system,point_
group,density,cif_data,magnetization, bandStructure,de
nsityOfStates,poscar_cc,poscar_pc,same_file,poscar,
kpoints_relax, kpoints_scf,kpath
-o O set file for downloading
-t T upload matgen token for seaching```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
matgen_rester-2.0.0.tar.gz
(12.0 kB
view hashes)
Built Distribution
Close
Hashes for matgen_rester-2.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c88ba55e807d84254470359272843f8f4f8ff828e62608e40e149c7c7472fcbd |
|
MD5 | e1711b3c319cafdc69134b7fac7fc477 |
|
BLAKE2b-256 | b3986e50c3b3735384fa8aa7037c8b2bc2df8945afa4d0f879f298e642818708 |