Skip to content

Commit e86b7d5

Browse files
committed
Release 0.1.5
1 parent 0de06fb commit e86b7d5

File tree

4 files changed

+31
-31
lines changed

4 files changed

+31
-31
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pip install --upgrade fileforge
2121
from fileforge.client import Fileforge
2222

2323
client = Fileforge(
24-
header="YOUR_HEADER",
24+
api_key="YOUR_API_KEY",
2525
)
2626
```
2727
<!-- End Usage -->
@@ -33,7 +33,7 @@ client = Fileforge(
3333
from fileforge.client import AsyncFileforge
3434

3535
client = AsyncFileforge(
36-
header="YOUR_HEADER",
36+
api_key="YOUR_API_KEY",
3737
)
3838
```
3939
<!-- End Async Usage -->

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "fileforge"
3-
version = "0.1.4"
3+
version = "0.1.5"
44
description = ""
55
readme = "README.md"
66
authors = []

src/fileforge/client.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class Fileforge:
4747
4848
4949
50-
header : typing.Optional[str]
50+
api_key : typing.Optional[str]
5151
timeout : typing.Optional[float]
5252
The timeout to be used, in seconds, for requests by default the timeout is 60 seconds, unless a custom httpx client is used, in which case a default is not set.
5353
@@ -62,7 +62,7 @@ class Fileforge:
6262
from fileforge.client import Fileforge
6363
6464
client = Fileforge(
65-
header="YOUR_HEADER",
65+
api_key="YOUR_API_KEY",
6666
)
6767
"""
6868

@@ -71,19 +71,19 @@ def __init__(
7171
*,
7272
base_url: typing.Optional[str] = None,
7373
environment: FileforgeEnvironment = FileforgeEnvironment.DEFAULT,
74-
header: typing.Optional[str] = os.getenv("FILEFORGE_API_KEY"),
74+
api_key: typing.Optional[str] = os.getenv("FILEFORGE_API_KEY"),
7575
timeout: typing.Optional[float] = None,
7676
follow_redirects: typing.Optional[bool] = True,
7777
httpx_client: typing.Optional[httpx.Client] = None,
7878
):
7979
_defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None
80-
if header is None:
80+
if api_key is None:
8181
raise ApiError(
82-
body="The client must be instantiated be either passing in header or setting FILEFORGE_API_KEY"
82+
body="The client must be instantiated be either passing in api_key or setting FILEFORGE_API_KEY"
8383
)
8484
self._client_wrapper = SyncClientWrapper(
8585
base_url=_get_base_url(base_url=base_url, environment=environment),
86-
header=header,
86+
api_key=api_key,
8787
httpx_client=httpx_client
8888
if httpx_client is not None
8989
else httpx.Client(timeout=_defaulted_timeout, follow_redirects=follow_redirects)
@@ -108,7 +108,7 @@ def retrieve_server_status(self, *, request_options: typing.Optional[RequestOpti
108108
from fileforge.client import Fileforge
109109
110110
client = Fileforge(
111-
header="YOUR_HEADER",
111+
api_key="YOUR_API_KEY",
112112
)
113113
client.retrieve_server_status()
114114
"""
@@ -211,7 +211,7 @@ def convert_docx(
211211
from fileforge.client import Fileforge
212212
213213
client = Fileforge(
214-
header="YOUR_HEADER",
214+
api_key="YOUR_API_KEY",
215215
)
216216
client.convert_docx()
217217
"""
@@ -292,7 +292,7 @@ def generate(
292292
from fileforge.client import Fileforge
293293
294294
client = Fileforge(
295-
header="YOUR_HEADER",
295+
api_key="YOUR_API_KEY",
296296
)
297297
client.generate()
298298
"""
@@ -372,7 +372,7 @@ def merge(
372372
from fileforge.client import Fileforge
373373
374374
client = Fileforge(
375-
header="YOUR_HEADER",
375+
api_key="YOUR_API_KEY",
376376
)
377377
client.merge()
378378
"""
@@ -441,7 +441,7 @@ class AsyncFileforge:
441441
442442
443443
444-
header : typing.Optional[str]
444+
api_key : typing.Optional[str]
445445
timeout : typing.Optional[float]
446446
The timeout to be used, in seconds, for requests by default the timeout is 60 seconds, unless a custom httpx client is used, in which case a default is not set.
447447
@@ -456,7 +456,7 @@ class AsyncFileforge:
456456
from fileforge.client import AsyncFileforge
457457
458458
client = AsyncFileforge(
459-
header="YOUR_HEADER",
459+
api_key="YOUR_API_KEY",
460460
)
461461
"""
462462

@@ -465,19 +465,19 @@ def __init__(
465465
*,
466466
base_url: typing.Optional[str] = None,
467467
environment: FileforgeEnvironment = FileforgeEnvironment.DEFAULT,
468-
header: typing.Optional[str] = os.getenv("FILEFORGE_API_KEY"),
468+
api_key: typing.Optional[str] = os.getenv("FILEFORGE_API_KEY"),
469469
timeout: typing.Optional[float] = None,
470470
follow_redirects: typing.Optional[bool] = True,
471471
httpx_client: typing.Optional[httpx.AsyncClient] = None,
472472
):
473473
_defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None
474-
if header is None:
474+
if api_key is None:
475475
raise ApiError(
476-
body="The client must be instantiated be either passing in header or setting FILEFORGE_API_KEY"
476+
body="The client must be instantiated be either passing in api_key or setting FILEFORGE_API_KEY"
477477
)
478478
self._client_wrapper = AsyncClientWrapper(
479479
base_url=_get_base_url(base_url=base_url, environment=environment),
480-
header=header,
480+
api_key=api_key,
481481
httpx_client=httpx_client
482482
if httpx_client is not None
483483
else httpx.AsyncClient(timeout=_defaulted_timeout, follow_redirects=follow_redirects)
@@ -502,7 +502,7 @@ async def retrieve_server_status(self, *, request_options: typing.Optional[Reque
502502
from fileforge.client import AsyncFileforge
503503
504504
client = AsyncFileforge(
505-
header="YOUR_HEADER",
505+
api_key="YOUR_API_KEY",
506506
)
507507
await client.retrieve_server_status()
508508
"""
@@ -605,7 +605,7 @@ async def convert_docx(
605605
from fileforge.client import AsyncFileforge
606606
607607
client = AsyncFileforge(
608-
header="YOUR_HEADER",
608+
api_key="YOUR_API_KEY",
609609
)
610610
await client.convert_docx()
611611
"""
@@ -686,7 +686,7 @@ async def generate(
686686
from fileforge.client import AsyncFileforge
687687
688688
client = AsyncFileforge(
689-
header="YOUR_HEADER",
689+
api_key="YOUR_API_KEY",
690690
)
691691
await client.generate()
692692
"""
@@ -766,7 +766,7 @@ async def merge(
766766
from fileforge.client import AsyncFileforge
767767
768768
client = AsyncFileforge(
769-
header="YOUR_HEADER",
769+
api_key="YOUR_API_KEY",
770770
)
771771
await client.merge()
772772
"""

src/fileforge/core/client_wrapper.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@
88

99

1010
class BaseClientWrapper:
11-
def __init__(self, *, header: str, base_url: str, timeout: typing.Optional[float] = None):
12-
self.header = header
11+
def __init__(self, *, api_key: str, base_url: str, timeout: typing.Optional[float] = None):
12+
self.api_key = api_key
1313
self._base_url = base_url
1414
self._timeout = timeout
1515

1616
def get_headers(self) -> typing.Dict[str, str]:
1717
headers: typing.Dict[str, str] = {
1818
"X-Fern-Language": "Python",
1919
"X-Fern-SDK-Name": "fileforge",
20-
"X-Fern-SDK-Version": "0.1.4",
20+
"X-Fern-SDK-Version": "0.1.5",
2121
}
22-
headers["X-API-Key"] = self.header
22+
headers["X-API-Key"] = self.api_key
2323
return headers
2424

2525
def get_base_url(self) -> str:
@@ -31,15 +31,15 @@ def get_timeout(self) -> typing.Optional[float]:
3131

3232
class SyncClientWrapper(BaseClientWrapper):
3333
def __init__(
34-
self, *, header: str, base_url: str, timeout: typing.Optional[float] = None, httpx_client: httpx.Client
34+
self, *, api_key: str, base_url: str, timeout: typing.Optional[float] = None, httpx_client: httpx.Client
3535
):
36-
super().__init__(header=header, base_url=base_url, timeout=timeout)
36+
super().__init__(api_key=api_key, base_url=base_url, timeout=timeout)
3737
self.httpx_client = HttpClient(httpx_client=httpx_client)
3838

3939

4040
class AsyncClientWrapper(BaseClientWrapper):
4141
def __init__(
42-
self, *, header: str, base_url: str, timeout: typing.Optional[float] = None, httpx_client: httpx.AsyncClient
42+
self, *, api_key: str, base_url: str, timeout: typing.Optional[float] = None, httpx_client: httpx.AsyncClient
4343
):
44-
super().__init__(header=header, base_url=base_url, timeout=timeout)
44+
super().__init__(api_key=api_key, base_url=base_url, timeout=timeout)
4545
self.httpx_client = AsyncHttpClient(httpx_client=httpx_client)

0 commit comments

Comments
 (0)