Skip to main content

NamuWiki crawler & PDF utilities

Project description

NADF — 나무위키 PDF 보고서 생성기

나무위키 문서를 크롤링해 구조화하고, 한글 폰트로 보기 좋은 PDF 보고서로 변환하는 파이썬 라이브러리입니다.
패키지 내부에 Noto Serif KR 폰트가 포함되어 있어 별도 폰트 설치 없이 곧바로 사용하실 수 있습니다.

핵심 기능

나무위키 문서 크롤링 & 파싱
섹션(h2/h3/h4) 구조를 보존한 PDF 생성(fpdf2 기반)
한글 폰트 포함(Noto Serif KR Regular/Bold)

주의사항

크롬이 설치되어 있어야 합니다.

빠른 설치

pip install nadf

지원 Python: 3.10 이상

빠른 시작

import asyncio
from nadf.crawler import Crawler
from nadf.pdf import PDF


async def create_pdf(url : str):
    crawler = Crawler()
    name, data = await crawler.get_namuwiki_list(url)

    pdf = PDF(doc_title=f"{name} 분석 보고서")
    await pdf.create_pdf_from_namuwiki_list(data, "./")

if __name__ == "__main__":
    url = "https://namu.wiki/w/%EC%84%AC%EC%97%90%EC%96%B4"
    asyncio.run(create_pdf(url))

사용 팁

PDF 내부 폰트는 패키지 리소스로 자동 로드됩니다.

nadf/
 ├─ crawler/         # 크롤러 & HTTP 클라이언트
 ├─ decorator/       # URL 검증 등 데코레이터
 ├─ exception/       # 예외 정의
 ├─ fonts/           # NotoSerifKR Regular/Bold (동봉)
 ├─ parser/          # HTML 파서 등
 └─ pdf/             # PDF 생성기 

참고

PR과 이슈 환영합니다!
버그 리포트 시 재현 코드/환경(Python 버전)과 로그를 함께 제공해 주세요.

라이선스

MIT License (패키지 내 LICENSE 참고)

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

nadf-0.1.11.tar.gz (11.1 MB view details)

Uploaded Source

Built Distribution

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

nadf-0.1.11-py3-none-any.whl (11.1 MB view details)

Uploaded Python 3

File details

Details for the file nadf-0.1.11.tar.gz.

File metadata

  • Download URL: nadf-0.1.11.tar.gz
  • Upload date:
  • Size: 11.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for nadf-0.1.11.tar.gz
Algorithm Hash digest
SHA256 2d38f3f3a75c5b63a80d68d2ad2106deb8bfcb48ee9a8cb5315d898b14c4f9a7
MD5 b169e3fa18f53a66114ca8257c0a2647
BLAKE2b-256 5eef30420b7b05ffa408135a50fe4775536cd98c53318013a22aac14a713cc66

See more details on using hashes here.

File details

Details for the file nadf-0.1.11-py3-none-any.whl.

File metadata

  • Download URL: nadf-0.1.11-py3-none-any.whl
  • Upload date:
  • Size: 11.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for nadf-0.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 a47d07bf730f745ff36a7b4d56a4c147b81d3d79efeb3cd8a579847b99a5af4e
MD5 fc53f3b3de732537e049001c2d2498a7
BLAKE2b-256 0dd21ecd4a3c718ca60187888fbd92799130756c01f5c29311fe3aba8c69d8ed

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