DrissionRecord
用于记录数据的模块。
What it is and what it does
DrissionRecord is a Python utility for buffering and writing data to multiple file formats—xlsx, csv, json, jsonl, sqlite, txt, and byte files. It solves the efficiency problem in data collection workflows by caching data in memory and writing it in batches rather than opening and closing files repeatedly. The core Recorder class accepts data via add_data() and flushes it to disk when a threshold is reached or when record() is called.
The package is designed for scenarios where frequent file I/O is a bottleneck or where data loss on crash is a risk. It supports multi-threaded writes, automatic header creation from dictionary data, coordinate-based cell writes for spreadsheets, and resumable workflows. A single runtime dependency (openpyxl) keeps the install footprint minimal.
Use it for:
- Web scraping workflows where data must be saved incrementally to avoid loss on interruption
- Batch data export pipelines that need to write millions of records efficiently
- Multi-threaded data collection systems writing to a single shared output file
- Resumable data jobs using xlsx or csv files as checkpoints
- Converting or migrating data between json, csv, and xlsx formats in bulk
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Buffers and writes data to files (xlsx, csv, json, jsonl, sqlite, txt, byte) with caching to reduce I/O overhead and support for multi-threaded writes.
Yes, if you need buffered, multi-threaded file writing with low overhead. The package is actively maintained, has no known vulnerabilities, carries a permissive MIT license, and requires only one dependency. Install it for data collection or batch export workflows where I/O efficiency matters; skip it if you only write small amounts of data or use a database.
Install
drissionrecord on PyPI
pip
pip install drissionrecorduv
uv add drissionrecordpoetry
poetry add drissionrecordInstalling DrissionRecord
Before you install
Low install friction with a single runtime dependency (openpyxl). Package is actively maintained with a recent release.
License in practice
MIT license permits unrestricted use, modification, and distribution with only attribution required.
Quickstart
from DrissionRecord import Recorder
r = Recorder('data.csv')
r.add_data([(1, 2, 3), (4, 5, 6)])
r.record()
Verify before relying
- Whether automatic data persistence on program crash/exit actually works as described
- Performance characteristics when writing millions of records under concurrent load
- Whether xlsx cell formatting, images, and links are fully functional in version 2.0.1
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — openpyxl |
| Maintenance | actively maintained — 123 days since the last release |
| First released | |
| Downloads | 429,346/month — #6,740 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: drissionrecord-2.0.1-py3-none-any.whl
Keywords: DrissionRecord
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
DataRecorderDataRecorder provides buffered writing tools…
permissive · top 15,000 on PyPI
tabulatorReads and writes tabular data in multiple…
permissive · top 15,000 on PyPI
DrissionGetDrissionGet is a multithreaded file downloader…
permissive · top 15,000 on PyPI
partdPartd is a key-value byte store that appends…
permissive · top 1,000 on PyPI
atomicwritesProvides a context manager for writing files…
permissive · top 5,000 on PyPI
pyexcel-ioProvides a unified API to read and write data…
permissive · top 5,000 on PyPI
dataflows-tabulatorReads and writes tabular data in multiple…
permissive · top 15,000 on PyPI
django-import-exportHandles import and export of data to and from…
permissive · top 5,000 on PyPI
recordsRecords provides a lightweight SQL query…
permissive · top 15,000 on PyPI
atomicwrites-homeassistantProvides atomic file writes that ensure a file…
permissive · top 15,000 on PyPI