gitconductor.cli module

Main CLI arguments.

gitconductor.gitlab module

Gitlab-related constructs.

class gitconductor.gitlab.GitlabGroup(**data)[source]

Bases: GitlabInstance

A Gitlab Group convenience class.

...
build()[source]

Build each project object.

Return type:

None

Returns:

None

cfg: Settings | None
property count: int

How many repositories are in the full group structure?

Returns:

Total number of projects in all recursive subgeoups.

Return type:

int

dump()[source]

Dump to file.

Return type:

None

fullname: str
gitlab_key: str
gitlab_url: str
group: Any | None
property members: list

Get members.

Returns:

Number of members.

Return type:

int

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(_GitlabGroup__context=None)[source]

Post-init function calls.

Return type:

None

name: str
property path: Path

Auto-generated path.

Returns:

Project path.

Return type:

pathlib.Path

projects: list[str]
rebuild(cfg)[source]

Rebuild the objects when reloaded (new directories, etc.).

Parameters:

cfg (Path) – Serialised .pkl file.

Return type:

None

Returns:

None

recursive_command(command, **kwargs)[source]

Recursively walk down group tree, finding projects and executing commands.

Parameters:
  • command (str) – Command to execute.

  • kwargs (dict) – Keyword args to each recursive command.

Returns:

List of returns from each command execution.

Return type:

None

subgroup: bool
subgroups: list[str]
class gitconductor.gitlab.GitlabInstance(**data)[source]

Bases: BaseModel

A Gitlab generic instance convenience class.

...
cfg: Settings | None
flat: bool
gitlab_key: str
gitlab_url: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

root: Path
server: Any | None
property toplevel_dir: Path

What is the top level work directory?

Returns:

Directory name.

Return type:

pathlib.Path

class gitconductor.gitlab.GitlabProject(**data)[source]

Bases: GitlabInstance

A Gitlab Project convenience class.

add(fnames)[source]

Add files to staging area.

Return type:

None

Returns:

None

branch(name=None)[source]

Make branch in a repository.

Return type:

None

Returns:

None

checkout(name=None)[source]

Checkout a branch in a repository.

Return type:

None

Returns:

None

clone()[source]

Clone a repository.

Return type:

None

Returns:

None

commit(message)[source]

Add files to staging area.

Return type:

None

Returns:

None

fullname: str
git: Any | None
gitlab_key: str
gitlab_url: str
property is_python_package: bool

Is this project a Python package?

Returns:

Is this project a Python package?

Return type:

bool

property members: list

Get members.

Returns:

Number of members.

Return type:

int

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(_GitlabProject__context=None)[source]

Post-init function calls.

Return type:

None

name: str
property path: Path

Auto-generated path.

Returns:

Project path.

Return type:

pathlib.Path

project: Any
push()[source]

Push recursively.

Return type:

None

Returns:

None

pyinstall(pm='uv pip', editable=False, index=None)[source]

Install Python package.

Return type:

None

Returns:

None

pyreqs()[source]

Generate requirements.txt file for Python package.

Return type:

None

Returns:

None

property python_package_name: str

What is the name of the Python package?

Returns:

Name of the Python package.

Return type:

str

recursive_command(command, **kwargs)[source]

Trick to execute a command recursively on a project to keep code the same elsewhere.

Parameters:
  • command (str) – Command to execute.

  • kwargs (dict) – Keyword args to each recursive command.

Returns:

List of returns from each command execution.

Return type:

None

rows: list
status()[source]

Return git status.

Return type:

None

Returns:

None

gitconductor.output module

Outputs for user info.

class gitconductor.output.CloneProgress[source]

Bases: RemoteProgress

Override git.RemoteProgress to update progress bars.

error_lines: List[str]
last_op_code = None
other_lines: List[str]
update(op_code, cur_count, max_count=None, message='')[source]

Get updates from git, pass to rich output.

Return type:

None

gitconductor.visualise module

Visualisation options.

gitconductor.visualise.access(group, explicit=False, maxdepth=None)[source]

Make a access visualisation.

Parameters:
  • group (GitlabGroup) – Gitlab group instance.

  • explicit (bool) – Explicitly show all members of all groups/projects?

  • maxdepth (int | None) – Maximum recursion depth (0=PWD).

Return type:

None

Returns:

None

gitconductor.visualise.access_matrix(group, maxdepth=None)[source]

Make a access matrix visualisation.

Parameters:
  • group (GitlabGroup) – Gitlab group instance.

  • maxdepth (int | None) – Maximum recursion depth (0=PWD).

Return type:

None

Returns:

None

gitconductor.visualise.build_access(group, rows=None, depth=0, unique_ids=None, explicit=False, root=PosixPath('.'), maxdepth=None, colour_only=False)[source]

Iteratively build access lists.

Parameters:
  • group (GitlabGroup | GitlabProject) – Gitlab group instance.

  • rows (None | list[str]) – Previous table rows.

  • depth (int) – Depth inside the tree.

  • unique_ids (list[str] | None) – List of all unique IDs printed

  • explicit (bool) – Explicitly show all members of all groups/projects?

  • root (Path) – Top level directory.

  • maxdepth (int | None) – Maximum recursion depth (0=PWD).

  • colour_only (bool) – Only return the colour code for the access level.

Returns:

New row to print to table.

Return type:

list[str]

gitconductor.visualise.build_table(group, rows=None, depth=0, maxdepth=None)[source]

Iteratively build the table.

Parameters:
  • group (GitlabGroup) – Gitlab group instance.

  • rows (None | list[str]) – Previous table rows.

  • depth (int) – Depth inside the tree.

  • maxdepth (int | None) – Maximum recursion depth (0=PWD).

Returns:

New row to print to table.

Return type:

list[str]

gitconductor.visualise.build_tree(group, tree)[source]

Iteratively build the tree.

Parameters:
  • group (GitlabGroup) – Gitlab group instance.

  • tree (Tree) – Initial Tree instance.

Returns:

Updated Tree instance.

Return type:

Tree

gitconductor.visualise.table(group, maxdepth=None)[source]

Make a table visualisation.

Parameters:
  • group (GitlabGroup) – Gitlab group instance.

  • maxdepth (int | None) – Maximum recursion depth (0=PWD).

Return type:

None

Returns:

None

gitconductor.visualise.tree(group)[source]

Make a tree visualisation.

Parameters:

group (GitlabGroup) – Gitlab group instance.

Return type:

None

Returns:

None

Module contents

Gitlab wrapper.