Skip to main content

Image of SportPursuit

This is the official SportPursuit Python Package

SportPursuit is the UKs first sport-specific flash sales website featuring top quality sports products and services from the world's best brands. During their 7 days flash sales, members receive exclusive access to sales at up to 70% off RRP in a fun, content rich, personalised environment.

The main site can be found here: https://www.sportpursuit.com/

Currently primarily contains functions for getting data from Redshift but will be extended in the future

Installing the package

This package can be installed using pip, e.g. pip install sportpursuit
The recommended way to call the functions is by importing sportpursuit.sportpursuit as sp then invoking the GetData class as sp.GetData.function_name()

For example a minimum set of commands to get Redshift data in a Jupyter Notebook would look like the following:
!pip install sportpursuit
import sportpursuit.sportpursuit as sp
test_sql_string = "select * from example_table limit 10;"
sp.GetData.get_redshift_data(test_sql_string)

Please note that you will have to have environment variables saved that match the form of "redshift_password" and "redshift_username" for the function to read data, or else be in a cloud environment.

Description of functions present in package

Get Secret Function

The purpose of this function is to read the cloud based credentials to enable connecting to Redshift. It takes as input what is essentially a cloud username and returns the password associated with that username. Please note, it is not necessary to run this function when attempting to read Redshift data as it is run automatically as part of that anyway. Example usage:

redshift_password = sp.GetData.get_secret("database/redshift/dataops")
redshift_username = "dataops"

Get Redshift Credentials

The purpose of this function is to read in whatever credentials are present on the system, preferentially it will use local credentials and then load cloud credentials if they are there. An error is raised if neither are present. Please note, it is not necessary to run this function when attempting to read Redshift data as it is run automatically as part of that anyway. Example usage:

redshift_username, redshift_password = sp.GetData.get_redshift_credentials()

Get Redshift Data

The purpose of this function is to take a sql query as input and return a dataframe with the results of that query. It will attempt to read in credentials automatically as part of this and will fail if none can be found. Example usage:

test_sql_string = "select * from example_table limit 10;"
sp.GetData.get_redshift_data(test_sql_string)

Execute Redshift Command

The purpose of this function is very similar to the get data function, however it differs in that it executes a command and doesn't return any data. This is used when you want to make Redshift do something internal, such as copying data into a table, or creating a new table etc. Example usage:

example_redshift_sql_command = "copy example_table from existing_table;"
sp.GetData.execute_redshift_command(example_redshift_sql_command)

Metadata

Release files for sportpursuit 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for sportpursuit 0.0.5
File Interpreter ABI Platform Actions
sportpursuit-0.0.5-py3-none-any.whl Python 3 none any Details for sportpursuit-0.0.5-py3-none-any.whl

Release files / sportpursuit-0.0.5-py3-none-any.whl

Download URL sportpursuit-0.0.5-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
88a34b73e6a159d1b78bb7e08da0205fd5b4c1c2ada5f70c466f0de54b276667
BLAKE2b-256 checksum
How to use checksums
b824ab67c56a7837eee39c17bb0c2bf898288d8fe53e00f332f68b10422b9ee7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.1

Security for sportpursuit 0.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page