# FuncProfiler Package Documentation

## Changelog

* **1.1.0 (Latest)**:&#x20;
  * Added support for 2 new export formats: `yaml` and `toml`.
  * Exports now include more information: peak memory usage, timestamp, arguments, return value, filepath, line number, and docstring.
  * Added `enabled` and `log_level` options to the decorators.
  * Improved export formats for better readability.
* **1.0.2**: Created 2 new export formats: `xml`, `md` for both function profiling and line-by-line profiling.
* **1.0.1**: Updated PYPI project description.
* **1.0.0**: Initial release.

## Installation

You can install FuncProfiler using PyPi, please make sure that you are using Python 3.6 or later before installing FuncProfiler:

```bash
pip install funcprofiler
```

***

## Example Usage

### Function Profiling

```python
from funcprofiler import function_profile

# Exporting as `html` with logging enabled
@function_profile(export_format="html", shared_log=True)
def some_function():
    return "Hello World."

# Call the function
message = some_function()
```

### Line-by-Line Profiling

```python
from funcprofiler import line_by_line_profile

# Logging enabled without exports
@line_by_line_profile(shared_log=True)
def some_complicated_function(n):
    total = 0
    for i in range(n):
        for j in range(i):
            total += (i * j) ** 0.5  # Square root calculation
    return total

# Call the function
total = some_complicated_function(1000)
```

{% hint style="info" %}
**FuncProfiler** can be added to any function using the callable format: `@funcprofiler_function_name(expected_arguments)`.
{% endhint %}


---

# Agent Instructions: 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:

```
GET https://infinitode-docs.gitbook.io/documentation/package-documentation/funcprofiler-package-documentation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
