porcelain module

Functions that group lower-level functions and represent separate code paths.

These are the main related functionalities that can be called in main.py

porcelain.mod_squatters(module, max_distance)

Check if a particular package name has potential squatters.

Prints any potential typosquatters for specified module

Parameters:
  • module (str) – name to check for typosquatting
  • max_distance (int) – maximum edit distance to check for typosquatting
porcelain.names_to_defend(module_name)

Print out module names that might merit defending.

Parameters:module_name (str) – Initial module name to protect from typosquatting
porcelain.scan_recent(max_distance, save_new_list=False)

Scan packages recently added to pypi for possible typosquatting.

Print recently added packages and any package names on which these packages are potentially typosquatting.

Parameters:
  • max_distance (int) – maximum edit distance to check for typosquatting
  • save_new_list (bool) – flag to save new list
porcelain.top_mods(max_distance, top_n, min_len, stored_json)

Check top packages for typosquatters.

Prints top packages and any potential typosquatters

Parameters:
  • max_distance (int) – maximum edit distance to check for typosquatting
  • top_n (int) – the number of top packages to retrieve
  • min_len (int) – a minimum length of characters
  • stored_json (bool) – a flag to denote whether to used stored top packages json