---
title: callable_name (Python agent API)
source: https://docs.newrelic.com/docs/apm/agents/python-agent/python-agent-api/callablename-python-agent-api
---

## Syntax

```py
newrelic.agent.callable_name(object, separator=':')
```

Returns a string name identifying the supplied object.

## Description

This call returns a string name identifying the supplied object. This is often used to programmatically name [function traces](https://docs.newrelic.com/docs/agents/python-agent/python-agent-api/function_trace).

## Parameters

| Parameter                                          | Description                                                                                                                                                                                                                                                                  |
| -------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `object` _function_, _class,_ or _member function_ | Required. The type of object supplied.                                                                                                                                                                                                                                       |
| `separator` _string_                               | Optional. Used for overriding the default `:` separator. By default, the separator between the module path and the object path is `:`. The convention used by the Python agent is `:` so that it is clear which part is the module name and which is the name of the object. |

## Return values

Returns a string name identifying the supplied object.

The returned name will be in the form `module:object_path`. If the object supplied is a function, then the name returned would be in the form `module:function`. If the object is a class, the form would be `module:class`. If a member function, the form would be `module:class.function`.

## Examples

### Set name for function trace [#trace-example]

Here's an example of using `callable_name` to set the name of a [function trace](https://docs.newrelic.com/docs/agents/python-agent/python-agent-api/function_trace):

```py
name = callable_name(func)

with FunctionTrace(txn, name):
    func()
```
