This is a utility package designed to enable data scientitists and analysts to easily access GDP data within a python environment
Project description
Gdp Tools Package
This is a utility package designed to enable data scientists and analysts to easily access GDP data within a python environment
Requirements:
- The data professional should be able to clone the package at the start of new project and when in production
- The package will contain a number of support functions serving the following objectives: -- Accessing data on GDP Base/CIM/Warehouse -- Accessing data in temp storage (LAB) -- Querying that data in SQL -- utlising that data as a Python/PySpark DataFrame -- Storing processed data to the temp storage space (LAB)
- any data access configs should available to be used
Credentials
Contact a member of the Laing O'Rourke Data Science team to set up up your credentials.
SERVER, DATABASE, USERNAME and PASSWORD need to be entered in as arguments when initailising the tool, for example '''gdp_tools = GlobalDataPlatformTools(SERVER, DATABASE, USERNAME,PWD)'''
The designation of SERVER and DATABASE will determining if you are accessing PROD or PREPROD data. It is strongly advised to PREPROD to avoid interfering with PROD systems.
Functionality
Should be used in Azure ML Studio. NO access to GDP locally. Generally functionality covers:
v0
- check/install drivers
- search GDP by table name
- query GDP with SQL
v1
- load/test a LLM
- access to CIM and Warehouse data
- store data
- access data from share point
GDP Tools
This module contains tools for accessing and storing data in the GDP.
The module will likely break if you use some of these functions successively. When changing between functionality, re-initialise the module with '''gdp_tools = GlobalDataPlatformTools(SERVER, DATABASE, USERNAME,PWD)'''
validate_odbc_drivers - check if the correct ODBC connectors are installed, install them as necessary automatically [check_odbc_driver, install_odbc_driver]
setup_odbc_connection - set up the ODBC with your credentials. Happens when class is initalised
query_gdp_to_pd - enter a SQL query as a string, return the data as a pandas dataframe
search_tables - will return a list of all table in the GDP. give it the argument 'source_system' = '[COINS]' to narrow your search for any table with the term 'COINS' in it (for example). Will also return the corresponding schema name and table type.
list_schema - list all available schema. This typically will include BASE, CIM and WAREHOUSE and variants on those.
save_df_to_lab_storage - provide a dataframe and location to save data into the LAB space in blob storage
load_df_from_lab - provide a location and load data from the LAB space in blob storage into a pandas dataframe
load_df_from_sharepoint - provide a URL and load data from the sharepoint into a pandas dataframe (NOT COMPLETED DO NOT USE)
LLM Tools
This module contains tools for access LOR LLM API end points
These methods require the following credentials, to be entered manually as arguments when initailised, for example '''llm = LORLargeLanguageModels(api_key,azure_endpoint)'''. Contact a member of the Data Science team to obtain these seperately.
tell_me_about_the_models_that_are_available - This function returns a pandas table with information about the models available. It covers cost, performance and accuracy. The numbers here were pulled from Chat GPT and checked, but may not be 100% accurate.
llm_architecture - the default architecture for using a chat gpt model. Takes guidence, prompt and the name of the model as strings.
test_llm - testing function, works for the pre-deffined list of models and a simple UAT prompt 'What is 2+2?'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lor_gdp_tools-1.2.8.tar.gz.
File metadata
- Download URL: lor_gdp_tools-1.2.8.tar.gz
- Upload date:
- Size: 24.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1cb1b8d24d80b67fa72891019f593cf42366cebe5fa75e365b568532df90d6fd
|
|
| MD5 |
92fc81d9c19435d5f9f8e4b976cb8be0
|
|
| BLAKE2b-256 |
4c3d690548f24f74f6001f78f0d6de86351d50e2c6b836cbbc9b45c65b94f374
|
File details
Details for the file lor_gdp_tools-1.2.8-py3-none-any.whl.
File metadata
- Download URL: lor_gdp_tools-1.2.8-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1c1327ba65b23b82260f4624b22dea74cf9f18c03cba1d921a3ed7d3a29be65
|
|
| MD5 |
164a3e5c7c0b151cc060c9e20d5f1a4a
|
|
| BLAKE2b-256 |
44e8be231d160d43670117560127c0f34ceee884e0c0fdb84ead30db7a8895e5
|