BBBikeDownloader.validate_subregion_name¶
- BBBikeDownloader.validate_subregion_name(subregion_name, valid_names=None, raise_error=True, **kwargs)[source]¶
Validate an input name of a geographic (sub)region.
The validation is done by matching the input
subregion_nameto a name of a geographic (sub)region available on BBBike free download server.- Parameters:
subregion_name (str) – name of a (sub)region available on BBBike free download server
valid_names (Collection | None) – names of all (sub)regions available on a free download server
raise_error (bool) – (if the input fails to match a valid name) whether to raise the error
pydriosm.downloader.InvalidSubregionName, defaults toTrue
- Returns:
valid (sub)region name that matches, or is the most similar to, the input
- Return type:
str
Examples:
>>> from pydriosm.downloader import BBBikeDownloader >>> bbd = BBBikeDownloader() >>> subregion_name = 'birmingham' >>> subregion_name_ = bbd.validate_subregion_name(subregion_name) >>> subregion_name_ 'Birmingham'