# parse_repository_metadata

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/_git/parse_repository_metadata)

Derive repository attribution from an `origin` remote URL.

Handles both HTTPS (`https://github.com/org/repo.git`) and scp-style SSH
(`git@github.com:org/repo.git`) remotes, normalizing the URL to its
canonical `https://<host>/<org>/<repo>` form and stripping any embedded
credentials.

## Signature

```python
parse_repository_metadata(
    remote_url: str,
) -> RepositoryMetadata | None
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `remote_url` | `str` | Yes | The raw `origin` remote URL. |

## Returns

`RepositoryMetadata | None`

A `RepositoryMetadata` of the normalized URL, provider slug
(`github`/`gitlab`/`bitbucket`/`other`), and `org/repo` name,
or `None` when the URL cannot be parsed.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/e14e0adcbe78565ed3650e7f24b2a775d5437d25/libs/code/deepagents_code/_git.py#L481)