Skip to main content

Pogodoc Quickstart

Generate documents in seconds using Pogodoc with Python.

Prerequisites

Before getting started with Pogodoc, make sure you have:

  • Python (version 3.7 or higher)
  • pip for package management
  • A Pogodoc account - Sign up here if you don't have one
  • A Pogodoc API token - Generate one from your API tokens page

1. Installing the package

Before using the Pogodoc SDK, you can install the required package:

pip install pogodoc

2. Create a client

Before creating a pogodoc client you need to generate POGODOC API token.

import os
from pogodoc import PogodocClient

pogodoc = PogodocClient(token=os.getenv("POGODOC_API_TOKEN"))

⚠️ Don’t forget to set your POGODOC_API_TOKEN in your .env file.

3. Generate a document

response = pogodoc.generate_document(
template="<h1>Hello <%= name %></h1>",
data={"name": "John Doe"},
render_config={
"type": "ejs",
"target": "pdf",
},
)

print(response["output"]["data"]["url"])

Learn more