Profile reference¶
- class nusex.api.Profile(name: str, **kwargs: str | None)¶
A class representing a profile.
All keyword arguments are different attributes which nusex will use when deploying templates. They all default to
Noneif not passed.- Parameters
name (
str) – The name of the profile.- Keyword Arguments
author_name (
str|None) – The name with which you wish to be attributed in new projects. This should be your real name, a nickname, or your organisation’s name.author_nick (
str|None) – The username you normally use for services related to your development projects.author_email (
str|None) – The email address through which users can contact you or your organisation.preferred_language (
str|None) – The language you would normally be developing with when using this profile.preferred_license (
str|None) – The license you would normally use when using this profile. When deploying a template nusex will use this as a key, and attempt to resolve it against a list of open-source licenses.starting_version (
str|None) – The version to deploy templates with. By default nusex will use this value as-is, but if you set this to “CALVER” nusex will use the current date in YYYY.MM.DD format when deploying the template.version_control_url (
str|None) – The URL of your version control host (i.e. GitHub), including your username. By default nusex will append the name of the project to the end of this URL when deploying, but you can override this behaviour by including “PROJECTNAME” anywhere in this URL.docs_url (
str|None) – The URL of the documentation hosting service you normally use. Different documentation hosting services handle URLs differently – by default nusex will append the name of the project to the end of the URL, but you can override this behaviour by inserting “PROJECTNAME” anywhere in the URL. If you use ReadTheDocs for example, you will need to do this.ci_url (
str|None) – The URL of the continuous integration suite you normally use. By default nusex will append the name of the project to the end of this URL when deploying, but you can override this behaviour by including “PROJECTNAME” anywhere in this URL.
- copy(*, name: str | None = None) Profile¶
Create a new instance of this profile with the same attributes.
- delete(*, missing_ok: bool = False) Path | None¶
Delete this profile from disk.
- Keyword Arguments
missing_ok (
bool) – Whether to ignore errors upon a missing profile. If this isFalse, anFileNotFoundErrorerror will be raised if the profile has not been saved. Defaults toFalse.- Returns
A
pathlib.Pathobject with the full path to the profile, orNoneif it was not saved.- Return type
- classmethod from_disk(name: str, *, from_dir: Path | str) Profile¶
Load a saved profile.
- Parameters
name (
str) – The name of the profile to load.- Keyword Arguments
from_dir (
pathlib.Path|str) – The directory to load the profile from.- Returns
A profile instance.
- Return type
- property path: Path | None¶
The filepath to this profile. This is
Noneif the profile has not been saved.- Returns
The filepath to this profile, or
Noneis this profile has not been saved.- Return type
- save(*, to_dir: Path | str, overwrite: bool = False) Path¶
Save this profile to disk.
- Keyword Arguments
to_dir (
pathlib.Path,str) – The directory to save the profile to.overwrite (
bool) – Whether to overwrite an existing profile. If this isFalse, anFileExistsErrorerror will be raised if a profile with the same name already exists. Defaults toFalse.
- Returns
A
pathlib.Pathobject with the full path to the profile.- Return type