Firelink
Firelink is based on scikit-learn pipeline and adding the functionality to store the pipeline in .yaml or .ember file for production.
Quickstart
Installation
pip install firelink
Basic Usage
import pandas as pd
from pandas.testing import assert_frame_equal
from firelink.pandas_transform import Drop_duplicates, Filter
from firelink.pipeline import FirePipeline
df = pd.DataFrame(
{
"a": range(10),
"b": range(10, 20),
"c": range(20, 30),
"d": ["a", "n", "d", "f", "g", "h", "h", "j", "q", "w"],
"e": ["a", "d", "a", "d", "e", "e", "a", "a", "d", "d"],
}
)
trans_1 = Filter(["a", "e"])
trans_2 = Drop_duplicates(["e"], keep="first")
pipe_1 = FirePipeline(
[("filter column a and e", trans_1), ("drop duplicate for column e", trans_2)]
)
pipe_1.save_fire("pipe_1.ember", file_type="ember")
pipe_2 = FirePipeline.link_fire("pipe_1.ember")
df1 = pipe_1.fit_transform(df)
df2 = pipe_2.fit_transform(df)
assert_frame_equal(df1, df2)
Spark Usage
import pandas as pd
from pandas.testing import assert_frame_equal
from firelink.spark_transform import WithColumn
from firelink.pandas_transform import Assign
from firelink.pipeline import FirePipeline
from pyspark.sql import SparkSession, functions as F
spark = SparkSession.builder.appName("spark_session").enableHiveSupport().getOrCreate()
df = pd.DataFrame({"col1": [1, 2, 3], "col2": ["a", "b", "c"]})
sdf = spark.createDataFrame(df)
add1 = WithColumn("Country", "F.lit('Canada')")
add2 = WithColumn("City", "F.lit('Toronto')")
spark_pipe = FirePipeline([("Add Country", add1), ("Add City", add2)])
# set_config(display="diagram")
# set_config(display="text")
spark_pipe
sdf = spark_pipe.fit_transform(sdf)
sdf.show()
add1 = Assign({"Country": "Canada"})
add2 = Assign({"City": "Toronto"})
pandas_pipe = FirePipeline([("Add Country", add1), ("Add City", add2)])
pandas_pipe.fit_transform(df)
assert_frame_equal(sdf.toPandas(), pandas_pipe.fit_transform(df))
Pipeline Example Structure Visualization
Detailed Documentation
For the detailed documentation, please go through this portal.
Metadata
Release files for firelink 0.1.3
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 | Actions |
|---|---|---|---|---|
| firelink-0.1.3.tar.gz | 21.2 kB | Without provenance | Details for firelink-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| firelink-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for firelink-0.1.3-py3-none-any.whl |
Total release size: 34.7 kB
Release files / firelink-0.1.3.tar.gz
| Download URL | firelink-0.1.3.tar.gz |
|---|---|
| Size | 21.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
827aac359b06de7781d36e6bab25c3228a165a3743ab80f9f659f6e2278ae3f7
|
|
BLAKE2b-256 checksum How to use checksums |
5fca8253a0739329862c018dad0cc5d5d988ca8899fddd13a602d1aa2e13efd1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.13
|
Release files / firelink-0.1.3-py3-none-any.whl
| Download URL | firelink-0.1.3-py3-none-any.whl |
|---|---|
| Size | 13.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3cc62819e96ad379140c3fbdd3011c79cfb902a4386d66e489050728d4da1ca2
|
|
BLAKE2b-256 checksum How to use checksums |
7a579429e6d85d0993150d97cbc1ff2ac17d99fa32b2d0621040051edbeee868
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.13
|
Security for firelink 0.1.3
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.