htmd.home module#

htmd.home.home(dataDir=None, libDir=False, shareDir=False)#

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

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

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

  • shareDir (bool) – 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'