config

This module provides the core config class for qgofer
!pip install black
Requirement already satisfied: black in c:\users\acqua\miniconda3\envs\qgoferutils\lib\site-packages (24.2.0)
Requirement already satisfied: click>=8.0.0 in c:\users\acqua\miniconda3\envs\qgoferutils\lib\site-packages (from black) (8.1.7)
Requirement already satisfied: mypy-extensions>=0.4.3 in c:\users\acqua\miniconda3\envs\qgoferutils\lib\site-packages (from black) (1.0.0)
Requirement already satisfied: packaging>=22.0 in c:\users\acqua\miniconda3\envs\qgoferutils\lib\site-packages (from black) (23.2)
Requirement already satisfied: pathspec>=0.9.0 in c:\users\acqua\miniconda3\envs\qgoferutils\lib\site-packages (from black) (0.12.1)
Requirement already satisfied: platformdirs>=2 in c:\users\acqua\miniconda3\envs\qgoferutils\lib\site-packages (from black) (4.2.0)
Requirement already satisfied: tomli>=1.1.0 in c:\users\acqua\miniconda3\envs\qgoferutils\lib\site-packages (from black) (2.0.1)
Requirement already satisfied: typing-extensions>=4.0.1 in c:\users\acqua\miniconda3\envs\qgoferutils\lib\site-packages (from black) (4.10.0)
Requirement already satisfied: colorama in c:\users\acqua\miniconda3\envs\qgoferutils\lib\site-packages (from click>=8.0.0->black) (0.4.6)

source

QGoferConfig

 QGoferConfig (home:Path=Path('/home/runner'),
               root_dir:Path=Path('/home/runner'))

*The main appliation class for managing the entirety of qgofer.

Attributes: home: The home directory of the user, defaults to Path.home() root_dir: The root directory to index, defaults to Path.home()*


source

create_config_table

 create_config_table (qgofer_cache_db)

Create the qgofer config table.


source

store_hugging_face_token

 store_hugging_face_token (API_TOKEN, qgofer_cache_db)

store the hugging face api token

q = QGoferConfig()
create_config_table(q.qgofer_cache_db)
try:
    store_hugging_face_token("what a wow", q.qgofer_cache_db)
except IntegrityError as e:
    print("IntegrityError occurred:", e)
2024-03-07 21:36:20,578 - qgofer - INFO - Logging to C:\Users\acqua\.qgofer\logs/tOk1ii33REygYB2zGpzuaw_log_24_03_07_21_36_20.log
IntegrityError occurred: UNIQUE constraint failed: qgofer_config.key