Data Directory

pyproj.datadir.get_data_dir

pyproj.datadir.get_data_dir() → str[source]

The order of preference for the data directory is:

  1. The one set by pyproj.datadir.set_data_dir (if exists & valid)

  2. The internal proj directory (if exists & valid)

  3. The directory in PROJ_LIB (if exists & valid)

  4. The directory on sys.prefix (if exists & valid)

  5. The directory on the PATH (if exists & valid)

Returns

The valid data directory.

Return type

str

pyproj.datadir.set_data_dir

pyproj.datadir.set_data_dir(proj_data_dir: Union[str, pathlib.Path]) → None[source]

Set the data directory for PROJ to use.

Parameters

proj_data_dir (Union[str, Path]) – The path to the PROJ data directory.

pyproj.datadir.append_data_dir

pyproj.datadir.append_data_dir(proj_data_dir: Union[str, pathlib.Path]) → None[source]

Add an additional data directory for PROJ to use.

Parameters

proj_data_dir (Union[str, Path]) – The path to the PROJ data directory.

pyproj.datadir.get_user_data_dir

pyproj.datadir.get_user_data_dir(create=False)

New in version 3.0.0.

Get the PROJ user writable directory for datumgrid files.

This is where grids will be downloaded when PROJ network capabilities are enabled. It is also the default download location for the projsync command line program.

Parameters

create (bool, optional) – If True, it will create the directory if it does not already exist. Default is False.

Returns

The user writable data directory.

Return type

str