phystool.pdbfile
Module Contents
Classes
Data
API
- phystool.pdbfile.logger
“getLogger(…)”
- class phystool.pdbfile.PDBFile(id: int, uuid: uuid.UUID, pdb_type: str, standalone: bool, title: str, tags: phystool.tags.Tags, references: list[uuid.UUID])
Initialization
- UUID_PATTERN
“compile(…)”
- classmethod validate_type(list_of_types: str) list[str]
- classmethod from_record(pdb_record: phystool.physql.models.PDBRecord) phystool.pdbfile.PDBFile
- classmethod from_file(key: uuid.UUID | pathlib.Path) phystool.pdbfile.PDBFile
Loops over all possible
VALID_PDB_TYPESand checks if the regex matches the “.tex” file. When a match is found, it parses the.texfile to extract the PDB_TYPE, the optional title and all references to other PDBFiles. The tags are read from the related.jsonfile if it exists.- Renvoie:
PDBFile
- property tex_file: pathlib.Path
- save() None
Saves the .json file
- update_tags(session: sqlalchemy.orm.session.Session, to_remove: phystool.tags.Tags = Tags({}), to_add: phystool.tags.Tags = Tags({})) None
Update the tags, both in the SQL database and in the .json file
- create_tmp_tex_file() pathlib.Path
- compile(verbose: bool) None
- zip() None
Create a “.zip” file containing the “.tex” and “.pdf” files of the current PDBFile and its references