Client APIs
Python Function API
You can create a DuckDB user-defined function (UDF) from a Python function so it can be used in SQL queries.
Similarly to regular [functions](#docs:sql:functions:overview), they need to have a name, a return type and parameter types.  
Here is an example using a Python function that calls a third-party library.  
```python
import duckdb
from duckdb.typing import *
from faker import Faker

def generate_random_name():
fake = Faker()
return fake.name()

duckdb.create_function("random_name", generate_random_name, [], VARCHAR)
res = duckdb.sql("SELECT random_name()").fetchall()
print(res)
```  
```text
[('Gerald Ashley',)]
```