micropy.utils

micropy.utils

This module provides utility functions that are used within MicropyCli.

Functions

create_dir_link(source, target)

Creates a platform appropriate directory link.

ensure_existing_dir(path)

Ensure path exists and is a directory.

ensure_valid_url(url)

Ensure a url is valid.

extract_tarbytes(file_bytes, path)

Extract tarfile as bytes.

generate_stub(path[, log_func])

Create Stub from local .py file.

get_package_meta(name, url)

Retrieve package metadata from PyPi.

get_url_filename(url)

Parse filename from url.

is_dir_link(path)

Test if path is either a symlink or directory junction.

is_downloadable(url)

Checks if the url can be downloaded from.

is_existing_dir(path)

Check if path is an existing directory.

is_url(url)

Check if provided string is a url.

iter_requirements(path)

Iterate requirements from a requirements.txt file.

search_xml(url, node)

Search xml from url by node.

stream_download(url, **kwargs)

Stream download with tqdm progress bar.

is_update_available()

Check if micropy-cli update is available.

get_cached_data(url)

Wrap requests with a short cache.

get_class_that_defined_method(meth)

Determines Class that defined a given method.

Classes

PyboardWrapper(port[, connect, verbose])

Wrapper for rshell/pyboard.

Validator(schema_path)

“jsonschema wrapper for file validation.