Public API

repo_helper_pycharm.docs

Parse PyCharm configuration and open a project’s documentation in the default web browser.

New in version 0.2.0.

Functions:

get_config_dir()

Returns the path to the PyCharm configuration directory.

get_docs_port()

Returns the number of the port used by the PyCharm web server.

open_in_browser(url)

Opens the URL in the browser configured in the PyCharm settings.

get_config_dir()[source]

Returns the path to the PyCharm configuration directory.

New in version 0.2.0.

Raises

FileNotFoundError if the directory can’t be found.

Return type

PathPlus

get_docs_port()[source]

Returns the number of the port used by the PyCharm web server.

New in version 0.2.0.

Return type

int

open_in_browser(url)[source]

Opens the URL in the browser configured in the PyCharm settings.

New in version 0.2.0.

Parameters

url (str)

repo_helper_pycharm.iml_manager

Class to update PyCharm’s *.iml configuration files.

Classes:

ImlManager(repo_dir)

Class to update PyCharm’s *.iml configuration files.

class ImlManager(repo_dir)[source]

Bases: object

Class to update PyCharm’s *.iml configuration files.

Parameters

repo_dir (Union[str, Path, PathLike])

Methods:

remove_docstring_format()

Remove any existing option for “PyDocumentationSettings”, to revert to the default of reStructuredText.

run([show_diff])

Update the configuration in the file.

update_excludes()

Update the list of directories which should be excluded from indexing.

update_runner()

Set the project’s test runner to pytest.

write_out([show_diff])

Write the modified output to file.

remove_docstring_format()[source]

Remove any existing option for “PyDocumentationSettings”, to revert to the default of reStructuredText.

run(show_diff=False)[source]

Update the configuration in the file.

Parameters

show_diff (bool) – Whether to show a diff if changes are made. Default False.

Return type

int

update_excludes()[source]

Update the list of directories which should be excluded from indexing.

update_runner()[source]

Set the project’s test runner to pytest.

write_out(show_diff=False)[source]

Write the modified output to file.

Parameters

show_diff (bool) – Whether to show a diff if changes are made. Default False.

Return type

int

repo_helper_pycharm.register_schema

Register the schema mapping for repo_helper.yml with PyCharm.

Functions:

register_schema(repo_dir)

Register the schema mapping for repo_helper.yml with PyCharm.

register_schema(repo_dir)[source]

Register the schema mapping for repo_helper.yml with PyCharm.

Parameters

repo_dir (Union[str, Path, PathLike])