v2.0.0
This is a massive overhaul to Quiffen.
Not only does it massively reduce the amount of code in the package (from 3167 total lines to 2692!), but it also adds new features, fixes some bugs and greatly improves the overall readability and structure of the code, which should make it much easier to maintain going forwards.
Changelog
New
- Migration to Pydantic for validation
- Uses a custom
BaseModel
- Uses a custom
- Added
Security
class (#30, #33) - Added
categories
list toClass
objects so they can act as a container - Vastly improved how
Category
tree interaction works with new methods such asCategory.merge
merge()
methods also added toAccount
andClass
types
- Ability to add custom fields to all Quiffen types for both reading from and writing to QIF files (see #16)
- Added
TransactionLike
as an alias forUnion[Transaction, Investment, Split]
- Most objects now support the
to_qif
method to get a QIF representation of just that object
Upgrades
- Better type hinting of functions
- Much, much better test coverage (~250 tests!)
- GitHub Actions workflows
- Greatly improved the
quiffen.utils.parse_date
function with thepython-dateutil
package
Breaking Changes
- Removed support for Python 3.6 and Python 3.7. Quiffen now only supports Python 3.8 and above
- In most cases,
quiffen.core
modules have been renamed to use the singular noun- e.g.
quiffen.core.transactions
->quiffen.core.transaction
quiffen.core.categories_classes
has been split intoquiffen.core.category
andquiffen.core.class_type
quiffen.core.transactions
has been split intoquiffen.core.transaction
,quiffen.core.investment
andquiffen.core.split
- e.g.
- Most
__str__
and__eq__
methods have changed to_dict
methods now return the Pydantic dictionary representation of the object- Any methods using the
day_first
parameter now have that parameter defaulted toFalse
to better support
iso-formatted dates
Click to see module-specific changes
quiffen.core.account
VALID_ACCOUNT_TYPES
is now an enum:AccountType
- Aliased to
quiffen.AccountType
- Used for
Account.add_transaction
- Note: the enum inherits from
str
, so passing string values will still work
- Aliased to
Account.__eq__
now checksAccount.account_type
as well asAccount.name
quiffen.core.category
Category.expense
andCategory.income
booleans have been replaced withCategory.category_type
which
takes aCategoryType
enumCategory.__eq__
now checks the whole objectCategory.__str__
now returns a proper string representation of the category, not just the__repr__
resultCategory.find_category
has been renamed toCategory.find_child
Category.find_child
no longer raises an exception when no child is found, instead returningNone
quiffen.core.class_type
- No breaking changes
quiffen.core.investment
Investment.__eq__
now checks the whole object
quiffen.core.qif
Qif.to_dicts
has been removedQif._read_qif
has been removedQif._assert_type
has been removed- Methods that accepted a
data_type
argument (to_csv
,to_dataframe
) now taken aQifDataType
enum Qif.__str__
has been changedQif.add_*
methods will now merge the objects instead of overwriting them when the object already exists- The
separator
argument ofQif.to_csv
has been renamed todelimiter
Qif.to_csv
no longer takes asub_separator
argument and writes UNIX-style CSVs
quiffen.core.split
- No breaking changes
quiffen.core.transaction
- The
TransactionList
type is now just an alias forList[TransactionLike]
Transaction.remove_split
has been renamed toTransaction.remove_splits
and themultiple
argument has been deprecated- Additionally, if no filters are provided, all splits are removed
quiffen.utils
quiffen.utils.create_categories
is nowquiffen.add_categories_to_container