Make `pandas` dependency optional?
maread99 opened this issue · 0 comments
Would it be worth making the pandas
dependency optional, allowing users who define all their regular transaction frequencies in simple terms (e.g. "y", "m", "3m", "12w") to lose the dependency?
To give some context, beanahead also provides for defining regular transaction frequencies in terms of pandas frequencies.
Please +1 this comment, or add your own comment, if you only require simple frequencies and would like to be able to lose the pandas
dependency.
What it would require
pandas
is used by the rx_txns
module to evaluate future transaction dates. This is implemented by way of creating a pd.offsets.BaseOffset
which in turn is passed to pd.date_range
.
For simple frequencies, e.g. "m", "13w", it would be pretty trivial to evaluate the future transaction dates without recurring to pandas
:
- if freq describes weeks the simply add a
timedelta
- if freq describes 'months' or 'years' then add months / years to
datetime.date
object, accounting for change in year if 'months'.
Why not drop the dependency?
I feel the functionality provided by being able to define frequencies as pandas
frequencies is a worthy inclusion and I can't see it being practical to try and localize it - better to rely on pandas
.