Framework for 3phi project
Project description
3phi Framework
Utility classes for DB access, S3 interactions, and data processing via Controller Classes.
Distributed on PyPi.
Install name:
3phi-framework
Import package:threephi_framework
Installation
Install from PyPi
pip install 3phi-framework
Installing a Development Build (from CI)
Development builds are generated for each pull request and attached as workflow artifacts.
Download the artifact
- Open the pull request on GitHub
- Go to the Checks tab
- Open the CI and Release workflow run
- Download the artifact named dist-pr
- Extract the archive locally
It will contain files like:
dist/ 3phi_framework-.whl 3phi_framework-.tar.gz
Install the wheel (recommended)
From the extracted directory:
pip install dist/3phi_framework-*.whl
Alternatively, install the source distribution:
pip install dist/3phi_framework-*.tar.gz
Notes: Wheels are preferred and install faster. Make sure you are using Python ≥ 3.12 (project requirement). Dev builds are temporary and may be deleted after 7 days.
Quickstart
The framework is set up for local development as well as for being used in a deployment. To set up your environment for local development, follow these steps:
Set up virtual environment
execute_data_app.sh expects a virtual environment to be set up under [.venv]. See the python docs on how to set it up.
Seed data
Obtain seed data for the database and the object storage and copy it to:
- 3_db_seed.sql: This should be a sql dump/snapshot of a working 3phi Database, PSQL will automatically seed the DB when it is created using docker compose.
- 3phi: This should be a copy of a bucket from a working object storage. It will be mounted in the minio object storage as a bucket.
Spin up DB and Object Storage
Navigate to docker and run
docker compose up -d
This will bring up a local DB and a MinIO Object Storage seeded with the data you provided.
Run a data app locally
Use the utility script execute_data_app.sh and pass the data app name as an argument, e.g.:
./exectue_data_app.sh sm_classifier
In case the script is not executable, make it executable:
chmod +x execute_data_app.sh
The script will install the dependencies in requirements.txt in your virtual environment, set up environment variables as they are listed in .env and execute the data app as a python module.
Data Model
The currently assumed datamodel is illustrated in the diagram below:
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
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 3phi_framework-0.2.6.tar.gz.
File metadata
- Download URL: 3phi_framework-0.2.6.tar.gz
- Upload date:
- Size: 2.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d46f8750f2d2683c56c3ff6bd419404d8b1750956bc6510dd11d3fd1c2b7983
|
|
| MD5 |
90654f508f45b0b2df246f0ee3d3da7e
|
|
| BLAKE2b-256 |
340abe5bb4fc829e494becd7853637f1f493105f425663f18abe041c2de47897
|
Provenance
The following attestation bundles were made for 3phi_framework-0.2.6.tar.gz:
Publisher:
ci-release.yml on 3PhaseInsight/3phi-framework
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
3phi_framework-0.2.6.tar.gz -
Subject digest:
7d46f8750f2d2683c56c3ff6bd419404d8b1750956bc6510dd11d3fd1c2b7983 - Sigstore transparency entry: 991744157
- Sigstore integration time:
-
Permalink:
3PhaseInsight/3phi-framework@5474773a0cf950219daf6c765fd9c581f8a38fee -
Branch / Tag:
refs/tags/v0.2.6 - Owner: https://github.com/3PhaseInsight
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci-release.yml@5474773a0cf950219daf6c765fd9c581f8a38fee -
Trigger Event:
push
-
Statement type:
File details
Details for the file 3phi_framework-0.2.6-py3-none-any.whl.
File metadata
- Download URL: 3phi_framework-0.2.6-py3-none-any.whl
- Upload date:
- Size: 99.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
338d96fa60eb15cdbee99f99a6ac549600b2e8c68bf86f23445ee0f37cc6d407
|
|
| MD5 |
71116ff3d6d7dcadf7d0db63e1e2158f
|
|
| BLAKE2b-256 |
fb099c035ced7c7052658c0badf4c638e50677ac3cc335369872a0d55b4ba843
|
Provenance
The following attestation bundles were made for 3phi_framework-0.2.6-py3-none-any.whl:
Publisher:
ci-release.yml on 3PhaseInsight/3phi-framework
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
3phi_framework-0.2.6-py3-none-any.whl -
Subject digest:
338d96fa60eb15cdbee99f99a6ac549600b2e8c68bf86f23445ee0f37cc6d407 - Sigstore transparency entry: 991744168
- Sigstore integration time:
-
Permalink:
3PhaseInsight/3phi-framework@5474773a0cf950219daf6c765fd9c581f8a38fee -
Branch / Tag:
refs/tags/v0.2.6 - Owner: https://github.com/3PhaseInsight
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci-release.yml@5474773a0cf950219daf6c765fd9c581f8a38fee -
Trigger Event:
push
-
Statement type: