picatrix
picatrix copied to clipboard
DataFrame accessors first-class support
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.