Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 48 additions & 5 deletions fern/products/sdks/overview/python/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ description: Configuration options for the Fern Python SDK.

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

```yaml {7-9}
```yaml {7-10}
default-group: local
groups:
local:
generators:
- name: fernapi/fern-python
version: 0.7.1
config:
package_name: "your_package"
client:
class_name: "YourClient"
```
Expand All @@ -22,9 +23,6 @@ groups:
<ParamField path="additional_init_exports" type="array" default="null" required={false} toc={true}>
</ParamField>

<ParamField path="client" type="ClientConfiguration" default="ClientConfiguration()" required={false} toc={true}>
</ParamField>

<ParamField path="default_bytes_stream_chunk_size" type="number" default="null" required={false} toc={true}>
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>):`
</ParamField>
Expand All @@ -34,7 +32,7 @@ groups:

<ParamField path="extra_dependencies" type="object" default="{}" required={false} toc={true}>
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:
```
```yaml
config:
extra_dependencies:
boto3: 1.28.15
Expand Down Expand Up @@ -74,6 +72,23 @@ groups:
</ParamField>

<ParamField path="package_name" type="string" default="null" required={false} toc={true}>

Specifies the Python package name that users will import your generated client
from.

For example, setting `package_name: "my_custom_package"` enables users to use
`my_custom_package import Client` to import your client:

```yaml {7-10}
default-group: local
groups:
local:
generators:
- name: fernapi/fern-python
version: 0.7.1
config:
package_name: "my_custom_package"
```
</ParamField>

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

<ParamField path="use_typeddict_requests_for_file_upload" type="bool" default="false" required={false} toc={true}>
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.
</ParamField>

### client
Configuration for the generated client class and file structure.

```yaml
config:
client:
filename: "my_client.py"
class_name: "MyClient"
exported_filename: "my_client.py"
exported_class_name: "MyClient"
```

<ParamField path="filename" type="string" default="client.py" required={false} toc={true}>
The filename for the generated client file.
</ParamField>

<ParamField path="class_name" type="string" default="null" required={false} toc={true}>
The name of the generated client class.
</ParamField>

<ParamField path="exported_filename" type="string" default="client.py" required={false} toc={true}>
The filename of the exported client which will be used in code snippets.
</ParamField>

<ParamField path="exported_class_name" type="string" default="null" required={false} toc={true}>
The name of the exported client class that will be used in code snippets.
</ParamField>