examples: add examples to the docs

This commit is contained in:
Richard Kubíček
2025-02-28 19:17:41 +01:00
parent fa3d2ddf32
commit a20ae3fad0
4 changed files with 32 additions and 3 deletions

View File

@@ -36,7 +36,10 @@ from superfaktura.invoice import (
from superfaktura.utils.data_types import Date
if __name__ == "__main__":
def main():
"""
Main function to add Invoice and save it as a pdf using the SuperFaktura API.
"""
invoice = Invoice()
bank = BankAccount()
resp = invoice.add(
@@ -70,3 +73,7 @@ if __name__ == "__main__":
_pdf = invoice.get_pdf(invoice=resp, language=Language.English)
save_file_as_pdf(_pdf, "invoice.pdf")
if __name__ == "__main__":
main()