Metadata-Version: 2.4
Name: fern-beta-uat-pets-2c8d06-sc
Version: 0.0.1.dev2026101215445236
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.31.0
Requires-Dist: pydantic<3.0.0,>=2.0.0

# DirectPublishingTest Python SDK 1.0.0<a id="directpublishingtest-python-sdk-100"></a>

Welcome to the DirectPublishingTest SDK documentation. This guide will help you get started with integrating and using the DirectPublishingTest SDK in your project.

## Versions<a id="versions"></a>

- SDK version: `1.0.0`

## Table of Contents<a id="table-of-contents"></a>

- [Setup & Configuration](#setup--configuration)
  - [Supported Language Versions](#supported-language-versions)
  - [Installation](#installation)
- [Setting a Custom Timeout](#setting-a-custom-timeout)
- [Sample Usage](#sample-usage)
- [Services](#services)
- [Models](#models)

# Setup & Configuration<a id="setup--configuration"></a>

## Supported Language Versions<a id="supported-language-versions"></a>

This SDK is compatible with the following versions: `Python >= 3.9`

## Installation<a id="installation"></a>

To get started with the SDK, we recommend installing using `pip`:

```bash
pip install fern-beta-uat-pets-2c8d06-sc
```

If you are using Python 3, you can use `pip3` instead:

```bash
pip3 install fern-beta-uat-pets-2c8d06-sc
```

## Disabling Redirects<a id="disabling-redirects"></a>

By default, the SDK follows HTTP redirects (3xx responses) automatically. Pass
`follow_redirects=False` to get the redirect response back as-is instead:

```python
client = FernApi(follow_redirects=False)
```

This can also be changed later with `client.set_follow_redirects(False)`.

## Logging<a id="logging"></a>

The SDK is silent by default. Pass a standard library `logging.Logger` as `logger` to log
every outgoing request and its response (method, URL, status, and duration):

```python
import logging

logger = logging.getLogger("FernApi")
logger.setLevel(logging.INFO)
logger.addHandler(logging.StreamHandler())

client = FernApi(logger=logger)
```

This can also be changed later with `client.set_logging(logger)`.

`Authorization` and `Cookie` header values are always redacted in logged output, regardless
of the logger's own configuration.

## Setting a Custom Timeout<a id="setting-a-custom-timeout"></a>

You can set a custom timeout for the SDK's HTTP requests as follows:

```py
from fern import FernApi

sdk = FernApi(timeout=10)
```

# Sample Usage<a id="sample-usage"></a>

Below is a comprehensive example demonstrating how to authenticate and call a simple endpoint:

```py
from fern import FernApi

sdk = FernApi(
    timeout=10
)

result = sdk.widgets.get_widget(widget_id="widgetId")

print(result)

```

# Async Usage<a id="async-usage"></a>

The SDK includes an Async Client for making asynchronous API requests. This is useful for applications that need non-blocking operations, like web servers or apps with a graphical user interface.

```py
import asyncio
from fern import AsyncFernApi

sdk = AsyncFernApi(
    timeout=10
)


async def main():
  result = await sdk.widgets.get_widget(widget_id="widgetId")
  print(result)

asyncio.run(main())
```

## Services<a id="services"></a>

The SDK provides various services to interact with the API.

<details> 
<summary>Below is a list of all available services:</summary>

| Name    |
| :------ |
| widgets |

</details>

## Models<a id="models"></a>

The SDK includes several models that represent the data structures used in API requests and responses. These models help in organizing and managing the data efficiently.

<details> 
<summary>Below is a list of all available models:</summary>

| Name   | Description |
| :----- | :---------- |
| Widget |             |

</details>
