festivo-python 0.1.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: festivo-python
|
|
3
|
+
Version: 0.1.4
|
|
4
|
+
Summary: Festivo Python SDK (starter)
|
|
5
|
+
Author: Festivo
|
|
6
|
+
Author-email: dev@getfestivo.com
|
|
7
|
+
Requires-Python: >=3.9
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
15
|
+
Requires-Dist: requests (>=2.0,<3.0)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import requests
|
|
3
|
+
from typing import Optional
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class FestivoClient:
|
|
7
|
+
def __init__(self, api_key: Optional[str] = None, base_url: str = "https://api.getfestivo.com"):
|
|
8
|
+
self.api_key = api_key or os.getenv("FESTIVO_KEY")
|
|
9
|
+
self.base_url = base_url
|
|
10
|
+
|
|
11
|
+
def _headers(self):
|
|
12
|
+
h = {"Accept": "application/json"}
|
|
13
|
+
if self.api_key:
|
|
14
|
+
h["Authorization"] = f"Bearer {self.api_key}"
|
|
15
|
+
return h
|
|
16
|
+
|
|
17
|
+
def get_invoice(self, invoice_id: str):
|
|
18
|
+
resp = requests.get(f"{self.base_url}/invoices/{invoice_id}", headers=self._headers())
|
|
19
|
+
resp.raise_for_status()
|
|
20
|
+
return resp.json()
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
[tool.poetry]
|
|
2
|
+
name = "festivo-python"
|
|
3
|
+
version = "0.1.4"
|
|
4
|
+
description = "Festivo Python SDK (starter)"
|
|
5
|
+
authors = ["Festivo <dev@getfestivo.com>"]
|
|
6
|
+
packages = [
|
|
7
|
+
{ include = "festivo" }
|
|
8
|
+
]
|
|
9
|
+
|
|
10
|
+
[tool.poetry.dependencies]
|
|
11
|
+
python = ">=3.9"
|
|
12
|
+
requests = "^2.0"
|
|
13
|
+
|
|
14
|
+
[build-system]
|
|
15
|
+
requires = ["poetry-core>=1.0.0"]
|
|
16
|
+
build-backend = "poetry.core.masonry.api"
|