{"id":23847,"library":"hdx-python-utilities","title":"HDX Python Utilities","description":"Supporting utilities for the HDX Python ecosystem, including streaming tabular data (CSV/JSON/Excel), date/time handling, URL manipulation, file I/O, and general helper functions. Current version 4.0.8, requires Python >=3.10, follows weekly release cadence.","status":"active","version":"4.0.8","language":"python","source_language":"en","source_url":"https://github.com/OCHA-DAP/hdx-python-utilities","tags":["hdx","humanitarian","data","tabular","csv","excel","json"],"install":[{"cmd":"pip install hdx-python-utilities","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Used for country-level operations","package":"hdx-python-country","optional":true},{"reason":"Used for HDX API interactions","package":"hdx-python-api","optional":true},{"reason":"Used for tabular data formatting","package":"tablib","optional":true}],"imports":[{"wrong":"from hdx.utilities.file_handler import save_iterable_to_csv","symbol":"save_iterable_to_csv","correct":"from hdx.utilities.file_handler import save_iterable_to_csv"}],"quickstart":{"code":"from hdx.utilities.loader import load_csv\nfrom hdx.utilities.file_handler import save_iterable_to_csv\n\n# Load a CSV file\nfilepath = 'data.csv'\ndata = load_csv(filepath)\n\n# Save an iterable (list of dicts) to CSV\nrecords = [{'name': 'Alice', 'age': 30}, {'name': 'Bob', 'age': 25}]\nsave_iterable_to_csv(records, 'output.csv', headers=['name', 'age'])\n\nprint('Done')","lang":"python","description":"Load CSV and save iterable as CSV. Requires Python >=3.10."},"warnings":[{"fix":"Upgrade to Python 3.10 or later, or pin to hdx-python-utilities<4.0.0 if you must use an older Python.","message":"Python 3.10+ required starting from version 4.0.0. Older Python versions (3.6, 3.8, 3.9) are no longer supported.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Change imports from 'hdx.utilities.loader' to 'hdx.utilities.url' for these functions.","message":"URL-related functions (get_filename_from_url, get_filename_extension_from_url, get_path_for_url, get_url_for_get, get_url_params_for_post) moved from loader module to url module in 4.0.4. Old imports will break.","severity":"breaking","affected_versions":">=4.0.4"},{"fix":"Always provide explicit headers list when saving tabular data to ensure correct column order and completeness.","message":"save_iterable expects headers to be list of strings ordered as desired. For a list of dicts, if headers are not specified, they are inferred from the first dict's keys, which may not preserve order or include all keys.","severity":"gotcha","affected_versions":"all"},{"fix":"Update code to handle the new behavior where None is no longer returned unexpectedly. Test your row functions.","message":"Functions that returned None in edge cases (e.g., row_function returning None) now handle that edge case properly. Old code relying on None may break.","severity":"deprecated","affected_versions":">=4.0.8"}],"env_vars":null,"search_vec":"'3.10':31 '4.0.8':28 'cadenc':35 'csv':40 'csv/json/excel':15 'current':26 'data':14,38 'date/time':16 'ecosystem':10 'excel':41 'file':20 'follow':32 'function':25 'general':23 'handl':17 'hdx':1,8,36 'helper':24 'humanitarian':37 'i/o':21 'includ':11 'json':42 'manipul':19 'python':2,9,30 'releas':34 'requir':29 'stream':12 'support':4 'tabular':13,39 'url':18 'util':3,5 'version':27 'week':33","created_at":"2026-05-01T08:09:56.706860+00:00","updated_at":"2026-05-01T08:09:56.706860+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\nModuleNotFoundError: No module named 'hdx.utilities.file_handler'"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"4.1.2","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/OCHA-DAP/hdx-python-utilities","docs":null,"changelog":null,"pypi":"https://pypi.org/project/hdx-python-utilities/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}