Skip to main content

DocAPI SDK - PDF/Image/Excel 변환 API

Project description

DocAPI Python SDK

PDF, Image, Excel 변환 API

설치

pip install docapi

사용법

from docapi import DocAPI

api = DocAPI("your_api_key")  # 또는 DOCAPI_KEY 환경변수

# PDF 병합
api.merge(["a.pdf", "b.pdf"]).save("merged.pdf")

# PDF 압축
api.compress("large.pdf").save("small.pdf")

# PDF → Word
api.to_word("doc.pdf").save("doc.docx")

# HTML → PDF
api.html_to_pdf("<h1>Hello</h1>").save("hello.pdf")

# URL → PDF
api.url_to_pdf("https://example.com").save("page.pdf")

# 이미지 → PDF
api.images_to_pdf(["1.jpg", "2.png"]).save("images.pdf")

# OCR
result = api.ocr("scan.pdf")
print(result.text)

API 목록

PDF

메서드 설명
merge(files) PDF 병합
split(file, pages) PDF 분할
compress(file, level) PDF 압축
rotate(file, angle) PDF 회전
protect(file, password) 암호 설정
unlock(file, password) 암호 해제
watermark(file, text) 워터마크
to_word(file) PDF → Word
to_excel(file) PDF → Excel
to_images(file) PDF → 이미지
extract_text(file) 텍스트 추출
ocr(file, lang) OCR

생성

메서드 설명
html_to_pdf(html) HTML → PDF
url_to_pdf(url) URL → PDF
md_to_pdf(md) Markdown → PDF
text_to_pdf(text) 텍스트 → PDF

이미지

메서드 설명
images_to_pdf(files) 이미지 → PDF
compress_image(file) 이미지 압축
resize_image(file) 리사이즈
convert_image(file, fmt) 포맷 변환
ocr_image(file) 이미지 OCR

Excel/Word

메서드 설명
excel_to_csv(file) Excel → CSV
excel_to_json(file) Excel → JSON
excel_to_pdf(file) Excel → PDF
word_to_pdf(file) Word → PDF

에러 처리

from docapi import DocAPI, DocAPIError

try:
    api = DocAPI("key")
    api.compress("file.pdf").save("out.pdf")
except DocAPIError as e:
    print(f"에러: {e}")

컨텍스트 매니저

with DocAPI("key") as api:
    api.merge(["a.pdf", "b.pdf"]).save("out.pdf")

API 키 발급

https://pdf.evesky.net

라이선스

MIT

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

evesky_docapi-1.0.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

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

evesky_docapi-1.0.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file evesky_docapi-1.0.0.tar.gz.

File metadata

  • Download URL: evesky_docapi-1.0.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for evesky_docapi-1.0.0.tar.gz
Algorithm Hash digest
SHA256 23f4761fa19fe85cb28a2d015ad125cb4efc967e225223ff16d4b178de04d58e
MD5 34041d7609186386db2475a79ccacee3
BLAKE2b-256 979759ea8f8503d3767400a2dc399cd98fe584d63ac58982c1d84fb7b336d36e

See more details on using hashes here.

File details

Details for the file evesky_docapi-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: evesky_docapi-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for evesky_docapi-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 23629c67a9df9974fd055940879dfeb992480f31b4676538ec331276e7ef7559
MD5 f579b8990c78910530f70a57eb998ce1
BLAKE2b-256 1275b199e5b8e2aac8f2d6c9f0e259e974b3f6df44250a8a6fb6fef5d50c054a

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