Skip to main content

Add your description here

Project description

office-to-pdf-client

クライアント使用方法

1. 事前準備

docker compose等でoffice-to-pdf-serveのサーバーを立ち上げる (docker composeの場合、"http://127.0.0.1:8000"でサーバーが立ち上がる)

2. クライアント使用例

以下のコード例のように、クライアントを使用できる (examples/client_example.py参照)

from pathlib import Path

from office_to_pdf_client import OfficeToPdfClient

office_to_pdf_url = "http://127.0.0.1:8000"
office_file_path = Path("./examples/test.xlsx")
output_file_path = Path("./examples/test.pdf")
# office-to-pdf-serveのホスト(office_to_pdf_url)を引数に与えて、クライアントのインスタンスを作成
client = OfficeToPdfClient(office_to_pdf_url)
# convert_to_pdfの引数に、入力ファイルパス(office_file_path), 出力ファイルパス(output_file_path)を与えて、対象のファイルをPDFに変換
client.convert_to_pdf(office_file_path, output_file_path)

※エンドポイント("/convert_to_pdf")は内部でURLに結合され、"http://127.0.0.1:8000/convert_to_pdf"のような形でバックエンドへリクエストが送信される

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

office_to_pdf_client-0.1.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

office_to_pdf_client-0.1.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file office_to_pdf_client-0.1.0.tar.gz.

File metadata

File hashes

Hashes for office_to_pdf_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 72dedcd04964c252701efc49cda80bc5ee4f3745c2b9156cbe892a2b968d63d5
MD5 51d9f1a8cfd9ddf1354a546d1174388f
BLAKE2b-256 1f10b6b696fc7e96fd35c3e310f2eea478b5e81da67e30ad956f4d389797337e

See more details on using hashes here.

File details

Details for the file office_to_pdf_client-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for office_to_pdf_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 baf76389f5cad492e0bb3741eaf5cc3ebc9199e240a053c441f99010dac15dc5
MD5 f9147caca2c7c7af50da4bbb1eafb3b0
BLAKE2b-256 1943864cc7a67f288f4e574e6ff17c66850ac3707e8569fa5ce36585086506bb

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