"""
AUSynth Data Dictionary v1.0
Maps integer category indices to ABS labels for all variables.

Usage:
    from ausynth_dictionary import VARIABLE_LABELS, apply_labels

    # Map indices to labels
    df['AGE5P_label'] = df['AGE5P'].map(VARIABLE_LABELS['AGE5P'])

    # Or use convenience function
    df = apply_labels(df, ['AGE5P', 'SEXP'])

    # Check which dataset a variable belongs to
    print(get_dataset_variables('persons'))
"""

VERSION = "1.0"
GENERATED = "2026-05"

VARIABLE_LABELS = {
    # === PERSONS ===
    'AGE5P': {
        0: '0-4 years',
        1: '5-9 years',
        2: '10-14 years',
        3: '15-19 years',
        4: '20-24 years',
        5: '25-29 years',
        6: '30-34 years',
        7: '35-39 years',
        8: '40-44 years',
        9: '45-49 years',
        10: '50-54 years',
        11: '55-59 years',
        12: '60-64 years',
        13: '65-69 years',
        14: '70-74 years',
        15: '75-79 years',
        16: '80-84 years',
        17: '85-89 years',
        18: '90-94 years',
        19: '95-99 years',
        20: '100 years and over',
    },
    'BPLP': {
        0: 'Oceania and Antarctica',
        1: 'North-West Europe',
        2: 'Southern and Eastern Europe',
        3: 'North Africa and the Middle East',
        4: 'South-East Asia',
        5: 'North-East Asia',
        6: 'Southern and Central Asia',
        7: 'Americas',
        8: 'Sub-Saharan Africa',
        9: 'Supplementary codes',
        10: 'Not stated',
    },
    'CLTHP': {
        0: 'None of the selected conditions',
        1: 'One condition',
        2: 'Two conditions',
        3: 'Three or more conditions',
        4: 'Not stated',
    },
    'COCNHDP': {
        0: 'Has cancer and heart disease',
        1: 'Does not have cancer and heart disease',
        2: 'Not stated',
    },
    'CODBHDP': {
        0: 'Has diabetes and heart disease',
        1: 'Does not have diabetes and heart disease',
        2: 'Not stated',
    },
    'CODBKDP': {
        0: 'Has diabetes and kidney disease',
        1: 'Does not have diabetes and kidney disease',
        2: 'Not stated',
    },
    'GNGP': {
        0: 'National Government',
        1: 'State/Territory Government',
        2: 'Local Government',
        3: 'Private sector',
        4: 'Not stated',
        5: 'Not applicable',
    },
    'HEAP': {
        0: 'Postgraduate Degree Level',
        1: 'Graduate Diploma and Graduate Certificate Level',
        2: 'Bachelor Degree Level',
        3: 'Advanced Diploma and Diploma Level',
        4: 'Certificate III & IV Level',
        5: 'Secondary Education - Years 10 and above',
        6: 'Certificate I & II Level',
        7: 'Secondary Education - Years 9 and below',
        8: 'Supplementary Codes',
        9: 'Not stated',
        10: 'Not applicable',
    },
    'HLTHP': {
        0: 'Does not have a long-term health condition',
        1: 'Has one or more long-term health condition(s)',
        2: 'Not stated',
    },
    'HRWRP': {
        0: '0 hours',
        1: '1-9 hours',
        2: '10-19 hours',
        3: '20-29 hours',
        4: '30-34 hours',
        5: '35-39 hours',
        6: '40-44 hours',
        7: '45-49 hours',
        8: '50-59 hours',
        9: '60-69 hours',
        10: '70 hours or more',
        11: 'Not stated',
        12: 'Not applicable',
    },
    'INCP': {
        0: 'Negative income',
        1: 'Nil income',
        2: '$1-$149 ($1-$7,799)',
        3: '$150-$299 ($7,800-$15,599)',
        4: '$300-$399 ($15,600-$20,799)',
        5: '$400-$499 ($20,800-$25,999)',
        6: '$500-$649 ($26,000-$33,799)',
        7: '$650-$799 ($33,800-$41,599)',
        8: '$800-$999 ($41,600-$51,999)',
        9: '$1,000-$1,249 ($52,000-$64,999)',
        10: '$1,250-$1,499 ($65,000-$77,999)',
        11: '$1,500-$1,749 ($78,000-$90,999)',
        12: '$1,750-$1,999 ($91,000-$103,999)',
        13: '$2,000-$2,999 ($104,000-$155,999)',
        14: '$3,000-$3,499 ($156,000-$181,999)',
        15: '$3,500 or more ($182,000 or more)',
        16: 'Not stated',
        17: 'Not applicable',
    },
    'INDP': {
        0: 'Agriculture, Forestry and Fishing',
        1: 'Mining',
        2: 'Manufacturing',
        3: 'Electricity, Gas, Water and Waste Services',
        4: 'Construction',
        5: 'Wholesale Trade',
        6: 'Retail Trade',
        7: 'Accommodation and Food Services',
        8: 'Transport, Postal and Warehousing',
        9: 'Information Media and Telecommunications',
        10: 'Financial and Insurance Services',
        11: 'Rental, Hiring and Real Estate Services',
        12: 'Professional, Scientific and Technical Services',
        13: 'Administrative and Support Services',
        14: 'Public Administration and Safety',
        15: 'Education and Training',
        16: 'Health Care and Social Assistance',
        17: 'Arts and Recreation Services',
        18: 'Other Services',
        19: 'Inadequately described',
        20: 'Not stated',
        21: 'Not applicable',
    },
    'INGP': {
        0: 'Non-Indigenous',
        1: 'Aboriginal',
        2: 'Torres Strait Islander',
        3: 'Both Aboriginal and Torres Strait Islander',
        4: 'Not stated',
    },
    'LFSP': {
        0: 'Employed, worked full-time',
        1: 'Employed, worked part-time',
        2: 'Employed, away from work',
        3: 'Unemployed, looking for full-time work',
        4: 'Unemployed, looking for part-time work',
        5: 'Not in the labour force',
        6: 'Not stated',
        7: 'Not applicable',
    },
    'LTHP': {
        0: 'Arthritis',
        1: 'Asthma',
        2: 'Cancer (including remission)',
        3: "Dementia (including Alzheimer's)",
        4: 'Diabetes (excluding gestational diabetes)',
        5: 'Heart disease (including heart attack or angina)',
        6: 'Kidney disease',
        7: 'Lung condition (including COPD or emphysema)',
        8: 'Mental health condition (including depression or anxiety)',
        9: 'Stroke',
        10: 'Any other long-term health condition(s)',
        11: 'No long-term health condition(s)',
        12: 'Not stated',
    },
    'MSTP': {
        0: 'Never married',
        1: 'Widowed',
        2: 'Divorced',
        3: 'Separated',
        4: 'Married',
        5: 'Not applicable',
    },
    'OCCP': {
        0: 'Managers',
        1: 'Professionals',
        2: 'Technicians and Trades Workers',
        3: 'Community and Personal Service Workers',
        4: 'Clerical and Administrative Workers',
        5: 'Sales Workers',
        6: 'Machinery Operators and Drivers',
        7: 'Labourers',
        8: 'Inadequately described',
        9: 'Not stated',
        10: 'Not applicable',
    },
    'RLHP': {
        0: 'Husband, Wife or Partner in a registered marriage, opposite-sex couple',
        1: 'Husband, Wife or Partner in a registered marriage, male same-sex couple',
        2: 'Husband, Wife or Partner in a registered marriage, female same-sex couple',
        3: 'Husband, Wife or Partner in de facto marriage, opposite-sex couple',
        4: 'Husband, Wife or Partner in de facto marriage, male same-sex couple',
        5: 'Husband, Wife or Partner in de facto marriage, female same-sex couple',
        6: 'Lone parent',
        7: 'Natural or adopted child under 15',
        8: 'Step child under 15',
        9: 'Foster child under 15',
        10: 'Grandchild under 15',
        11: 'Otherwise related child under 15',
        12: 'Unrelated child under 15',
        13: 'Natural or adopted dependent student',
        14: 'Dependent student step child',
        15: 'Dependent student foster child',
        16: 'Non-dependent natural, or adopted child',
        17: 'Non-dependent step child',
        18: 'Non-dependent foster child',
        19: 'Brother/sister',
        20: 'Father/mother',
        21: 'Non-dependent grandchild',
        22: 'Grandfather/grandmother',
        23: 'Cousin',
        24: 'Uncle/aunt',
        25: 'Nephew/niece',
        26: 'Other related individual (nec)',
        27: 'Unrelated individual living in family household',
        28: 'Group household member',
        29: 'Lone person',
        30: 'Visitor (from within Australia)',
        31: 'Other non-classifiable relationship',
        32: 'Not applicable',
    },
    'SEXP': {
        0: 'Male',
        1: 'Female',
    },
    'SIEMP': {
        0: 'Employee',
        1: 'Owner manager of incorporated enterprise with employees',
        2: 'Owner manager of incorporated enterprise without employees',
        3: 'Owner manager of incorporated enterprise - employees not stated',
        4: 'Owner manager of unincorporated enterprise with employees',
        5: 'Owner manager of unincorporated enterprise without employees',
        6: 'Owner manager of unincorporated enterprise - employees not stated',
        7: 'Contributing family worker',
        8: 'Not stated',
        9: 'Not applicable',
    },
    'STUP': {
        0: 'Not attending',
        1: 'Full-time student',
        2: 'Part-time student',
        3: 'Institution (TYPP) stated, full-time/part-time status (STUP) not stated',
        4: 'Both not stated - both institution (TYPP) and full-time/part-time status (STUP) not stated',
    },
    # === FAMILIES ===
    'CDCF': {
        0: 'Couple family with: No dependent children',
        1: 'Couple family with: One dependent child',
        2: 'Couple family with: Two dependent children',
        3: 'Couple family with: Three dependent children',
        4: 'Couple family with: Four dependent children',
        5: 'Couple family with: Five dependent children',
        6: 'Couple family with: Six or more dependent children',
        7: 'One parent family with: No dependent children',
        8: 'One parent family with: One dependent child',
        9: 'One parent family with: Two dependent children',
        10: 'One parent family with: Three dependent children',
        11: 'One parent family with: Four dependent children',
        12: 'One parent family with: Five dependent children',
        13: 'One parent family with: Six or more dependent children',
        14: 'Not applicable',
    },
    'CPRF': {
        0: 'Two persons in family',
        1: 'Three persons in family',
        2: 'Four persons in family',
        3: 'Five persons in family',
        4: 'Six or more persons in family',
        5: 'Not applicable',
    },
    'FINASF': {
        0: 'Negative income',
        1: 'Nil income',
        2: '$1-$149 ($1-$7,799)',
        3: '$150-$299 ($7,800-$15,599)',
        4: '$300-$399 ($15,600-$20,799)',
        5: '$400-$499 ($20,800-$25,999)',
        6: '$500-$649 ($26,000-$33,799)',
        7: '$650-$799 ($33,800-$41,599)',
        8: '$800-$999 ($41,600-$51,999)',
        9: '$1,000-$1,249 ($52,000-$64,999)',
        10: '$1,250-$1,499 ($65,000-$77,999)',
        11: '$1,500-$1,749 ($78,000-$90,999)',
        12: '$1,750-$1,999 ($91,000-$103,999)',
        13: '$2,000-$2,499 ($104,000-$129,999)',
        14: '$2,500-$2,999 ($130,000-$155,999)',
        15: '$3,000-$3,499 ($156,000-$181,999)',
        16: '$3,500-$3,999 ($182,000-$207,999)',
        17: '$4,000-$4,499 ($208,000-$233,999)',
        18: '$4,500-$4,999 ($234,000-$259,999)',
        19: '$5,000-$5,999 ($260,000-$311,999)',
        20: '$6,000-$7,999 ($312,000-$415,999)',
        21: '$8,000 or more ($416,000 or more)',
        22: 'All incomes not stated',
        23: 'Not applicable',
    },
    'FINF': {
        0: 'Negative income',
        1: 'Nil income',
        2: '$1-$149 ($1-$7,799)',
        3: '$150-$299 ($7,800-$15,599)',
        4: '$300-$399 ($15,600-$20,799)',
        5: '$400-$499 ($20,800-$25,999)',
        6: '$500-$649 ($26,000-$33,799)',
        7: '$650-$799 ($33,800-$41,599)',
        8: '$800-$999 ($41,600-$51,999)',
        9: '$1,000-$1,249 ($52,000-$64,999)',
        10: '$1,250-$1,499 ($65,000-$77,999)',
        11: '$1,500-$1,749 ($78,000-$90,999)',
        12: '$1,750-$1,999 ($91,000-$103,999)',
        13: '$2,000-$2,499 ($104,000-$129,999)',
        14: '$2,500-$2,999 ($130,000-$155,999)',
        15: '$3,000-$3,499 ($156,000-$181,999)',
        16: '$3,500-$3,999 ($182,000-$207,999)',
        17: '$4,000-$4,499 ($208,000-$233,999)',
        18: '$4,500-$4,999 ($234,000-$259,999)',
        19: '$5,000-$5,999 ($260,000-$311,999)',
        20: '$6,000-$7,999 ($312,000-$415,999)',
        21: '$8,000 or more ($416,000 or more)',
        22: 'Partial income stated',
        23: 'All incomes not stated',
        24: 'Not applicable',
    },
    'FMCF': {
        0: 'Couple family with no children',
        1: 'Couple family with children',
        2: 'One parent family',
        3: 'Other family',
        4: 'Not applicable',
    },
    'HCFMF': {
        0: 'One family household',
        1: 'Two family household',
        2: 'Three or more family household',
        3: 'Not applicable',
    },
    'INGF': {
        0: 'Family with Aboriginal and/or Torres Strait Islander person(s)',
        1: 'Other families',
        2: 'Not stated',
        3: 'Not applicable',
    },
    'LFSF': {
        0: 'Couple family: Both employed, worked full-time',
        1: 'Couple family: One employed full-time, other part-time',
        2: 'Couple family: One employed full-time, other away from work',
        3: 'Couple family: One employed full-time, other unemployed',
        4: 'Couple family: One employed full-time, other not in the labour force',
        5: 'Couple family: One employed full-time, other labour force status not stated',
        6: 'Couple family: Both employed, worked part-time',
        7: 'Couple family: One employed part-time, other away from work',
        8: 'Couple family: One employed part-time, other unemployed',
        9: 'Couple family: One employed part-time, other not in the labour force',
        10: 'Couple family: One employed part-time, other labour force status not stated',
        11: 'Couple family: Both employed, away from work',
        12: 'Couple family: One away from work, other unemployed',
        13: 'Couple family: One away from work, other not in the labour force',
        14: 'Couple family: One away from work, other labour force status not stated',
        15: 'Couple family: Both unemployed',
        16: 'Couple family: One unemployed, other not in the labour force',
        17: 'Couple family: One unemployed, other labour force status not stated',
        18: 'Couple family: Both not in the labour force',
        19: 'Couple family: One not in the labour force, other labour force status not stated',
        20: 'Couple family: Both labour force status not stated',
        21: 'One parent family: Employed, worked full-time',
        22: 'One parent family: Employed, worked part-time',
        23: 'One parent family: Employed, away from work',
        24: 'One parent family: Unemployed',
        25: 'One parent family: Not in the labour force',
        26: 'One parent family: Labour force status not stated',
        27: 'Other family',
        28: 'Not applicable',
    },
    'SSCF': {
        0: 'Male same-sex couple',
        1: 'Female same-sex couple',
        2: 'Opposite-sex couple',
        3: 'Not applicable',
    },
    # === DWELLINGS ===
    'BEDRD': {
        0: 'None (includes studio apartments or bedsitters)',
        1: 'One bedroom',
        2: 'Two bedrooms',
        3: 'Three bedrooms',
        4: 'Four bedrooms',
        5: 'Five bedrooms',
        6: 'Six bedrooms or more',
        7: 'Not stated',
        8: 'Not applicable',
    },
    'CPLTHD': {
        0: 'No persons in household reported a selected long-term health condition',
        1: 'One person in household reported a selected long-term health condition',
        2: 'Two persons in household reported a selected long-term health condition',
        3: 'Three persons in household reported a selected long-term health condition',
        4: 'Four persons in household reported a selected long-term health condition',
        5: 'Five persons in household reported a selected long-term health condition',
        6: 'Six persons in household reported a selected long-term health condition',
        7: 'Seven persons in household reported a selected long-term health condition',
        8: 'Eight persons in household reported a selected long-term health condition',
        9: 'Nine persons in household reported a selected long-term health condition',
        10: 'Ten or more persons in household reported a selected long-term health condition',
        11: 'Some persons in household had not stated a long-term health condition',
        12: 'All persons in household not stated',
        13: 'Not applicable',
    },
    'CPLTHRD': {
        0: 'No persons in household reported a selected long-term health condition',
        1: 'One person in household reported a selected long-term health condition',
        2: 'Two persons in household reported a selected long-term health condition',
        3: 'Three persons in household reported a selected long-term health condition',
        4: 'Four persons in household reported a selected long-term health condition',
        5: 'Five or more persons in household reported a selected long-term health condition',
        6: 'Some persons in household had not stated a long-term health condition',
        7: 'All persons in household not stated',
        8: 'Not applicable',
    },
    'DWTD': {
        0: 'Occupied private dwellings',
        1: 'Unoccupied private dwellings',
        2: 'Non-private dwellings',
        3: 'Migratory',
        4: 'Off-shore',
        5: 'Shipping',
    },
    'HCFMD': {
        0: 'One family household',
        1: 'Multiple family household',
        2: 'Other household',
        3: 'Not applicable',
    },
    'HHCD': {
        0: 'One family household',
        1: 'Multiple family household',
        2: 'Non-family household',
        3: 'Non-classifiable',
        4: 'Not applicable',
    },
    'HIND': {
        0: 'Negative income',
        1: 'Nil income',
        2: '$1-$149 ($1-$7,799)',
        3: '$150-$299 ($7,800-$15,599)',
        4: '$300-$399 ($15,600-$20,799)',
        5: '$400-$499 ($20,800-$25,999)',
        6: '$500-$649 ($26,000-$33,799)',
        7: '$650-$799 ($33,800-$41,599)',
        8: '$800-$999 ($41,600-$51,999)',
        9: '$1,000-$1,249 ($52,000-$64,999)',
        10: '$1,250-$1,499 ($65,000-$77,999)',
        11: '$1,500-$1,749 ($78,000-$90,999)',
        12: '$1,750-$1,999 ($91,000-$103,999)',
        13: '$2,000-$2,499 ($104,000-$129,999)',
        14: '$2,500-$2,999 ($130,000-$155,999)',
        15: '$3,000-$3,499 ($156,000-$181,999)',
        16: '$3,500-$3,999 ($182,000-$207,999)',
        17: '$4,000-$4,499 ($208,000-$233,999)',
        18: '$4,500-$4,999 ($234,000-$259,999)',
        19: '$5,000-$5,999 ($260,000-$311,999)',
        20: '$6,000-$7,999 ($312,000-$415,999)',
        21: '$8,000 or more ($416,000 or more)',
        22: 'Partial income stated',
        23: 'All incomes not stated',
        24: 'Not applicable',
    },
    'INGDWTD': {
        0: 'Household with Aboriginal and/or Torres Strait Islander person(s)',
        1: 'Other households',
        2: 'Not applicable',
    },
    'LLDD': {
        0: 'Real estate agent',
        1: 'State or territory housing authority',
        2: 'Community housing provider',
        3: 'Person not in the same household - parent/other relative',
        4: 'Person not in the same household - other person',
        5: 'Owner/Manager of a residential park (including caravan parks and manufactured home estates)',
        6: 'Employer - Government (includes Defence Housing Australia)',
        7: 'Employer - other employer',
        8: 'Not stated',
        9: 'Not applicable',
    },
    'MRERD': {
        0: 'Nil repayments',
        1: '$1-$149',
        2: '$150-$299',
        3: '$300-$449',
        4: '$450-$599',
        5: '$600-$799',
        6: '$800-$999',
        7: '$1,000-$1,199',
        8: '$1,200-$1,399',
        9: '$1,400-$1,599',
        10: '$1,600-$1,799',
        11: '$1,800-$1,999',
        12: '$2,000-$2,199',
        13: '$2,200-$2,399',
        14: '$2,400-$2,599',
        15: '$2,600-$2,799',
        16: '$2,800-$2,999',
        17: '$3,000-$3,499',
        18: '$3,500-$3,999',
        19: '$4,000-$4,999',
        20: '$5,000 and over',
        21: 'Not stated',
        22: 'Not applicable',
    },
    'NPRD': {
        0: 'One person',
        1: 'Two persons',
        2: 'Three persons',
        3: 'Four persons',
        4: 'Five persons',
        5: 'Six persons',
        6: 'Seven persons',
        7: 'Eight or more persons',
        8: 'Not applicable',
    },
    'RNTRD': {
        0: '$1-$74',
        1: '$75-$99',
        2: '$100-$124',
        3: '$125-$149',
        4: '$150-$174',
        5: '$175-$199',
        6: '$200-$224',
        7: '$225-$249',
        8: '$250-$274',
        9: '$275-$299',
        10: '$300-$324',
        11: '$325-$349',
        12: '$350-$374',
        13: '$375-$399',
        14: '$400-$424',
        15: '$425-$449',
        16: '$450-$474',
        17: '$475-$499',
        18: '$500-$524',
        19: '$525-$549',
        20: '$550-$649',
        21: '$650-$749',
        22: '$750-$849',
        23: '$850-$949',
        24: '$950 and over',
        25: 'Not stated',
        26: 'Not applicable',
    },
    'TEND': {
        0: 'Owned outright',
        1: 'Owned with a mortgage',
        2: 'Purchased under a shared equity scheme',
        3: 'Rented',
        4: 'Occupied rent free',
        5: 'Occupied under a life tenure scheme',
        6: 'Other',
        7: 'Not stated',
        8: 'Not applicable',
    },
    'VEHRD': {
        0: 'No motor vehicles',
        1: 'One motor vehicle',
        2: 'Two motor vehicles',
        3: 'Three motor vehicles',
        4: 'Four or more motor vehicles',
        5: 'Not stated',
        6: 'Not applicable',
    },
}

VARIABLE_DESCRIPTIONS = {
    'AGE5P': 'Age in Five Year Groups',
    'BEDRD': 'Number of Bedrooms',
    'BPLP': 'Country of Birth of Person (major group)',
    'CDCF': 'Count of Dependent Children in Family',
    'CLTHP': 'Count of Long-Term Health Conditions',
    'COCNHDP': 'Cancer and Heart Disease Co-occurrence',
    'CODBHDP': 'Diabetes and Heart Disease Co-occurrence',
    'CODBKDP': 'Diabetes and Kidney Disease Co-occurrence',
    'CPLTHD': 'Count of Persons with Long-Term Health Conditions — Dwelling',
    'CPLTHRD': 'Count of Persons with Long-Term Health Conditions — Dwelling (ranges)',
    'CPRF': 'Count of Persons in Family',
    'DWTD': 'Dwelling Type',
    'FINASF': 'Family Income and Labour Force Status',
    'FINF': 'Total Family Income (weekly)',
    'FMCF': 'Family Composition',
    'GNGP': 'Sector of Employment',
    'HCFMD': 'Household/Family Composition — Dwelling',
    'HCFMF': 'Household/Family Composition — Family',
    'HEAP': 'Level of Highest Educational Attainment',
    'HHCD': 'Household Composition',
    'HIND': 'Total Household Income (weekly)',
    'HLTHP': 'Long-Term Health Condition Indicator',
    'HRWRP': 'Hours Worked',
    'INCP': 'Total Personal Income (weekly)',
    'INDP': 'Industry of Employment (division)',
    'INGDWTD': 'Indigenous Household Indicator',
    'INGF': 'Indigenous Status — Family',
    'INGP': 'Indigenous Status',
    'LFSF': 'Labour Force Status of Parents — Family',
    'LFSP': 'Labour Force Status',
    'LLDD': 'Landlord Type',
    'LTHP': 'Type of Long-Term Health Condition',
    'MRERD': 'Mortgage Repayment (monthly)',
    'MSTP': 'Registered Marital Status',
    'NPRD': 'Number of Persons Usually Resident',
    'OCCP': 'Occupation (major group)',
    'RLHP': 'Relationship in Household',
    'RNTRD': 'Rent (weekly)',
    'SEXP': 'Sex',
    'SIEMP': 'Status in Employment',
    'SSCF': 'Same-Sex Couple — Family',
    'STUP': 'Full-Time/Part-Time Student Status',
    'TEND': 'Tenure and Landlord Type',
    'VEHRD': 'Number of Motor Vehicles',
}

DATASETS = {
    'persons': ['AGE5P', 'BPLP', 'CLTHP', 'COCNHDP', 'CODBHDP', 'CODBKDP', 'GNGP', 'HEAP', 'HLTHP', 'HRWRP', 'INCP', 'INDP', 'INGP', 'LFSP', 'LTHP', 'MSTP', 'OCCP', 'RLHP', 'SEXP', 'SIEMP', 'STUP'],
    'families': ['CDCF', 'CPRF', 'FINASF', 'FINF', 'FMCF', 'HCFMF', 'INGF', 'LFSF', 'SSCF'],
    'dwellings': ['BEDRD', 'CPLTHD', 'CPLTHRD', 'DWTD', 'HCFMD', 'HHCD', 'HIND', 'INGDWTD', 'LLDD', 'MRERD', 'NPRD', 'RNTRD', 'TEND', 'VEHRD'],
}


def apply_labels(df, variables=None):
    """Apply ABS labels to specified columns. None = all."""
    import pandas as pd
    df = df.copy()
    target_vars = variables or [c for c in df.columns if c in VARIABLE_LABELS]
    for var in target_vars:
        if var in df.columns and var in VARIABLE_LABELS:
            df[f'{var}_label'] = df[var].map(VARIABLE_LABELS[var])
    return df


def get_dataset_variables(dataset):
    """Get list of variables for persons/families/dwellings."""
    return DATASETS[dataset]
