datalad_next.utils

Assorted utility functions

DataladAuth(cfg[, credential])

Requests-style authentication handler using DataLad credentials

MultiHash(algorithms)

Compute any number of hashes as if computing just one

check_symlink_capability(path, target)

helper similar to datalad.tests.utils_pytest.has_symlink_capability

chpwd(path[, mkdir, logsuffix])

Wrapper around os.chdir which also adjusts environ['PWD']

ensure_list(s[, copy, iterate])

Given not a list, would place it into a list.

external_versions

Helper to figure out/use versions of the externals (modules, cmdline tools, etc).

log_progress(lgrcall, pid, *args, **kwargs)

Emit progress log messages

parse_www_authenticate(hdr)

Parse HTTP www-authenticate header

patched_env(**env)

Context manager for patching the process environment

rmtree(path[, chmod_files, children_only])

To remove git-annex .git it is needed to make all files and directories writable again first

get_specialremote_param_dict(params)

param params:

get_specialremote_credential_properties(params)

Determine properties of credentials special remote configuration

update_specialremote_credential(srtype, ...)

param srtype:

needs_specialremote_credential_envpatch(...)

Returns whether the environment needs to be patched with credentials

get_specialremote_credential_envpatch(...)

Create an environment path for a particular remote type and credential

class datalad_next.utils.ParamDictator(params: Dict)[source]

Bases: object

Parameter dict access helper

This class can be used to wrap a dict containing function parameter name-value mapping, and get/set values by parameter name attribute rather than via the __getitem__ dict API.