Skip to content

Commit 2f2a115

Browse files
authored
Update package_name and client options in Python Configuration doc (#275)
1 parent 8c058d8 commit 2f2a115

File tree

1 file changed

+48
-5
lines changed

1 file changed

+48
-5
lines changed

fern/products/sdks/overview/python/configuration.mdx

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ description: Configuration options for the Fern Python SDK.
55

66
You can customize the behavior of the Python SDK generator in `generators.yml`:
77

8-
```yaml {7-9}
8+
```yaml {7-10}
99
default-group: local
1010
groups:
1111
local:
1212
generators:
1313
- name: fernapi/fern-python
1414
version: 0.7.1
1515
config:
16+
package_name: "your_package"
1617
client:
1718
class_name: "YourClient"
1819
```
@@ -22,9 +23,6 @@ groups:
2223
<ParamField path="additional_init_exports" type="array" default="null" required={false} toc={true}>
2324
</ParamField>
2425
25-
<ParamField path="client" type="ClientConfiguration" default="ClientConfiguration()" required={false} toc={true}>
26-
</ParamField>
27-
2826
<ParamField path="default_bytes_stream_chunk_size" type="number" default="null" required={false} toc={true}>
2927
The chunk size to use (if any) when processing a response bytes stream within `iter_bytes` or `aiter_bytes` results in: `for chunk in response.iter_bytes(chunk_size=<default_bytes_stream_chunk_size>):`
3028
</ParamField>
@@ -34,7 +32,7 @@ groups:
3432

3533
<ParamField path="extra_dependencies" type="object" default="{}" required={false} toc={true}>
3634
If you want to add custom dependencies to your generated SDK, you can specify them using this configuration. For example, to add a dependency on boto3, your config would look like:
37-
```
35+
```yaml
3836
config:
3937
extra_dependencies:
4038
boto3: 1.28.15
@@ -74,6 +72,23 @@ groups:
7472
</ParamField>
7573

7674
<ParamField path="package_name" type="string" default="null" required={false} toc={true}>
75+
76+
Specifies the Python package name that users will import your generated client
77+
from.
78+
79+
For example, setting `package_name: "my_custom_package"` enables users to use
80+
`my_custom_package import Client` to import your client:
81+
82+
```yaml {7-10}
83+
default-group: local
84+
groups:
85+
local:
86+
generators:
87+
- name: fernapi/fern-python
88+
version: 0.7.1
89+
config:
90+
package_name: "my_custom_package"
91+
```
7792
</ParamField>
7893

7994
<ParamField path="pydantic_config" type="SdkPydanticModelCustomConfig" default="SdkPydanticModelCustomConfig()" required={false} toc={true}>
@@ -151,4 +166,32 @@ groups:
151166

152167
<ParamField path="use_typeddict_requests_for_file_upload" type="bool" default="false" required={false} toc={true}>
153168
Whether or not to generate TypedDicts instead of Pydantic Models for file upload request objects. Note that this flag was only introduced due to an oversight in the `use_typeddict_requests` flag implementation; it should be removed in the future.
169+
</ParamField>
170+
171+
### client
172+
Configuration for the generated client class and file structure.
173+
174+
```yaml
175+
config:
176+
client:
177+
filename: "my_client.py"
178+
class_name: "MyClient"
179+
exported_filename: "my_client.py"
180+
exported_class_name: "MyClient"
181+
```
182+
183+
<ParamField path="filename" type="string" default="client.py" required={false} toc={true}>
184+
The filename for the generated client file.
185+
</ParamField>
186+
187+
<ParamField path="class_name" type="string" default="null" required={false} toc={true}>
188+
The name of the generated client class.
189+
</ParamField>
190+
191+
<ParamField path="exported_filename" type="string" default="client.py" required={false} toc={true}>
192+
The filename of the exported client which will be used in code snippets.
193+
</ParamField>
194+
195+
<ParamField path="exported_class_name" type="string" default="null" required={false} toc={true}>
196+
The name of the exported client class that will be used in code snippets.
154197
</ParamField>

0 commit comments

Comments
 (0)