nitpick.style.fetchers package
Style fetchers with protocol support.
- class nitpick.style.fetchers.Scheme(value)[source]
Bases:
LowercaseStrEnum
URL schemes.
- FILE = 'file'
- GH = 'gh'
- GITHUB = 'github'
- HTTP = 'http'
- HTTPS = 'https'
- PY = 'py'
- PYPACKAGE = 'pypackage'
- class nitpick.style.fetchers.StyleFetcherManager(offline: bool, cache_dir: Path, cache_option: str)[source]
Bases:
object
Manager that controls which fetcher to be used given a protocol.
- cache_dir: Path
- fetch(url: furl) str | None [source]
Determine which fetcher to be used and fetch from it.
Returns None when offline is True and the fetcher would otherwise require a connection.
- fetchers: dict[str, StyleFetcher]
- normalize_url(url: str | furl, base: furl) furl [source]
Normalize a style URL.
The URL is made absolute against base, then passed to individual fetchers to produce a canonical version of the URL.
- session: CachedSession
Submodules
- nitpick.style.fetchers.base module
- nitpick.style.fetchers.file module
- nitpick.style.fetchers.github module
GitHubFetcher
GitHubURL
GitHubURL.api_url
GitHubURL.auth_token
GitHubURL.credentials
GitHubURL.default_branch
GitHubURL.from_furl()
GitHubURL.git_reference
GitHubURL.git_reference_or_default
GitHubURL.long_protocol_url
GitHubURL.owner
GitHubURL.path
GitHubURL.query_params
GitHubURL.raw_content_url
GitHubURL.repository
GitHubURL.short_protocol_url
GitHubURL.token
GitHubURL.url
get_default_branch()
- nitpick.style.fetchers.http module
- nitpick.style.fetchers.pypackage module