You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-11Lines changed: 13 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,21 +7,19 @@
7
7
8
8
## Description
9
9
10
-
In projects using Pandas, it's very common to have functions that take Pandas DataFrames as input or produce them as output.
11
-
It's hard to figure out quickly what these DataFrames contain. This library offers simple decorators to annotate your functions
12
-
so that they document themselves and that documentation is kept up-to-date by validating the input and output on runtime.
13
-
14
-
For example,
10
+
Working with DataFrames often means passing them through multiple transformation functions, making it easy to lose track of their structure over time. DAFFY adds runtime validation and documentation to your DataFrame operations through simple decorators. By declaring the expected columns and types in your function definitions, you can:
15
11
16
12
```python
17
-
@df_in(columns=["Brand", "Price"]) # the function expects a DataFrame as input parameter with columns Brand and Price
18
-
@df_out(columns=["Brand", "Price"]) # the function will return a DataFrame with columns Brand and Price
19
-
deffilter_cars(car_df):
20
-
# before this code is executed, the input DataFrame is validated according to the above decorator
Like type hints for DataFrames, DAFFY helps you catch structural mismatches early and keeps your data pipeline documentation synchronized with the code. Compatible with both Pandas and Polars.
0 commit comments