Feature request: sniff csv quoting and lineterminator
未關閉
還沒有人認領這個 Issue。
3.16
stdlib
type-feature
- 主要語言
- Python
- 星號
- 77.2k
- 分支
- 35.9k
- PR 合併指標
- PR 指標待擷取
描述
If you read a csv file, alter the data and then write it back, it would be very nice to recreate also the quoting behaviour. So e.g. if the file is quoted in style csv.QUOTE_NONNUMERIC, it would be very useful to have the quoting property set correctly in the dialect object returned by csv.Sniffer().sniff.
Also, I just figured out that the line terminator is also hard-coded to "\r\n". Would also be nice to be adaptive...
Linked PRs
- gh-134416
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
從 Lib/csv.py 中的 csv.Sniffer().sniff 附近開始,這是 issue 中提到的進入點,並檢視連結的 PR gh-134416 以了解目前的工作。當 sniff 到的 dialect 保留輸入的 quoting 行為和行終止字元,而不是使用固定的預設值時,此變更即完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- python
- 領域
- data
- Issue 類型
- 功能
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100