This is a clean, minimal template repository for starting new Python projects in SCC's remote desktop, with sensible defaults for structure, environment setup and packaging. This template has a suggested project structure, it has 3 main directories:
- Data: This is where all your data for analysis will/should be stored.
- Notebooks: This is where all your Python/R notebooks for analysis should be stored.
- Setup: This folder holds all the files related to python setup and snowflake integration.
⚠️ Note - Please do no rename or move (change location) of the 'Setup' folder and any files within the folder.
- In Vscode, on the left-hand tab, click "Explorer". Go to
Setupdirectory and open the fileconnections.toml - Replace both the
userfields with your datahub/snowflake email address and save. - Now again go to
Setupdirectory and open the filesetup-env.ps1 - At the top right of the powershell file click the play button, this will execute this powershell script.
- Wait and keep an eye on your terminal window to check status, type in 'y' if it promts to download packages from
requirements.txtfile. - Once it stop running your python setup is finished and you can start on your project.
Is is always recommended to use a virtual environment in any analytical product. This allows another person to replicate, review, contribute to, and run your project using the same underlying code packages.
This directory contains all the files you need for python setup and integration with Snowflake.
- It contains a powershell script file i.e. 'setup-env.ps1', which is core set-up file, it:
- Checks for virtual environment at
.\.venv- If one is found. it is activated.
- If not found, one is created, then activated.
- Checks for
snee-packages.txtand attempts installation. See below for details. - Checks for
requirements.txtand prompts the user to install the packages within, if it is present.
- It also contains 'connection.toml' file : This information in this file is used to integrate snowflake and use dataset stored in snowflake directly in VS code.
⚠️ Note - Please update the 'user' field in the file with your username/email.
By default, this installs SNEE_utils package when you run the setup-env.ps1 file :
- SNEE_utils is an Internal Python Library (Python package distribution) designed for reuse by analysts within the Suffolk and North East Essex (SNEE) Intelligence Function. For more info read the README.md here --> SNEE Utils
.gitignore--> This is a plain text file that tells Git which files or directories to ignore, meaning they wont be tracked, committed or pushedREADME.md--> Readme file for the repository (Not related to python setup). The contents of this file will be displayd on GITEA repository pageconnection.toml--> toml file to establish connection with snowflake.requirements.txt--> This file is used to list and download the basic Python packages your project would depends on.setup-env.ps1--> This file is the main setup file. It has 3 important steps- Check for Virtual environment: if found then skip else create new VE (.venv) and activate it.
- Check for any repositories you want to load from snee-packages.txt file (by default it has SNEE-IF stylings and python functions, you can add on your)
- Download all the Python packages from requirements.txt file
snee-packages.txt--> This file lists all the repositories/packages we want to load from Gitea.example_analysis.ipynb--> This is an example fiel on how to establish connection with snowflake and load data from sql, load data from a file and SNEE plotting themes.