bandersnatch_filter_plugins package

Package contents

Submodules

bandersnatch_filter_plugins.blocklist_name module

class bandersnatch_filter_plugins.blocklist_name.BlockListProject(*args: Any, **kwargs: Any)[source]

Bases: bandersnatch.filter.FilterProjectPlugin

blocklist_package_names: List[str] = []
check_match(**kwargs: Any)bool[source]

Check if the package name matches against a project that is blocklisted in the configuration.

Parameters

name (str) – The normalized package name of the package/project to check against the blocklist.

Returns

True if it matches, False otherwise.

Return type

bool

deprecated_name: str = 'blacklist_project'
filter(metadata: Dict)bool[source]

Check if the plugin matches based on the package’s metadata.

Returns

True if the values match a filter rule, False otherwise

Return type

bool

initialize_plugin()None[source]

Initialize the plugin

name = 'blocklist_project'
class bandersnatch_filter_plugins.blocklist_name.BlockListRelease(*args: Any, **kwargs: Any)[source]

Bases: bandersnatch.filter.FilterReleasePlugin

blocklist_package_names: List[packaging.requirements.Requirement] = []
deprecated_name: str = 'blacklist_release'
filter(metadata: Dict)bool[source]

Returns False if version fails the filter, i.e. matches a blocklist version specifier

initialize_plugin()None[source]

Initialize the plugin

name = 'blocklist_release'

bandersnatch_filter_plugins.filename_name module

class bandersnatch_filter_plugins.filename_name.ExcludePlatformFilter(*args: Any, **kwargs: Any)[source]

Bases: bandersnatch.filter.FilterReleaseFilePlugin

Filters releases based on regex patters defined by the user.

filter(metadata: Dict)bool[source]

Returns False if file matches any of the filename patterns

initialize_plugin()None[source]

Initialize the plugin reading patterns from the config.

name = 'exclude_platform'

bandersnatch_filter_plugins.latest_name module

class bandersnatch_filter_plugins.latest_name.LatestReleaseFilter(*args: Any, **kwargs: Any)[source]

Bases: bandersnatch.filter.FilterReleasePlugin

Plugin to download only latest releases

filter(metadata: Dict)bool[source]

Returns False if version fails the filter, i.e. is not a latest/current release

initialize_plugin()None[source]

Initialize the plugin reading patterns from the config.

keep = 0
latest: Sequence[str] = []
name = 'latest_release'

bandersnatch_filter_plugins.metadata_filter module

class bandersnatch_filter_plugins.metadata_filter.RegexFilter(*args: Any, **kwargs: Any)[source]

Bases: bandersnatch.filter.Filter

Plugin to download only packages having metadata matching at least one of the specified patterns.

filter(metadata: Dict)bool[source]

Filter out all projects that don’t match the specified metadata patterns.

initialize_plugin()None[source]

Initialize the plugin reading patterns from the config.

initilized = False
match_patterns = 'any'
name = 'regex_filter'
nulls_match = True
patterns: Dict = {}
class bandersnatch_filter_plugins.metadata_filter.RegexProjectMetadataFilter(*args: Any, **kwargs: Any)[source]

Bases: bandersnatch.filter.FilterMetadataPlugin, bandersnatch_filter_plugins.metadata_filter.RegexFilter

Plugin to download only packages having metadata matching at least one of the specified patterns.

filter(metadata: Dict)bool[source]

Check if the plugin matches based on the package’s metadata.

Returns

True if the values match a filter rule, False otherwise

Return type

bool

initilize_plugin()None[source]
initilized = False
match_patterns = 'any'
name = 'regex_project_metadata'
nulls_match = True
patterns: Dict = {}
class bandersnatch_filter_plugins.metadata_filter.RegexReleaseFileMetadataFilter(*args: Any, **kwargs: Any)[source]

Bases: bandersnatch.filter.FilterReleaseFilePlugin, bandersnatch_filter_plugins.metadata_filter.RegexFilter

Plugin to download only release files having metadata

matching at least one of the specified patterns.

filter(metadata: Dict)bool[source]

Check if the plugin matches based on the package’s metadata.

Returns

True if the values match a filter rule, False otherwise

Return type

bool

initilize_plugin()None[source]
initilized = False
match_patterns = 'any'
name = 'regex_release_file_metadata'
nulls_match = True
patterns: Dict = {}
class bandersnatch_filter_plugins.metadata_filter.VersionRangeFilter(*args: Any, **kwargs: Any)[source]

Bases: bandersnatch.filter.Filter

Plugin to download only items having metadata

version ranges matching specified versions.

filter(metadata: Dict)bool[source]

Return False for input not having metadata entries matching the specified version specifier.

initialize_plugin()None[source]

Initialize the plugin reading version ranges from the config.

initilized = False
name = 'version_range_filter'
nulls_match = True
specifiers: Dict = {}
class bandersnatch_filter_plugins.metadata_filter.VersionRangeProjectMetadataFilter(*args: Any, **kwargs: Any)[source]

Bases: bandersnatch.filter.FilterMetadataPlugin, bandersnatch_filter_plugins.metadata_filter.VersionRangeFilter

Plugin to download only projects having metadata

entries matching specified version ranges.

filter(metadata: dict)bool[source]

Check if the plugin matches based on the package’s metadata.

Returns

True if the values match a filter rule, False otherwise

Return type

bool

initialize_plugin()None[source]

Code to initialize the plugin

initilized = False
name = 'version_range_project_metadata'
nulls_match = True
specifiers: Dict = {}
class bandersnatch_filter_plugins.metadata_filter.VersionRangeReleaseFileMetadataFilter(*args: Any, **kwargs: Any)[source]

Bases: bandersnatch.filter.FilterReleaseFilePlugin, bandersnatch_filter_plugins.metadata_filter.VersionRangeFilter

Plugin to download only release files having metadata

entries matching specified version ranges.

filter(metadata: dict)bool[source]

Check if the plugin matches based on the package’s metadata.

Returns

True if the values match a filter rule, False otherwise

Return type

bool

initialize_plugin()None[source]

Code to initialize the plugin

initilized = False
name = 'version_range_release_file_metadata'
nulls_match = True
specifiers: Dict = {}

bandersnatch_filter_plugins.prerelease_name module

class bandersnatch_filter_plugins.prerelease_name.PreReleaseFilter(*args: Any, **kwargs: Any)[source]

Bases: bandersnatch.filter.FilterReleasePlugin

Filters releases considered pre-releases.

PRERELEASE_PATTERNS = ('.+rc\\d+$', '.+a(lpha)?\\d+$', '.+b(eta)?\\d+$', '.+dev\\d+$')
filter(metadata: Dict)bool[source]

Returns False if version fails the filter, i.e. follows a prerelease pattern

initialize_plugin()None[source]

Initialize the plugin reading patterns from the config.

name = 'prerelease_release'
patterns: List[Pattern] = []

bandersnatch_filter_plugins.regex_name module

class bandersnatch_filter_plugins.regex_name.RegexProjectFilter(*args: Any, **kwargs: Any)[source]

Bases: bandersnatch.filter.FilterProjectPlugin

Filters projects based on regex patters defined by the user.

check_match(name: str)bool[source]

Check if a release version matches any of the specified patterns.

Parameters

name (str) – Release name

Returns

True if it matches, False otherwise.

Return type

bool

filter(metadata: Dict)bool[source]

Check if the plugin matches based on the package’s metadata.

Returns

True if the values match a filter rule, False otherwise

Return type

bool

initialize_plugin()None[source]

Initialize the plugin reading patterns from the config.

name = 'regex_project'
patterns: List[Pattern] = []
class bandersnatch_filter_plugins.regex_name.RegexReleaseFilter(*args: Any, **kwargs: Any)[source]

Bases: bandersnatch.filter.FilterReleasePlugin

Filters releases based on regex patters defined by the user.

filter(metadata: Dict)bool[source]

Returns False if version fails the filter, i.e. follows a regex pattern

initialize_plugin()None[source]

Initialize the plugin reading patterns from the config.

name = 'regex_release'
patterns: List[Pattern] = []

bandersnatch_filter_plugins.allowlist_name module

class bandersnatch_filter_plugins.allowlist_name.AllowListProject(*args: Any, **kwargs: Any)[source]

Bases: bandersnatch.filter.FilterProjectPlugin

allowlist_package_names: List[str] = []
check_match(**kwargs: Any)bool[source]

Check if the package name matches against a project that is blocklisted in the configuration.

Parameters

name (str) – The normalized package name of the package/project to check against the blocklist.

Returns

True if it matches, False otherwise.

Return type

bool

deprecated_name: str = 'whitelist_project'
filter(metadata: Dict)bool[source]

Check if the plugin matches based on the package’s metadata.

Returns

True if the values match a filter rule, False otherwise

Return type

bool

initialize_plugin()None[source]

Initialize the plugin

name = 'allowlist_project'
class bandersnatch_filter_plugins.allowlist_name.AllowListRelease(*args: Any, **kwargs: Any)[source]

Bases: bandersnatch.filter.FilterReleasePlugin

allowlist_package_names: List[packaging.requirements.Requirement] = []
deprecated_name: str = 'whitelist_release'
filter(metadata: Dict)bool[source]

Returns False if version fails the filter, i.e. doesn’t matches an allowlist version specifier

initialize_plugin()None[source]

Initialize the plugin

name = 'allowlist_release'