Skip to content

Commit 4703e67

Browse files
Docs: Expand csv.md with Sniffer and dialect functions
- Add Sniffer.sniff() and Sniffer.has_header() methods - Add dialect management functions (register, unregister, get, list) - Add field_size_limit function - Remove Quote Constants section (not performance-related) Co-Authored-By: Amp <amp@ampcode.com>
1 parent 3e31202 commit 4703e67

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

docs/stdlib/csv.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ The `csv` module provides functionality for reading and writing CSV (Comma-Separ
1414
| `csv.DictReader(file)` | O(1) | O(m) | m = header length |
1515
| `DictReader iteration` | O(k) | O(k) | k = row + header overhead |
1616
| `csv.DictWriter(file)` | O(1) | O(m) | m = field names length |
17+
| `csv.field_size_limit([size])` | O(1) | O(1) | Get/set max field size |
18+
| `csv.register_dialect(name, ...)` | O(1) | O(1) | Register custom dialect |
19+
| `csv.unregister_dialect(name)` | O(1) | O(1) | Remove registered dialect |
20+
| `csv.get_dialect(name)` | O(1) | O(1) | Get dialect by name |
21+
| `csv.list_dialects()` | O(d) | O(d) | List registered dialect names |
22+
| `Sniffer.sniff(sample)` | O(n) | O(1) | Detect CSV format from sample |
23+
| `Sniffer.has_header(sample)` | O(n) | O(1) | Detect if sample has header row |
1724

1825
## Reading CSV Files
1926

0 commit comments

Comments
 (0)