vyperdatum.db
Attributes
Classes
Module Contents
- vyperdatum.db.logger
- class vyperdatum.db.DB(db_dir: str | None = enuPDB.DIR.value)
- db_dir
- db_name
- update_db_path() bool
Prepend self.db_dir to pyproj.datadir which guides the pyproj to first look for the database at self.db_dir address.
- Raises:
ValueError: – If .db_dir is not set.
FileNotFoundError: – If the database file is not found.
- Returns:
True if the data_dir is set successfully, otherwise False.
- Return type:
- query(sql: str, dataframe: bool = False) list | None | pandas.DataFrame | None
Execute a sql query and return the response. This method is intended to run a read (scan) query. Avoid using this method for DML/DDL type operations.
- crs_by_keyword(keywords: list[str], dataframe: bool = False) list | None | pandas.DataFrame | None
Return a list (or dataframe) of CRS that their name or description contain the passed keywords. The search is not case-sensitive.
- Parameters:
- Raises:
TypeError: – If keywords is not a list of strings.
ValueError: – If no keywords is passed.
- Return type:
list or pd.DataFrame