eisenmp_examples.utils_exa package

Submodules

eisenmp_examples.utils_exa.eisenmp_download module

class eisenmp_examples.utils_exa.eisenmp_download.DownLoad

Bases: object

If we have the response, we can read it at once or as a stream.

load_url()
save(file_name)

Save response on file system with OS buf size. Dotted output in one line.

store_mem()
unzip_fs()
unzip_mem()

Extract zip in memory to avoid unwanted files from archive on file system.

eisenmp_examples.utils_exa.eisenmp_utils module

class eisenmp_examples.utils_exa.eisenmp_utils.Result

Bases: object

Finest results only here. Can save number stuff, not response chunks, or we crash

property result_dict
result_dict_update(key, value)
eisenmp_examples.utils_exa.eisenmp_utils.condense_list_from_fs(search_str, words_dict)
eisenmp_examples.utils_exa.eisenmp_utils.consecutive_number()

Want a stamp on each list header. Used for Queue messages get() and put in box_dict[num] = msg Can rebuild original order if worker puts result in a list with same num as order list.

eisenmp_examples.utils_exa.eisenmp_utils.create_hash(word)

Inputs a string and returns the sha256 digest

Params:

word: to hash

eisenmp_examples.utils_exa.eisenmp_utils.empty_db_from_schema(db_name='db_exa.db', schema_file='db_exa_schema.sql')

Initial for bruteforce, instances return not sequential, Caller exit is possible if last instance writes code word, to identify database.db in root is from SQLAlchemy template package

eisenmp_examples.utils_exa.eisenmp_utils.get_db_connection()
eisenmp_examples.utils_exa.eisenmp_utils.get_db_path(db_name='db_exa.db')
eisenmp_examples.utils_exa.eisenmp_utils.load_url(url, user_agent=None)

Get server response.

Params:

url: url

Params:

user_agent: override python ua of urllib (we are a browser)

Exception:

Timeout recursive call

Returns:

http server response

Return type:

http response

eisenmp_examples.utils_exa.eisenmp_utils.merge_list(*list_paths, lowercase=True)

WORD LISTS. We create a dict with word as key or hash digest, for speed.

Params:

args: tuple of OS paths word list(s)

Params:

lower: True is all lowercase

eisenmp_examples.utils_exa.eisenmp_utils.replace_special_char(word)

German so far.

Params:

word: string to check

eisenmp_examples.utils_exa.eisenmp_utils.split_list(lst, chunk_size)

Needs a companion loop. for chunk in split_list(word_list, chunk_size): print(chunk)

Params:

lst: the list to split

Params:

chunk_size: row count of lst for one consumer

eisenmp_examples.utils_exa.eisenmp_utils.str_with_len_get(word, str_to_comp)
eisenmp_examples.utils_exa.eisenmp_utils.table_insert(sql_statement, *args)
eisenmp_examples.utils_exa.eisenmp_utils.table_select_column(table, col)
eisenmp_examples.utils_exa.eisenmp_utils.thread_shutdown_wait(*threads)

We return if none of the thread names are listed anymore. Blocks!

Params:

threads: arbitrary list of thread names

eisenmp_examples.utils_exa.eisenmp_utils.unzip(file_path)

Extractor.

Params:

file_path: to zipped file

Module contents