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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file office_to_pdf_client-0.1.0.tar.gz.
File metadata
- Download URL: office_to_pdf_client-0.1.0.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
72dedcd04964c252701efc49cda80bc5ee4f3745c2b9156cbe892a2b968d63d5
|
|
| MD5 |
51d9f1a8cfd9ddf1354a546d1174388f
|
|
| BLAKE2b-256 |
1f10b6b696fc7e96fd35c3e310f2eea478b5e81da67e30ad956f4d389797337e
|
File details
Details for the file office_to_pdf_client-0.1.0-py3-none-any.whl.
File metadata
- Download URL: office_to_pdf_client-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
baf76389f5cad492e0bb3741eaf5cc3ebc9199e240a053c441f99010dac15dc5
|
|
| MD5 |
f9147caca2c7c7af50da4bbb1eafb3b0
|
|
| BLAKE2b-256 |
1943864cc7a67f288f4e574e6ff17c66850ac3707e8569fa5ce36585086506bb
|