Resources are the Runhouse abstraction for objects that can be saved, shared, and reused.

Resource Class

class runhouse.resources.resource.Resource(name: str | None = None, dryrun: bool | None = None, provenance=None, **kwargs)[source]
__init__(name: str | None = None, dryrun: bool | None = None, provenance=None, **kwargs)[source]

Runhouse abstraction for objects that can be saved, shared, and reused.

Runhouse currently supports the following builtin Resource types:


Delete the resource’s config from local working_dir and RNS config store.

classmethod from_name(name, dryrun=False, alt_options=None)[source]

Load existing Resource via its name.

history(num_entries: int | None = None) List[Dict][source]

Return the history of the resource, including specific config fields (e.g. blob path) and which runs have overwritten it.


Write the resource to the object store.


Update the resource in the object store.

property rns_address

Traverse up the filesystem until reaching one of the directories in rns_base_folders, then compute the relative path to that.

Maybe later, account for folders along the path with a different RNS name.

save(name: str | None = None, overwrite: bool = True)[source]

Register the resource, saving it to local working_dir config and RNS config store. Uses the resource’s self.config_for_rns to generate the dict to save.

save_attrs_to_config(config: Dict, attrs: List[str])[source]

Save the given attributes to the config

share(users: list, access_type: ResourceAccess | str = ResourceAccess.READ, notify_users: bool = True, headers: Dict | None = None) Tuple[Dict[str, ResourceAccess], Dict[str, ResourceAccess]][source]

Grant access to the resource for the list of users. If a user has a Runhouse account they will receive an email notifying them of their new access. If the user does not have a Runhouse account they will also receive instructions on creating one, after which they will be able to have access to the Resource.


You can only grant resource access to other users if you have Write / Read privileges for the Resource.

  • users (list) – list of user emails and / or runhouse account usernames.

  • access_type (ResourceAccess, optional) – access type to provide for the resource.

  • notify_users (bool) – Send email notification to users who have been given access. Defaults to False.

  • headers (Optional[Dict]) – Request headers to provide for the request to RNS. Contains the user’s auth token. Example: {"Authorization": f"Bearer {token}"}



users who already have an account and have been granted access to the resource.


users who do not have Runhouse accounts.

Return type:

Tuple(Dict, Dict)


>>> added_users, new_users = my_resource.share(users=["username1", ""], access_type='write')

Remove the name of the resource. This changes the resource name to anonymous and deletes any local or RNS configs for the resource.