pycram.external_interfaces.procthor#

Classes#

ProcTHORInterface

Interface for interacting with the ProcThor environments.

Module Contents#

class pycram.external_interfaces.procthor.ProcTHORInterface#

Interface for interacting with the ProcThor environments. This class provides methods to scrape, download, and extract .tar.gz files containing ProcThor environments. Base URL defaults to ‘https://user.informatik.uni-bremen.de/~luc_kro/procthor_environments/

base_url: str = 'https://user.informatik.uni-bremen.de/~luc_kro/procthor_environments/'#

The base URL to scrape for .tar.gz files containing ProcThor environments.

project_root: str#

The root path of the project, used to find resources and other files.

Scrape and return all .tar.gz file links from the specified base URL.

Returns:

A list of URLs pointing to .tar.gz files.

download_file(url: str, filename: str)#

Download a file from a URL to a destination path.

Parameters:
  • url – The URL of the file to download.

  • filename – The name of the file to save as.

extract_tar(filename: str, extract_to: str)#

Extract a .tar.gz archive to the specified directory.

Parameters:
  • filename – The name of the .tar.gz file to extract.

  • extract_to – Directory where the contents should be extracted.

sample_environment(keep_environment: bool = False)#

Fetch and extract a random selection of environments packed in .tar.gz files from a URL.

Parameters:

keep_environment – If True, the environments will be kept in the resources directory, otherwise they will be