Hello World Metaflow Card
This repository is an example hello world card.
You can install this card via :
pip install metaflow-card
How to use a helloworld card
@card(type='helloworld',options={"attribute":"html"})
@step
def train(self):
...
...
self.html = some_html() # set some html to the self attribute
How to implement custom card module
The core namespace package name is metaflow_extensions. Any new custom MetaflowCard should be present inside a folder with the following directory structure:
some_random_dir/ # the name of this dir doesn't matter
├ setup.py
├ metaflow_extensions/ # namespace package name
│ └ organizationA/ # NO __init__.py file as it is a namespace package.
│ └ plugins/ # NO __init__.py file
│ └ cards/ # NO __init__.py file # This is a namespace package.
│ └ my_card_module/ # Name of card_module
│ └ __init__.py. # This is the __init__.py is required to recoginize `my_card_module` as a package
│ └ somerandomfile.py. # Some file as a part of the package.
.
The __init__.py of the metaflow_extensions.organizationA.plugins.cards.my_card_module, requires a CARDS attribute which needs to be a list of objects inheriting MetaflowCard class. For example, the below __init__.py file exposes a MetaflowCard of type "y_card2".
from metaflow.cards import MetaflowCard
class YCard(MetaflowCard):
type = "y_card2"
ALLOW_USER_COMPONENTS = True
def __init__(self, options={}, components=[], graph=None):
self._components = components
def render(self, task):
return "I am Y card %s" % '\n'.join([comp for comp in self._components])
CARDS = [YCard]
Having this metaflow_extensions module present in the python path of your flow will make the cards usable within the flow.
Metadata
Release files for metaflow-card 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| metaflow-card-1.0.1.tar.gz | 2.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| metaflow_card-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.2 kB
Release files / metaflow-card-1.0.1.tar.gz
| Download URL | metaflow-card-1.0.1.tar.gz |
|---|---|
| Size | 2.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c73ea2df82f2bd177f4e3b7480172843c3c64985742ebe374efbd1bf2ede9b78
|
|
BLAKE2b-256 checksum How to use checksums |
371a629fd60025ec9f21c8321da982456515aa487953b19161630f3c9072684d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.1
|
Release files / metaflow_card-1.0.1-py3-none-any.whl
| Download URL | metaflow_card-1.0.1-py3-none-any.whl |
|---|---|
| Size | 6.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4696e2262834febf536229190d7f7edd5dec4228fd8707dc135cc9218e2bdf3f
|
|
BLAKE2b-256 checksum How to use checksums |
712c19a1379032358ffc0281857f38d71907eb89a621f1c40978597a850584dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.1
|
Security for metaflow-card 1.0.1
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.