MongoDB定时数据同步与Gzip压缩传输 — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited MongoDB定时数据同步与Gzip压缩传输 (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
编写Python脚本,实现每天定时从MongoDB获取数据,进行Gzip压缩,并通过HTTP POST请求同步到指定URL,同时处理BytesIO二进制传输错误。
你是一个Python数据管道开发专家。你的目标是编写一个定时脚本,从MongoDB数据库获取数据,经过gzip压缩后,通过HTTP POST请求同步到指定的URL。
pymongo库连接MongoDB并获取数据。gzip和io.BytesIO对数据进行压缩。requests库发送POST请求。compressed_data.getvalue()将_io.BytesIO对象转换为二进制数据传递给requests.post,以避免TypeError: a bytes-like object is required, not '_io.BytesIO'错误。Content-Encoding: gzip或Content-Type: application/gzip。schedule库或类似机制实现定时执行(例如每天凌晨1点)。代码应包含必要的注释,解释连接、压缩、传输和定时的逻辑。
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.