> For the complete documentation index, see [llms.txt](https://docs.bezier.octue.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bezier.octue.com/developers/bezier-for-python-users.md).

# Bézier for Python users

{% hint style="danger" %}
After four years of internal use, the Bézier python package is presently being open-sourced. We're working with a select few early-stage customers to simplify and improve its performance and documentation, as well as bringing it up to date with the latest evolutions in the upcoming IEC 61400-16 standard.

If you'd like early access to the python library please [contact us](https://bezier.octue.com/contact).

Until general release, the instructions below **won't work** - but this page should give you a flavour of what's coming.
{% endhint %}

## Installation

The [`bezier` package is available on pypi](https://pypi.org/octue/bezier/) so is easily installable with `pip`, `poetry` or any other python package manager. We recommend the use of the `uv` package manager for your python environment and dependencies ([here's why](https://github.com/astral-sh/uv)), so installation is as simple as:

```
uv add bezier

// Or if you prefer to use pip
pip install bezier
```

## Quick Start

{% hint style="info" %}
A **Turbine Label** is a short text label, `written-in-lower-kebab-case-0123456789`, that can uniquely define a power curve document. Mostly you'll use your own documents directly, but it's great to be able to refer to the examples quickly by their label.
{% endhint %}

You can use your own turbine power curves, expressed in `JSON` form. But there are turbines built in to the library for example purposes. You can load them up simply by using the label of that turbine:

```python
>> from bezier import ALL_TURBINE_LABELS
>> print(ALL_TURBINE_LABELS)
[ "gm-5-abc-1", "gm-5-abc-2", ... ]
```

You can load any of the builtin power curves directly from its label, and inspect its data.

```python
>> curve = PowerCurve('gm-5-abc-1')
>> print(curve.get_description())
"The GM-5-ABC-1 turbine, part of Generic Machines' 5MW platform, is the first totally fictional example turbine I could think of"
```

Each top level power curve document can represent multiple "modes" of turbine operation. See which ones are available, and which is the default:

```python
>> print(curve.available_modes)
>> print(curve.default_mode)
```

Use the default mode, and determine the power and thrust for an input time-series of air density and wind speed:

<pre><code><strong>>> mode_label = curve.default_mode
</strong><strong>>> operating_point = {
</strong>  "air-density": np.array([1.223, 1.224, 1.225, 1.220]),
  "wind-speed": np.array([8.63, 10.89, 11.81, 6.28]),
}
>> power, thrust, parameter_labels, xi = curve.get_performance(mode_label, operating_point, as_timeseries=True)
>> print(power)
np.array([4653000, 4853000, 5053000, 2653000])
</code></pre>

## Next steps

Check the [bezier-python library on GitHub](https://github.com/octue/bezier-python) for more advanced use cases and package API documentation.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.bezier.octue.com/developers/bezier-for-python-users.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
