Skip to content
This repository has been archived by the owner on Aug 21, 2019. It is now read-only.

Latest commit

 

History

History
21 lines (14 loc) · 644 Bytes

README.md

File metadata and controls

21 lines (14 loc) · 644 Bytes

csvapi parser

CSV parser, intended for use with csvapi.

This is based on, and depends on, the Agate library.

Provided a path to a CSV, it will:

  • try to guess the encoding with cchardet — encoding can be forced if needed;
  • try to guess the CSV dialect (delimiter and such) by using a custom sniffing method;
  • return an agate.Table object or raise an Exception.

Usage

from csv_parser import parse

table = parse('/path/to/csv')

# force the encoding
table = parse('/path/to/csv', encoding='utf-8')