Skip to main content

파일 메타정보 추출 및 리포트 포맷 변환 유틸

Project description

📦 file-inspector

file-inspector는 다양한 형식의 파일을 자동 분석하고, Slack 메시지, Markdown, HTML, JSON 포맷 등으로 리포트를 생성해주는 Python 기반 경량 라이브러리입니다. 데이터 수집 · 검증 · 리포트 자동화가 필요한 프로젝트에서 매우 유용하게 활용될 수 있습니다.


✅ 주요 기능

기능 설명
파일 정보 추출 경로, 이름, 확장자, 크기, 인코딩, 구분자, MIME, 생성/수정일 등
파일 읽기 .csv, .xlsx, .json, .parquet 지원
출력 포맷 Slack, Markdown, HTML, JSON 형태로 리포트 생성
유효성 검사 특정 컬럼 존재 여부 확인, 누락 컬럼 목록 추출
통계 요약 describe() 기반 기술 통계 제공
샘플 미리보기 상위 n개 행 출력 (head())
일괄 분석 폴더 내 모든 파일을 순회하며 분석 수행

📁 프로젝트 구조

file-inspector/
├── file_inspector/         # 핵심 패키지   ├── inspector.py        # 메인 클래스 (FileInspector, FileInspectionResult)   ├── file_reader.py      # 파일 읽기 전담   ├── file_info_extractor.py  # 메타 정보 추출   ├── schema_validator.py     # 컬럼 유효성 검사   ├── utils.py            # 공통 유틸 함수   ├── types.py            # 타입 정의   └── formatter/          # 다양한 출력 포맷       ├── slack_formatter.py
│       ├── markdown_formatter.py
│       ├── html_formatter.py
│       └── json_formatter.py
├── examples/               # 사용 예제
├── tests/                  # 테스트 코드
├── data/                   # 예제용 샘플 파일
├── README.md
├── .gitignore
├── pyproject.toml
└── requirements.txt

📦 설치 방법

# 기본 설치
pip install -e .

🚀 사용 예제

from file_inspector import FileInspector
inspector = FileInspector()
result = inspector.inspect("data/sample.csv")

print(result.to_dict())                 # 기본 정보 dict
print(result.to_markdown())            # Markdown 출력 (Notion용)
print(result.to_html())                # HTML 출력
print(result.to_json())                # JSON 출력
print(result.validate_schema(["id"])) # 필수 컬럼 체크

🧪 테스트

python -m unittest discover tests

🔍 사용 기술 및 설계 원칙

  • Python 3.9+
  • Pandas 기반 DataFrame 처리
  • SOLID 원칙 기반 설계
  • 클린 코드와 책임 분리 구조
  • 단일 책임 클래스 분리 (Reader, Extractor, Validator, Formatter 등)

📜 라이선스

MIT License


👏 기여

PR과 이슈는 언제나 환영입니다. 더 많은 포맷터, 클라우드 업로더, Notion 연동 기능 등도 확장 가능합니다.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

file_inspector-0.1.6.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

file_inspector-0.1.6-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file file_inspector-0.1.6.tar.gz.

File metadata

  • Download URL: file_inspector-0.1.6.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for file_inspector-0.1.6.tar.gz
Algorithm Hash digest
SHA256 db85b280bed0b088337179bfee141f67ff1bd264cb1aa2d4fdbc9f8c7cb3151e
MD5 1d71b934dea4fc382e55d76301cad9d7
BLAKE2b-256 6ce68a521eb03406d9f4b96e9488478b693fc83095d0ec25f64f1e2abe3f5428

See more details on using hashes here.

File details

Details for the file file_inspector-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: file_inspector-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 13.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for file_inspector-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 f6aa68086765005096dfac046a06f14f20e9f8ed10f30707995b06063f8c72cd
MD5 551e78470405251effc5c0268fcd171a
BLAKE2b-256 360eac34d1a3b8057b715906a87a67af2e9cc5149993bf18e49e01234016d25e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page