Utilities
Utilities.
Functions
|
Download a file from a given URL. |
|
Download a file from google drive. |
|
Download a file from S3. |
|
Get the base directory for a module. |
|
Get last commit hash for the given repo. |
|
Get the dataframe as bytes. |
|
Get a hash digest for a single hash. |
|
Calculate several hexdigests of hash algorithms for a file concurrently. |
|
Process hexdigests via URLs. |
|
Get the PyStow home directory. |
|
Get the mode pair. |
|
Get the PyStow home directory name. |
|
Get the numpy object as bytes. |
|
Check a file for hash sums. |
|
Get a beautiful soup parsed version of the given web page. |
|
Get an environment variable representing a path, or use the default. |
|
Unzip a file in the source to the target. |
|
Compress a file, then delete the original. |
|
Check if the object is a URL. |
|
Read models to a file as JSONL. |
|
Read models from a TSV file, iteratively. |
|
Iterate over the lines from tarred CSV files. |
|
Iterate over opened files in a tar archive in read mode. |
|
Iterate over the lines from zipped CSV files. |
|
Iterate over opened files in a zip file in read mode. |
|
Make a directory (or parent directory if a file is given) if flagged with |
|
Mock the environment variable then delete it after the test is over. |
Mock the PyStow home environment variable, yields the directory name. |
|
|
Dump the model as YAML string. |
|
Get a random string for testing. |
|
Get the filename from the S3 key. |
|
Get the filename from the end of the URL. |
|
Open a file inside an already opened zip archive. |
|
Open a tar file. |
|
Get a file-like object from a URL. |
|
Read an inner CSV file from a zip archive. |
|
Read an inner CSV file from a zip archive. |
|
Open a writer for an inner CSV file from a zip archive. |
|
Open a zipfile. |
|
Convert a path to a SQLite connection string. |
|
Raise a HexDigestError if the digests do not match. |
|
Read a dataframe from a lzma-compressed file. |
|
Read a JSON file into a model. |
|
Read models from a file as JSONL. |
|
Read models from a TSV file. |
|
Read a YAML file into a model. |
|
Read an RDF file with |
|
Read an inner CSV file from a tar archive. |
|
Read an inner XML file from a tar archive. |
|
Read an inner numpy array-like from a zip archive. |
|
Read an inner CSV file from a zip archive. |
|
Read an inner RDF file from a zip archive. |
|
Read an inner XML file from a zip archive. |
|
Make a function that consumes an iterable yield its elements. |
|
Safely open a file for reading or writing text. |
|
Open a CSV dictionary reader, wrapping |
|
Open a CSV dictionary writer, wrapping |
|
Safely open a file and parse as JSON. |
|
Open a CSV reader, wrapping |
|
Open a CSV writer, wrapping |
|
Safely open a file and parse as YAML. |
|
Read text from a file. |
|
Open a tar archive safely. |
|
Write text to a file. |
|
Open a zip archive safely. |
|
Write models to a file as JSONL and yield them. |
|
Write to a tarfile. |
Check if X Desktop Group (XDG) compatibility is requested. |
|
|
Write JSON to a file. |
|
Write a dataframe as an lzma-compressed file. |
|
Write an object to a gzipped pickle. |
|
Write a model to a JSON file. |
|
Write models to a file as JSONL. |
|
Write a model to a YAML file. |
|
Write a dataframe to an inner CSV file from a tar archive. |
|
Write an XML document a tar archive. |
|
Write YAML to a file. |
|
Write a dataframe to an inner CSV file to a zip archive. |
|
Write a dataframe to an inner CSV file to a zip archive. |
|
Read an inner RDF file from a zip archive. |
|
Write an XML element tree to an inner XML file to a zip archive. |
Classes
|
An error that wraps information from a requests or urllib download failure. |
|
Raised when the current header in an archive of CSVs is different than the original. |
|
Thrown if the hashsums do not match expected hashsums. |
|
Contains information about a hexdigest mismatch. |
|
Raised when passing an invalid operation. |
|
Raised when passing an invalid representation. |
Backwards compatible name |
|
|
Thrown if a directory path is given where file path should have been. |