{"id":27429,"library":"super-csv","title":"super-csv","description":"A CSV processor library for Python, maintained by Open edX. Version 5.0.0 provides tools for reading and writing CSV files with a focus on handling BOM (Byte Order Mark) characters and encoding issues. The library supports Python 2.7 and 3.5+.","status":"active","version":"5.0.0","language":"python","source_language":"en","source_url":"https://github.com/openedx/super-csv","tags":["csv","openedx","bom","encoding"],"install":[{"cmd":"pip install super-csv","lang":"bash","label":"Latest version"},{"cmd":"pip install super-csv==4.1.0","lang":"bash","label":"Version 4.1.0 (stable)"}],"dependencies":[],"imports":[{"note":"SuperCsvReader is a class in the super_csv module, not a submodule.","wrong":"import super_csv.SuperCsvReader","symbol":"SuperCsvReader","correct":"from super_csv import SuperCsvReader"},{"note":"No writer submodule exists; SuperCsvWriter is in the top-level super_csv.","wrong":"from super_csv.writer import SuperCsvWriter","symbol":"SuperCsvWriter","correct":"from super_csv import SuperCsvWriter"}],"quickstart":{"code":"from super_csv import SuperCsvReader, SuperCsvWriter\nimport os\n\n# Reading a CSV file\nreader = SuperCsvReader('data.csv', encoding='utf-8-sig')\nfor row in reader:\n    print(row)\n\n# Writing a CSV file\nwriter = SuperCsvWriter('output.csv', encoding='utf-8-sig')\nwriter.writeheader(['name', 'age'])\nwriter.writerow({'name': 'Alice', 'age': 30})\nwriter.close()","lang":"python","description":"Basic CSV read/write with BOM-safe encoding."},"warnings":[{"fix":"Use Python 3.5 or later.","message":"Python 2.7 support was dropped in version 4.0.0. Upgrade to Python 3.5+.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Specify encoding='utf-8-sig' when opening files.","message":"The default encoding for SuperCsvReader is 'utf-8', which fails on files with BOM. Use 'utf-8-sig' to handle BOM correctly.","severity":"gotcha","affected_versions":"all"},{"fix":"Replace calls to `update_from_dict` with `writer.writerow(dict_data)`.","message":"The function `super_csv.update_from_dict` was deprecated in v4.1.0 and removed in v5.0.0. Use `SuperCsvWriter.writerow` with a dict instead.","severity":"deprecated","affected_versions":">=5.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install via 'pip install super-csv' and import as 'from super_csv import ...'.","cause":"Library not installed or wrong import path.","error":"ImportError: No module named 'super_csv'"},{"fix":"Pass encoding='utf-8-sig' when creating SuperCsvReader.","cause":"CSV file has a BOM (Byte Order Mark) but encoding is not set to 'utf-8-sig'.","error":"UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte"},{"fix":"Replace 'reader.next()' with 'next(reader)'.","cause":"Using Python 3's iterator protocol incorrectly. In Python 3, use 'next(reader)' instead of 'reader.next()'.","error":"AttributeError: 'SuperCsvReader' object has no attribute 'next'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}