{"id":26963,"library":"esp-idf-nvs-partition-gen","title":"ESP-IDF NVS Partition Generator","description":"Python tool to generate NVS (Non-Volatile Storage) binary partition images for ESP-IDF projects. Extracts configuration from CSV files and produces binary blobs for flash. Current version 0.2.0, maintenance mode on PyPI, released when ESP-IDF requires updates.","status":"maintenance","version":"0.2.0","language":"python","source_language":"en","source_url":"https://github.com/espressif/esp-idf-nvs-partition-gen","tags":["esp32","esp-idf","nvs","partition","csv","embedded"],"install":[{"cmd":"pip install esp-idf-nvs-partition-gen","lang":"bash","label":"PyPI install"}],"dependencies":[],"imports":[{"wrong":"from esp_idf_nvs_partition_gen import NVSGenerator","symbol":"NVSGenerator","correct":"import esp_idf_nvs_partition_gen"}],"quickstart":{"code":"from esp_idf_nvs_partition_gen import NVSGenerator\nimport csv\nimport io\n\n# Create a sample CSV in memory\ncsv_data = \"\"\"key,type,encoding,value\nmy_string,namespace,,app\nmy_key,data,string,hello\"\"\"\n\ncsv_file = io.StringIO(csv_data)\nreader = csv.DictReader(csv_file)\n\n# Generate the NVS partition binary\noutput_path = \"partition.bin\"\ngenerator = NVSGenerator(flash_size=0x400000, page_size=0x1000)\ngenerator.add_csv_reader(reader)\ngenerator.generate(output_path)\nprint(f\"Generated NVS partition at {output_path}\")","lang":"python","description":"Generate a binary NVS partition from a CSV. Adjust flash_size and page_size to match your ESP-IDF configuration."},"warnings":[{"fix":"Switch to ESP-IDF's nvs_partition_gen.py tool from the esp-idf repository.","message":"The module 'esp_idf_nvs_partition_gen' is deprecated in favor of ESP-IDF's built-in 'parttool.py' and 'nvs_partition_gen' utility. New projects should use the official ESP-IDF tools.","severity":"deprecated","affected_versions":">=0.2.0"},{"fix":"Ensure CSV header is: key,type,encoding,value (case-sensitive).","message":"CSV column names must match exactly: 'key','type','encoding','value'. Missing or extra columns cause silent errors or no output.","severity":"gotcha","affected_versions":"all"},{"fix":"For namespace rows, use: key=my_namespace, type=namespace, encoding=<empty>, value=<empty>.","message":"Namespace entries must have 'type' set to 'namespace' and 'encoding' and 'value' left blank. Filling them incorrectly will break the NVS structure.","severity":"gotcha","affected_versions":"all"},{"fix":"Replace: generator.add_csv_file(path) -> reader = csv.DictReader(open(path)); generator.add_csv_reader(reader)","message":"The 'NVSGenerator' class API changed in 0.2.0: 'add_csv_file' method was removed. Use 'add_csv_reader' with a CSV DictReader instead.","severity":"breaking","affected_versions":">=0.2.0"}],"env_vars":null,"search_vec":"'0.2.0':37 'binari':16,31 'blob':32 'configur':25 'csv':27,55 'current':35 'embed':56 'esp':2,21,45,51 'esp-idf':1,20,44,50 'esp32':49 'extract':24 'file':28 'flash':34 'generat':6,10 'idf':3,22,46,52 'imag':18 'mainten':38 'mode':39 'non':13 'non-volatil':12 'nvs':4,11,53 'partit':5,17,54 'produc':30 'project':23 'pypi':41 'python':7 'releas':42 'requir':47 'storag':15 'tool':8 'updat':48 'version':36 'volatil':14","created_at":"2026-05-01T17:43:47.807886+00:00","updated_at":"2026-05-01T17:43:47.807886+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"esp-idf-nvs-partition-gen","cli_version":"sh: 1: esp-idf-nvs-partition-gen: not found","type":"library","homepage":null,"github":"https://github.com/espressif/esp-idf-nvs-partition-gen","docs":null,"changelog":null,"pypi":"https://pypi.org/project/esp-idf-nvs-partition-gen/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops","data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-08-02","install_tag":null}}