phystool.physql.metadata

Module Contents

Functions

stats

consolidate

Wrapper function around `create_sql_database()” that prints a minimalistic progress bar in the terminal

create_sql_database

Create the SQL database by analysing all “.tex” and related “.json” files

filter_pdb_files

Returns a list of PDBFile that match search criteria

filter_pdb_files_by_uuids

update_pdb_file

remove_pdb_files

Remove all files related to the PDBFiles. If the database is managed by git, the files can be recovered. The PDBRecords are also deleted.

create_new_tag

update_tags

Update the tags, both in the SQL database and in the .json file

Data

logger

API

phystool.physql.metadata.logger

“getLogger(…)”

phystool.physql.metadata.stats() dict[str, str | int | Sequence[str] | dict[str, list[str]]]
phystool.physql.metadata.consolidate() None

Wrapper function around `create_sql_database()” that prints a minimalistic progress bar in the terminal

phystool.physql.metadata.create_sql_database() Iterator[tuple[int, int, str]]

Create the SQL database by analysing all “.tex” and related “.json” files

phystool.physql.metadata.filter_pdb_files(query: str, uuid_bit: str, pdb_types: set[str], selected_tags: phystool.tags.Tags, excluded_tags: phystool.tags.Tags) list[phystool.pdbfile.PDBFile]

Returns a list of PDBFile that match search criteria

Paramètres:
  • query – string that should appear in the “.tex” file

  • uuid_bit – string that should match part of a uuid

  • pdb_type_set – restrain search only to those file types

  • selected_tags – restrain search to the PDBFiles tagged with any of the selected_tags

  • excluded_tags – exclude PDBFiles tagged with any of the excluded_tags

phystool.physql.metadata.filter_pdb_files_by_uuids(uuids: list[uuid.UUID]) list[phystool.pdbfile.PDBFile]
phystool.physql.metadata.update_pdb_file(uuid: uuid.UUID) None
phystool.physql.metadata.remove_pdb_files(uuids: list[uuid.UUID]) None

Remove all files related to the PDBFiles. If the database is managed by git, the files can be recovered. The PDBRecords are also deleted.

phystool.physql.metadata.create_new_tag(category_name: str, tag_name: str) None
phystool.physql.metadata.update_tags(pdb_file: phystool.pdbfile.PDBFile, session: sqlalchemy.orm.session.Session, to_remove_ids: set[int], to_add_ids: set[int]) None

Update the tags, both in the SQL database and in the .json file