picatrix icon indicating copy to clipboard operation
picatrix copied to clipboard

DataFrame accessors first-class support

Open mariuszlitwin opened this issue 2 years ago • 0 comments

This PR adds DataFrame accessors as a first-class functionality in Picatrix.

Accessors can now be added in a following way:

from picatrix import new_accessor_namespace

accessor = new_accessor_namespace("example")

@accessor.add_accessor(validator: lambda df: "email" in df.columns)
def bulk_email(df, send_as_bcc = False):
  ...

And later used as following if the validator matches the content of a DataFrame:

df.example.bulk_email(send_as_bcc=True)

I also used the opportunity to clean up the configuration a little as many libraries and tools dropped support for Python 3.7 since the last PR.

mariuszlitwin avatar Feb 24 '23 14:02 mariuszlitwin