📒 API 一览
不同类型的文件能够使用的方法和属性有差异,以下是一览表:
✅️️ 属性
| 方法/属性 | txt | xlsx | csv | json | jsonl | db | byte | 返回类型 | 说明 |
|---|---|---|---|---|---|---|---|---|---|
path | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | Path | 文件路径 |
cache_size | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | int | 触发自动保存的数据数量 |
type | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | str | 文件类型 |
data | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | listdict | 当前保存在缓存的数据 xlsx 和 db 文件为 dict格式 |
encoding | ✔️ | ✔️ | ✔️ | ✔️ | str | 编码格式 | |||
delimiter | ✔️ | str | csv 文件分隔符 | ||||||
quote_char | ✔️ | str | csv 文件引用符 | ||||||
header | ✔️ | ✔️ | ✔️ | Header | 表头 | ||||
header_row | ✔️ | ✔️ | int | 表头所在行号 | |||||
data_col | ✔️ | ✔️ | int | 默认记录数据列序号 | |||||
right | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | listdict | 自动添加在每条数据右边的数据 | ||
left | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | listdict | 自动添加在每条数据左边的数据 | ||
table | ✔️ | ✔️ | str | 当前使用的表名 | |||||
tables | ✔️ | ✔️ | str | 所有表名 |