My goal is to extract the seasonality of a product's grocery sales time series.
I know standard time series decomposition when a time series is expressed as $𝑦_𝑡=𝑇_𝑡+𝑆_𝑡+𝑅_𝑡$, the sum (for an additive model) of a trend component, a seasonal component and the remainder. Currently in Python, I use the seasonal_decompose function from the statsmodels library.
I know that wit a certain regularity, the seller gives a discount on the product in form of a promotion. Since I know the exact periods of the promotion, I would like to control for this information before decomposing the time series in order to make sure that the promotional effect is not falsely attributed to the seasonality. What methods/libraries could I use to control for this additional regressor?