Skip to main content

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

Code Checks Code Style

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)

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lor_gdp_tools-1.1.8.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lor_gdp_tools-1.1.8-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file lor_gdp_tools-1.1.8.tar.gz.

File metadata

  • Download URL: lor_gdp_tools-1.1.8.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.5

File hashes

Hashes for lor_gdp_tools-1.1.8.tar.gz
Algorithm Hash digest
SHA256 c2e694f033a5a464975baa9c0afb743319d96b289fa773c2c3e1f8b1cc3b8d09
MD5 500e0d3a0df38a3bdee6c6db3664ce79
BLAKE2b-256 a3ee7966e7df1c3447d8e3380d2d09fa178ef2b6fd78caa6b424d16544116043

See more details on using hashes here.

File details

Details for the file lor_gdp_tools-1.1.8-py3-none-any.whl.

File metadata

  • Download URL: lor_gdp_tools-1.1.8-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.5

File hashes

Hashes for lor_gdp_tools-1.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 7fcccc91b3a340189107bb1ae582bf3e46d336b24319661ef8631efc5db31496
MD5 d5cb6b863c747d2c17844ec3efcd84a8
BLAKE2b-256 9ae49911d621dce0e49b8362462e00d38eb0e5f44864578c3f6813e1060cb23b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page