webapp package¶
Submodules¶
webapp.config_setup module¶
-
webapp.config_setup.create_local_config(config_dict)¶ Creates a new local config.json file containing the MongoDB configuration.
- Parameters
config_dict – The dictionary containing config_name, mongo_url, mongo_port (optional; default: 27017), mongo_username, mongo_password and collection_name.
-
webapp.config_setup.get_config_name()¶ Gets the name of the config to use.
- Returns
The name of the config to use, or None, if no local config.json file exists.
-
webapp.config_setup.update_config_param(key, value)¶ Updates a single parameter of the config.json file.
- Parameters
key – The name of the parameter.
value – The new value of the parameter.
webapp.routes module¶
-
webapp.routes.add_node()¶
-
webapp.routes.add_repository_route()¶ Adds a new repository.
-
webapp.routes.analyze_repository(repository_uuid)¶ Starts the analysis process for a repository.
- Parameters
repository_uuid – The UUID of the repository.
- Returns
JSON-encoded HTTP status code and a message.
-
webapp.routes.config()¶ The config page, which lets the user create a new or edit an existing config.
-
webapp.routes.create_config()¶ Creates a new config document and redirects back to the config page.
-
webapp.routes.delete_repository(uuid, how='Full')¶ Deletes a repository from MongoDB and/or the local file system.
- Parameters
uuid – The UUID of the repository.
how – How to delete the repository: ‘Full’ for deleting it both from the File System and from the Database, ‘DB’ to delete it from the database only or ‘Local’ to delete the local files only.
- Returns
JSON-encoded HTTP status code, a message, and the repo UUID.
-
webapp.routes.download_repository(repository_uuid)¶ Starts the download process of a repository.
- Parameters
repository_uuid – The UUID of the repository.
- Returns
JSON content, consisting of an HTTP status code and a message.
-
webapp.routes.get_advanced_repository_statistics(repository_uuid)¶ Get advanced statistics about a repository.
- Parameters
repository_uuid – The UUID of the repository.
- Returns
The statistics, JSON-encoded.
-
webapp.routes.get_basic_repository_information(repository_uuid=None)¶ Get basic information about a single repository.
- Parameters
repository_uuid – (opt) The UUID of the repository.
- Returns
JSON-encoded information about the repo.
-
webapp.routes.get_basic_repository_statistics(repository_uuid)¶ Get basic statistics about a repository.
- Parameters
repository_uuid – The UUID of the repository.
- Returns
The statistics, JSON-encoded.
-
webapp.routes.get_basic_statistics(repository_uuid=None)¶
-
webapp.routes.get_bubblechart_values(repository_uuid=None)¶
-
webapp.routes.get_data_type_distribution(repository_uuid=None)¶
-
webapp.routes.get_documents_with_string_abuse(abuse, uuid=None)¶
-
webapp.routes.get_error_context_counts(uuid=None)¶
-
webapp.routes.get_error_type_counts(uuid=None)¶
-
webapp.routes.get_failed_downloads(repository_uuid=None)¶
-
webapp.routes.get_filesize_histogram(repository_uuid=None)¶
-
webapp.routes.get_geojson_documents(uuid=None)¶
-
webapp.routes.get_image_bubblechart(repository_uuid=None)¶ Returns a bubblechart graphic.
- Parameters
repository_uuid – The UUID of the repository containing the files.
- Returns
A PNG file (as attachment).
-
webapp.routes.get_image_filesizes(repository_uuid=None)¶ Returns a graphic about the filesizes.
- Parameters
repository_uuid – The UUID of the repository containing the files.
- Returns
A PNG file (as attachment).
-
webapp.routes.get_image_property_frequencies(repository_uuid=None)¶ Returns a graphic about the property frequencies (required vs. optional).
- Parameters
repository_uuid – The UUID of the repository containing the files.
- Returns
A PNG file (as attachment).
-
webapp.routes.get_image_tree_levels(repository_uuid=None)¶ Returns a histogram consisting of the number of children/nodes on each tree level and returns it as a byte stream.
- Parameters
repository_uuid – The UUID of the repository containing the files.
- Returns
A PNG file (as attachment).
-
webapp.routes.get_image_type_distribution(repository_uuid=None)¶ Returns a graphic about the type distributions.
- Parameters
repository_uuid – The UUID of the repository containing the files.
- Returns
A PNG file (as attachment).
-
webapp.routes.get_node(uuid)¶
-
webapp.routes.get_node_status(uuid)¶
-
webapp.routes.get_node_statuses(uuid)¶
-
webapp.routes.get_optional_and_required_properties(repository_uuid=None)¶
-
webapp.routes.get_provenance_documents(x, y, repository_uuid=None)¶
-
webapp.routes.get_provenance_file(repository_uuid, file_uuid)¶
-
webapp.routes.get_repositories()¶ Gets information about all existing repositories.
- Returns
JSON-encoded information about repos.
-
webapp.routes.get_scraped_links_for_repository(repository_uuid)¶ Get the scraped links from a repository.
- Parameters
repository_uuid – The UUID of the repository.
- Returns
The scraped links (or an error), JSON-encoded.
-
webapp.routes.get_status()¶ …
-
webapp.routes.index()¶ The index route. If jHound is launched for the first time, the user gets redirected to a dedicated “first start” page.
-
webapp.routes.remove_node(uuid)¶
-
webapp.routes.repositories()¶ Returns the repository overview.
-
webapp.routes.repositories_add()¶ Returns the page for adding a repository.
-
webapp.routes.repository(repository_uuid=None)¶ Returns the page for a single repository.
- Parameters
repository_uuid – (opt) The UUID of the repository.
-
webapp.routes.result_page(repository_uuid=None)¶ Returns the result page.
- Parameters
repository_uuid – (opt) The UUID of the repository.
If none is given, the results of all repositories will be used.
-
webapp.routes.shutdown()¶
-
webapp.routes.start_scraping(uuid)¶ Starts the scraping process for a repository.
- Parameters
repository_uuid – The UUID of the repository.
- Returns
JSON content, consisting of an HTTP status code and a message.
-
webapp.routes.toggle_node(uuid)¶