aeat.domain.categories._spending_category module¶
AEAT-aligned spending-category taxonomy.
Defines the closed enum SpendingCategory of deductible
autónomo expense classes, the coarse SpendingCategoryFamily
groups, and the static CATEGORY_FAMILY_MEMBERS membership
table. The taxonomy is the stable identifier surface every other
package binds to; renaming a member is a breaking change.
- class SpendingCategory(*values)[source]¶
Bases:
StrEnumStable identifiers for deductible autónomo spending categories.
Members map one-to-one to the deductible expense classes recognised by AEAT. Each value is the stable kebab-style Spanish identifier used in the on-disk corpus and in CLI flags.
- CUOTAS_COLEGIALES¶
- CUOTAS_AUTONOMOS_SS¶
- MUTUALIDAD_ALTERNATIVA¶
- ARRENDAMIENTO_LOCAL¶
- ARRENDAMIENTO_VIVIENDA_AFECTO¶
- IBI_LOCAL_AFECTO¶
- SUMINISTROS_HOME_OFFICE_LUZ¶
- SUMINISTROS_HOME_OFFICE_AGUA¶
- SUMINISTROS_HOME_OFFICE_GAS¶
- SUMINISTROS_HOME_OFFICE_INTERNET¶
- AMORTIZACION_VIVIENDA_AFECTO¶
- IBI_VIVIENDA_AFECTO¶
- COMUNIDAD_VIVIENDA_AFECTO¶
- TELEFONIA_MOVIL¶
- TELEFONIA_FIJA¶
- MATERIAL_OFICINA¶
- SOFTWARE_SUSCRIPCION¶
- HARDWARE_AMORTIZABLE¶
- MOBILIARIO_AMORTIZABLE¶
- REPARACIONES_CONSERVACION¶
- VEHICULO_COMBUSTIBLE¶
- VEHICULO_MANTENIMIENTO¶
- VEHICULO_SEGURO¶
- VEHICULO_PEAJE¶
- VEHICULO_PARKING¶
- MANUTENCION_DIETAS_NACIONAL¶
- MANUTENCION_DIETAS_EXTRANJERO¶
- ASESORIA_FISCAL¶
- ASESORIA_JURIDICA¶
- ASESORIA_CONTABLE¶
- PUBLICIDAD_MARKETING¶
- FORMACION_PROFESIONAL¶
- VIAJES_TRANSPORTE¶
- VIAJES_ALOJAMIENTO¶
- SEGUROS_RESPONSABILIDAD_CIVIL¶
- SEGUROS_SALUD_AUTONOMO¶
- GASTOS_BANCARIOS¶
- GASTOS_FINANCIEROS¶
- SUMINISTROS_CLIENTE_DIRECTOS¶
- SUBCONTRATACION¶
- TRIBUTOS_FISCALMENTE_DEDUCIBLES¶
- class SpendingCategoryFamily(*values)[source]¶
Bases:
StrEnumCoarse families used by CLI listings and downstream classifiers.
Each
SpendingCategorybelongs to exactly one family — the membership table isCATEGORY_FAMILY_MEMBERSand the invariant is enforced bydomain.categories.tests.test_spending_category.test_every_category_belongs_to_exactly_one_family().The home-office bucket is split into two distinct families per LIRPF Art. 30.2 rule 5 (Ley 6/2017, BOE-A-2017-12544): the
HOME_OFFICE_SUMINISTROSfamily carries the utility costs on which the statutory 0.30 multiplier applies on top of the operator-chosen vivienda afectación ratio; theHOME_OFFICE_OWNERSHIPfamily carries the titularity-attached costs (amortización, IBI, comunidad) that deduct at the raw vivienda afectación ratio with no statutory multiplier.- SOCIAL_SECURITY¶
- PREMISES¶
- HOME_OFFICE_SUMINISTROS¶
- HOME_OFFICE_OWNERSHIP¶
- TELECOMS¶
- OFFICE¶
- VEHICLE¶
- MEALS¶
- PROFESSIONAL_SERVICES¶
- TRAVEL¶
- INSURANCE¶
- FINANCIAL¶
- DIRECT_COSTS¶
- TAXES¶
- CATEGORY_FAMILY_MEMBERS: dict[SpendingCategoryFamily, tuple[SpendingCategory, ...]]¶
Static membership table from
SpendingCategoryFamilyto its members.Every
SpendingCategoryappears in exactly one entry. The table is the source of truth forfamily_for()andcategories_for_family().
- family_for(category)[source]¶
Return the coarse family that a spending category belongs to.
- Parameters:
category (
SpendingCategory) – ASpendingCategorymember.- Return type:
- Returns:
The unique
SpendingCategoryFamilycontainingcategory.- Raises:
KeyError – If
categoryis not registered inCATEGORY_FAMILY_MEMBERS.
- categories_for_family(family)[source]¶
Return the categories belonging to a coarse family.
- Parameters:
family (
SpendingCategoryFamily) – ASpendingCategoryFamilymember.- Return type:
- Returns:
Tuple of
SpendingCategorymembers in the family.