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. English messages with lang="en" — see English.

설치

pip install 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=...)로 바꿀 수 있음).
  • Filings(..., lang="en")이면 이유·오류 문구가 영어로 나옵니다. 국내 공시는 영어 뜻 뒤에 원래 제목을 붙입니다(예: "Recent filing (12/01): rights offering - 주요사항보고서(유상증자결정)").

준비물

  • 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(영어 문구는 DART_WORDS의 값과 SEC_ITEMS_EN, SEC_FORMS_EN)에 있습니다.

한계

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

시험

python tests/test_filing_guard.py

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

English

from filing_guard import Filings

f = Filings(sec_contact="Your Name you@example.com", lang="en")
f.problem("us", "BRK.B", "2026-12-05")  # None = no red flags in the last 10 days
# e.g. "Recent filing (12/01): 8-K non-reliance on prior financials"
  • US (SEC EDGAR): 8-K items 1.03 bankruptcy, 2.06 material impairment, 3.01 delisting notice, 4.01 auditor change, 4.02 non-reliance on prior financials, plus NT 10-K / NT 10-Q late filings. No API key; SEC asks for a name and email in every request (sec_contact).
  • Korea (DART): needs a free key from opendart.fss.or.kr (dart_key). Reasons show the English meaning followed by the original Korean title.
  • Returns a one-line reason or None. Raises on lookup failure, so before a buy it is safer to skip the trade when it raises.
  • Titles and item numbers only: no full-text or news analysis. Not investment advice.

라이선스

MIT

Metadata

Release files for filing-guard 0.2.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.2.0
File Size Uploaded Provenance Actions
filing_guard-0.2.0.tar.gz 10.1 kB With provenance Details for filing_guard-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 18.6 kB

Release files / filing_guard-0.2.0.tar.gz

Download URL filing_guard-0.2.0.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f216c26464087525d969343ca98347e136f3cece612dc740a31c11dbdee6bf55
BLAKE2b-256 checksum
How to use checksums
b69b5eadc5583c40bd5622e8dbbc18c3fbcabd715ba0fbfd4dcce649ed8b4f1c
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 6, 2026.

Transparency log

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

Download URL filing_guard-0.2.0-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dc343f9b54f7ee42364e1bf6424fb402c67eab5680fb290dd1ce2a2fc07ec80f
BLAKE2b-256 checksum
How to use checksums
109d1c096102bb4321429139fd8a4c4ff80ad7b68669fb867de6d40be1ed5f83
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 6, 2026.

Transparency log

Security for filing-guard 0.2.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.2.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 6, 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.2.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