Skip to main content

A Framework for creating a boilerplate template for ai projects that are ready for MLOps

Project description

pyPhases

A small framework for python projects that are mainly progress based.

The main princible of the framework are Phases.

Architecure

arch

Project

A Project is the composition of phases and the backend.

Phase

A Phase has a main Method and can export data.

Stage

A stage is a group of Phases and only have a name. A Stage can be run seperatly with project.run("stagename")

Decorators

Compontents

Storage and Exporters

Storage

You can add diffrent storage-engines to your project, with project.addStorage(Engine()). A storage you be inherited from pyPhases.storage.Storage and implement the methods read(path: str) and write(path: str, data: bytes). The order is important and the Storages should be ordered from fast to slow.

By Default there is a memory storage, that will save the data in the project, but is not persitent. The default persistent data layer is the filesystem(storage.FileStorage).

Exporter

An Exporter can be registered to transform an Instance or primitive type into a byte string (export(obj : MyObject): bytes) and vice versa (importData(bytes): MyObject).

There is a default ObjectExporter, that is based on pyarror and is compatible with diffrent fromats like pandas Dataframes and numpy arrays. If the Defaultexporter is used, the numpy and pyarrow package need to be installed.

register Data

When a phase wants to register data (self.project.registerData("myDataId", myData) within the phase), the data is passed to an exporter. If an exporter is found the data will be passed to alle the storages. They will save the data somewhere (persitent or not).

example:

seq

reading the data

A phase can request data with self.project.getData("myDataId", MyDataType). The Data will be passed sequential to the storage layer and will pass the data from the first storage that is able to get it. If no storage can provide the data, the project will search for a phase that exports this data-id and run that specific phase.

example:

get-data

example

This is a example data layer with 3 storages: memory, file, database (not default) data-layer

development

build

python setup.py sdist bdist_wheel

publish

twine upload dist/*

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

pyPhases-0.3.7.tar.gz (14.1 kB view details)

Uploaded Source

File details

Details for the file pyPhases-0.3.7.tar.gz.

File metadata

  • Download URL: pyPhases-0.3.7.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.1

File hashes

Hashes for pyPhases-0.3.7.tar.gz
Algorithm Hash digest
SHA256 c1011d282e0fd9ccfcca43a82003a09e4f99eef24eb8586c16192d346ee14f44
MD5 eee045b4f6fc768ca899f25ab81fbbb1
BLAKE2b-256 6c1c91f4d6fa477e8bb52d5f90e9f7b1d33c0005692296cb9e6f85257562c3a0

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