transitlos.cache¶
Cache-folder resolution for transitlos (never CWD-relative).
get_cache_dir(namespace='', cache_dir=None, create=True)
¶
Resolve a cache folder: explicit cache_dir (returned as is), else
$TRANSITLOS_CACHE_DIR/<namespace>, else <tempdir>/transitlos-cache/<namespace>.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
namespace
|
str
|
Sub-folder of the cache root. |
''
|
cache_dir
|
Optional[Union[str, Path]]
|
Explicit folder; returned as is. |
None
|
create
|
bool
|
Create the folder if missing. |
True
|
Returns:
| Type | Description |
|---|---|
Path
|
The cache folder. |
get_osm_dir(cache_dir=None, create=True)
¶
Folder for .osm.pbf street extracts (namespace osm); see :func:get_cache_dir.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cache_dir
|
Optional[Union[str, Path]]
|
Explicit folder; returned as is. |
None
|
create
|
bool
|
Create the folder if missing. |
True
|
Returns:
| Type | Description |
|---|---|
Path
|
The OSM cache folder. |