# qgoferutils
<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->
## Install
``` sh
pip install qgoferutils
```
### Or
``` sh
conda install qgofer::qgoferutils
```
### Available classes in qgoferutils are:
- Configuration Module
``` sh
from qgoferutils.config import QGoferConfig, create_config_table
```
- Database Module
``` sh
from qgoferutils.db import QGoferDBWrapper
```
- Logger Module
``` sh
from qgoferutils.logger import get_logger, get_log_path
```
- Requests Module
``` sh
from qgoferutils.requests import make_api_request, get_failed_response
```
- Utility Functions Module
``` sh
from qgoferutils import get_env_var, generate_uuid, init_path
```
### Code Snippets or Examples
``` python
pip install qgoferutils
```
Requirement already satisfied: qgoferutils in c:\users\admi\miniconda3\envs\env4\lib\site-packages (0.0.7)
Requirement already satisfied: orjson in c:\users\admi\miniconda3\envs\env4\lib\site-packages (from qgoferutils) (3.9.10)
Requirement already satisfied: requests in c:\users\admi\miniconda3\envs\env4\lib\site-packages (from qgoferutils) (2.31.0)
Requirement already satisfied: aiofiles in c:\users\admi\miniconda3\envs\env4\lib\site-packages (from qgoferutils) (22.1.0)
Requirement already satisfied: charset-normalizer<4,>=2 in c:\users\admi\miniconda3\envs\env4\lib\site-packages (from requests->qgoferutils) (2.0.4)
Requirement already satisfied: idna<4,>=2.5 in c:\users\admi\miniconda3\envs\env4\lib\site-packages (from requests->qgoferutils) (3.4)
Requirement already satisfied: urllib3<3,>=1.21.1 in c:\users\admi\miniconda3\envs\env4\lib\site-packages (from requests->qgoferutils) (2.1.0)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\admi\miniconda3\envs\env4\lib\site-packages (from requests->qgoferutils) (2024.2.2)
Note: you may need to restart the kernel to use updated packages.
#### Example 1: Configuring QGofer
``` python
from qgoferutils.config import QGoferConfig, create_config_table
# Create a QGoferConfig instance
config_instance = QGoferConfig()
# Accessing attributes of QGoferConfig
print("Home directory:", config_instance.home)
print("Root directory:", config_instance.root_dir)
```
2024-03-09 18:57:17,308 - qgofer - INFO - Logging to C:\Users\admi\.qgofer\logs/W87gwqBURyOma4QkPG6L2g_log_24_03_09_18_57_17.log
Home directory: C:\Users\admi
Root directory: C:\Users\admi
#### Example 2: Interacting with the Database
``` python
from qgoferutils.db import QGoferDBWrapper
# Initialize QGoferDBWrapper with a specific database path
db_wrapper = QGoferDBWrapper("C:/data/dbb")
```
#### Example 3: Logging in QGofer
``` python
from qgoferutils.logger import get_logger, get_log_path
# Get a logger with a specified log path
logger = get_logger("C:/data/db")
logger.debug("Debug message")
# Get the log path
log_path = get_log_path("")
print("Log path:", log_path)
```
2024-03-09 18:57:17,500 - qgofer - DEBUG - Debug message
Log path: C:\Users\admi\saf-app\qgofertext\nbs
#### Example 4: Making API Requests
``` python
!pip install nest_asyncio
```
``` python
import nest_asyncio
from qgoferutils.requests import make_api_request, get_failed_response
nest_asyncio.apply()
async def main():
# Make an API request to https://httpbin.org/get asynchronously
api_url = "https://httpbin.org/get"
response = await make_api_request(api_url)
print("API Response:", response)
# Run the event loop
asyncio.run(main())
```
API Response: <Response [200]>
Raw data
{
"_id": null,
"home_page": "https://github.com/qgofer/qgoferutils",
"name": "qgoferutils",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "nbdev jupyter notebook python qgofer",
"author": "acquayefrank",
"author_email": "acquayefrank@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/be/c2/d10fdad06eb27f30040add6f6a20db976828af92927fe2530ab20489a50e/qgoferutils-0.0.8.tar.gz",
"platform": null,
"description": "# qgoferutils\r\n\r\n\r\n<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->\r\n\r\n## Install\r\n\r\n``` sh\r\npip install qgoferutils\r\n```\r\n\r\n### Or\r\n\r\n``` sh\r\nconda install qgofer::qgoferutils\r\n```\r\n\r\n### Available classes in qgoferutils are:\r\n\r\n- Configuration Module\r\n\r\n``` sh\r\nfrom qgoferutils.config import QGoferConfig, create_config_table\r\n```\r\n\r\n- Database Module\r\n\r\n``` sh\r\nfrom qgoferutils.db import QGoferDBWrapper\r\n```\r\n\r\n- Logger Module\r\n\r\n``` sh\r\nfrom qgoferutils.logger import get_logger, get_log_path\r\n```\r\n\r\n- Requests Module\r\n\r\n``` sh\r\nfrom qgoferutils.requests import make_api_request, get_failed_response\r\n```\r\n\r\n- Utility Functions Module\r\n\r\n``` sh\r\nfrom qgoferutils import get_env_var, generate_uuid, init_path\r\n```\r\n\r\n### Code Snippets or Examples\r\n\r\n``` python\r\npip install qgoferutils\r\n```\r\n\r\n Requirement already satisfied: qgoferutils in c:\\users\\admi\\miniconda3\\envs\\env4\\lib\\site-packages (0.0.7)\r\n Requirement already satisfied: orjson in c:\\users\\admi\\miniconda3\\envs\\env4\\lib\\site-packages (from qgoferutils) (3.9.10)\r\n Requirement already satisfied: requests in c:\\users\\admi\\miniconda3\\envs\\env4\\lib\\site-packages (from qgoferutils) (2.31.0)\r\n Requirement already satisfied: aiofiles in c:\\users\\admi\\miniconda3\\envs\\env4\\lib\\site-packages (from qgoferutils) (22.1.0)\r\n Requirement already satisfied: charset-normalizer<4,>=2 in c:\\users\\admi\\miniconda3\\envs\\env4\\lib\\site-packages (from requests->qgoferutils) (2.0.4)\r\n Requirement already satisfied: idna<4,>=2.5 in c:\\users\\admi\\miniconda3\\envs\\env4\\lib\\site-packages (from requests->qgoferutils) (3.4)\r\n Requirement already satisfied: urllib3<3,>=1.21.1 in c:\\users\\admi\\miniconda3\\envs\\env4\\lib\\site-packages (from requests->qgoferutils) (2.1.0)\r\n Requirement already satisfied: certifi>=2017.4.17 in c:\\users\\admi\\miniconda3\\envs\\env4\\lib\\site-packages (from requests->qgoferutils) (2024.2.2)\r\n Note: you may need to restart the kernel to use updated packages.\r\n\r\n#### Example 1: Configuring QGofer\r\n\r\n``` python\r\nfrom qgoferutils.config import QGoferConfig, create_config_table\r\n\r\n# Create a QGoferConfig instance\r\nconfig_instance = QGoferConfig()\r\n\r\n# Accessing attributes of QGoferConfig\r\nprint(\"Home directory:\", config_instance.home)\r\nprint(\"Root directory:\", config_instance.root_dir)\r\n```\r\n\r\n 2024-03-09 18:57:17,308 - qgofer - INFO - Logging to C:\\Users\\admi\\.qgofer\\logs/W87gwqBURyOma4QkPG6L2g_log_24_03_09_18_57_17.log\r\n Home directory: C:\\Users\\admi\r\n Root directory: C:\\Users\\admi\r\n\r\n#### Example 2: Interacting with the Database\r\n\r\n``` python\r\nfrom qgoferutils.db import QGoferDBWrapper\r\n\r\n# Initialize QGoferDBWrapper with a specific database path\r\ndb_wrapper = QGoferDBWrapper(\"C:/data/dbb\")\r\n```\r\n\r\n#### Example 3: Logging in QGofer\r\n\r\n``` python\r\nfrom qgoferutils.logger import get_logger, get_log_path\r\n\r\n# Get a logger with a specified log path\r\nlogger = get_logger(\"C:/data/db\")\r\nlogger.debug(\"Debug message\")\r\n\r\n# Get the log path\r\nlog_path = get_log_path(\"\")\r\nprint(\"Log path:\", log_path)\r\n```\r\n\r\n 2024-03-09 18:57:17,500 - qgofer - DEBUG - Debug message\r\n Log path: C:\\Users\\admi\\saf-app\\qgofertext\\nbs\r\n\r\n#### Example 4: Making API Requests\r\n\r\n``` python\r\n!pip install nest_asyncio\r\n```\r\n\r\n``` python\r\nimport nest_asyncio\r\nfrom qgoferutils.requests import make_api_request, get_failed_response\r\n\r\nnest_asyncio.apply()\r\n\r\nasync def main():\r\n # Make an API request to https://httpbin.org/get asynchronously\r\n api_url = \"https://httpbin.org/get\"\r\n response = await make_api_request(api_url)\r\n print(\"API Response:\", response)\r\n\r\n# Run the event loop\r\nasyncio.run(main())\r\n```\r\n\r\n API Response: <Response [200]>\r\n",
"bugtrack_url": null,
"license": "Apache Software License 2.0",
"summary": "Utility functions that cut across most qgofer projects",
"version": "0.0.8",
"project_urls": {
"Homepage": "https://github.com/qgofer/qgoferutils"
},
"split_keywords": [
"nbdev",
"jupyter",
"notebook",
"python",
"qgofer"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "062587acd2b2ccb16a6455c3ff3ecb95131b1e3e5e0966010a2465cfde781d8f",
"md5": "80b8af89dec4d3a39c04635982eb9739",
"sha256": "a732517fb665f41135ac48d1e3a338e6c473e8fedb948d8f226592f9c573d4b3"
},
"downloads": -1,
"filename": "qgoferutils-0.0.8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "80b8af89dec4d3a39c04635982eb9739",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 15040,
"upload_time": "2024-05-01T17:29:24",
"upload_time_iso_8601": "2024-05-01T17:29:24.361855Z",
"url": "https://files.pythonhosted.org/packages/06/25/87acd2b2ccb16a6455c3ff3ecb95131b1e3e5e0966010a2465cfde781d8f/qgoferutils-0.0.8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "bec2d10fdad06eb27f30040add6f6a20db976828af92927fe2530ab20489a50e",
"md5": "11afe208eed13f496bb78c28074fc979",
"sha256": "64055517e3a468f30ebcff3d2ec75a37e4e3f0d93ee19facae372fb8eee21805"
},
"downloads": -1,
"filename": "qgoferutils-0.0.8.tar.gz",
"has_sig": false,
"md5_digest": "11afe208eed13f496bb78c28074fc979",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 15324,
"upload_time": "2024-05-01T17:29:25",
"upload_time_iso_8601": "2024-05-01T17:29:25.632995Z",
"url": "https://files.pythonhosted.org/packages/be/c2/d10fdad06eb27f30040add6f6a20db976828af92927fe2530ab20489a50e/qgoferutils-0.0.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-01 17:29:25",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "qgofer",
"github_project": "qgoferutils",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "qgoferutils"
}