htmd.home module#

htmd.home.home(dataDir: str | None = None, libDir: bool = False, shareDir: bool = False) str#

Return the pathname of the HTMD root directory (or a subdirectory).

Parameters:
  • dataDir (str, optional) – If provided, return the path to the named data subdirectory.

  • libDir (bool, optional) – If True, return the path to the platform-specific lib directory.

  • shareDir (bool, optional) – If True, return the path to the share directory.

Returns:

dir – The requested directory path.

Return type:

str

Raises:

FileNotFoundError – If libDir is True and the lib directory does not exist, or if shareDir is True and the share directory does not exist.

Examples

>>> from htmd.home import home
>>> home()                                 
'.../htmd'
>>> home(dataDir="dhfr")                   
'.../data/dhfr'
>>> os.path.join(home(dataDir="dhfr"),"dhfr.pdb")  
'.../data/dhfr/dhfr.pdb'