> ## Documentation Index
> Fetch the complete documentation index at: https://anaconda.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# package_code

```python theme={null}
package_code(
    src_paths: List[str],
    suffixes: Optional[List[str]] = None,
    logger: Optional[Callable[[str], Any]] = None
)
```

Package code for deployment to Anaconda Platform.

This is a composable building block that can be used standalone or
combined with AppDeployer to deploy apps with custom code packages.

**Parameters:**

**src\_paths** `string[]` *required*

Directories to include in the package. All paths must exist and be directories.

**suffixes** `string[]`

File extensions to include, such as `[".py", ".json", ".yaml"]`. If not set, uses the default suffixes: `.py`, `.txt`, `.yaml`, `.yml`, `.json`, `.html`, `.css`, `.js`, `.jsx`, `.ts`, `.tsx`, `.md`, `.rst`.

**logger** `function`

Logger function for progress messages. Receives a single string argument.

**Returns:**

**value** `PackagedCode`

A named tuple containing `url` (the package URL in object storage) and `key` (the unique content-addressed key identifying this package).

**Raises:**

* **CodePackagingException**: If packaging fails or if invalid paths are provided.

**Examples:**

Package a directory:

```python theme={null}
pkg = package_code(src_paths=["./src"])
print(pkg.url)
```

Package multiple directories:

```python theme={null}
pkg = package_code(src_paths=["./src", "./configs"])
```

Package with specific file types:

```python theme={null}
pkg = package_code(
    src_paths=["./app"],
    suffixes=[".py", ".yaml", ".json"]
)
```
