Skip to content

users

Class info

🛈 DocStrings

create_owner

create_owner(url: str, **kwargs: Any) -> Owner

Create a proxy-wrapped owner instance from a URL.

Parameters:

Name Type Description Default
url str

The owner URL (e.g. 'https://github.com/phil65')

required
**kwargs Any

Provider-specific configuration (tokens, etc.)

{}

Returns:

Name Type Description
Owner Owner

Proxy-wrapped owner instance

Raises:

Type Description
OwnerNotFoundError

If the URL isn't supported or no owner found

Source code in src/githarbor/users.py
def create_owner(url: str, **kwargs: Any) -> Owner:
    """Create a proxy-wrapped owner instance from a URL.

    Args:
        url: The owner URL (e.g. 'https://github.com/phil65')
        **kwargs: Provider-specific configuration (tokens, etc.)

    Returns:
        Owner: Proxy-wrapped owner instance

    Raises:
        OwnerNotFoundError: If the URL isn't supported or no owner found
    """
    try:
        return RepoRegistry.owner_from_url(url, **kwargs)
    except Exception as e:
        msg = f"Failed to create owner from {url}: {e!s}"
        raise OwnerNotFoundError(msg) from e