Skip to main content

filing-guard

주식을 사기 전에 그 회사의 최근 악재 공시(유상증자, 상장폐지, 횡령·배임, 파산 등)를 확인해 주는 작은 파이썬 모듈입니다. 국내는 금감원 DART, 미국은 SEC EDGAR를 봅니다. 증권사와 상관없이 자동매매·백테스트에 붙여 쓸 수 있습니다.

A tiny Python module that flags recent red-flag filings (rights offerings, delisting, embezzlement, bankruptcy, restatements…) for Korean (DART) and US (SEC EDGAR) stocks before you buy.

설치

pip install git+https://github.com/hoyeon71/filing-guard

Python 3.10 이상, 필요한 패키지는 requests 하나입니다.

사용

import os
from filing_guard import Filings

f = Filings(dart_key=os.environ["DART_API_KEY"], sec_contact="Your Name you@example.com")

f.problem("kr", "005930", "2026-12-05")  # 삼성전자 → None 이면 최근 10일 악재 공시 없음
f.problem("us", "BRK.B", "2026-12-05")   # → 예: "최근 공시(12/01): 8-K 과거 재무제표 정정"
  • problem(market, symbol, trade_date): market은 "kr" 또는 "us", trade_date는 YYYY-MM-DD. 그날 기준 최근 10일 공시를 봅니다.
  • 악재가 있으면 이유를 한 줄로, 없으면 None을 돌려줍니다. 조회에 실패하면 예외가 납니다. 매수 전에 쓴다면 예외가 날 때 사지 않는 쪽이 안전합니다.
  • off_reason(market): 인증키·연락처가 없어서 그 시장을 확인할 수 없으면 이유를, 확인할 수 있으면 None을 돌려줍니다.
  • 종목코드 → 공시 회사 코드 표는 하루 한 번 받아 ~/.cache/filing-guard에 둡니다(Filings(cache_dir=...)로 바꿀 수 있음).

준비물

  • DART 인증키(국내): opendart.fss.or.kr → 인증키 신청. 무료입니다. 키는 코드에 적지 말고 환경 변수 등으로 넘기세요.
  • SEC 연락처(미국): 키는 없고, SEC 규칙상 요청마다 이름 이메일을 영문으로 밝혀야 합니다. 초당 10회 한도에 맞춰 요청 사이를 쉽니다.

거르는 공시

시장 기준
국내 공시 제목에 유상증자, 감자, 전환사채, 신주인수권부사채, 횡령, 배임, 불성실공시, 관리종목, 상장폐지, 상장적격성, 감사의견, 의견거절, 회생, 부도, 파산, 영업정지. 단, 제목에 "자회사"·"종속회사"가 있는 공시(지주회사가 내는 자회사 공시)는 거르지 않음
미국 8-K 항목 1.03 파산, 2.06 큰 손상차손, 3.01 상장폐지 통보, 4.01 감사인 교체, 4.02 과거 재무제표 정정. 그리고 NT 10-K, NT 10-Q(보고서 지연 제출)

목록은 모듈의 DART_WORDS, DART_NOT, SEC_ITEMS, SEC_FORMS에 있습니다.

한계

  • 공시 제목과 항목 번호만 봅니다. 임상 실패처럼 본문을 읽어야 아는 악재, 뉴스로만 나온 악재는 걸러지지 않습니다.
  • 무상증자처럼 제목이 비슷해도 악재가 아닌 공시는 거르지 않도록 했지만, 모든 경우를 확인하지는 못했습니다.
  • 투자 조언이 아닙니다. 매매 판단과 그 결과는 쓰는 사람의 책임입니다.

시험

python tests/test_filing_guard.py

인터넷 없이 가짜 응답으로 시험합니다. 마지막에 ok가 나오면 통과입니다.

라이선스

MIT

Metadata

Release files for filing-guard 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for filing-guard 0.1.0
File Size Uploaded Provenance Actions
filing_guard-0.1.0.tar.gz 8.7 kB With provenance Details for filing_guard-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for filing-guard 0.1.0
File Interpreter ABI Platform Actions
filing_guard-0.1.0-py3-none-any.whl Python 3 none any Details for filing_guard-0.1.0-py3-none-any.whl

Total release size: 15.9 kB

Release files / filing_guard-0.1.0.tar.gz

Download URL filing_guard-0.1.0.tar.gz
Size 8.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9bc2ab5ab4212f084f18c3ad442b36db21e23d28b3ace339d029e1ceb5bcf2b0
BLAKE2b-256 checksum
How to use checksums
09c10dd3ddb7124b22f986d9a24ef2bc9be351fe62c1fb90eee201976ac2f71a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.

Transparency log

Release files / filing_guard-0.1.0-py3-none-any.whl

Download URL filing_guard-0.1.0-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b8d24e1dbc9bfff0bb61e33dc7161aeae76b8254c95491933324645b7c7835cc
BLAKE2b-256 checksum
How to use checksums
f3ee787cefcb10b3977818259396ddd1ae9e50a9743d8f423a5f4b0c5bd422ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.

Transparency log

Security for filing-guard 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for filing_guard-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page