wrenn
wrenn.client
CapsulesResource Objects
create
templatestr | None - Template name to boot from.vcpusint | None - Number of virtual CPUs.memory_mbint | None - Memory in MiB.timeout_secint | None - Inactivity TTL in seconds before auto-pause.0disables auto-pause.
CapsuleModel- The newly created capsule.
list
list[CapsuleModel]- All capsules belonging to the team.
get
idstr - Capsule ID.
CapsuleModel- Current state of the capsule.
WrennNotFoundError- If no capsule with the given ID exists.
destroy
idstr - Capsule ID.
WrennNotFoundError- If no capsule with the given ID exists.
pause
idstr - Capsule ID.
CapsuleModel- Updated capsule state.
WrennNotFoundError- If no capsule with the given ID exists.
resume
idstr - Capsule ID.
CapsuleModel- Updated capsule state.
WrennNotFoundError- If no capsule with the given ID exists.
ping
idstr - Capsule ID.
WrennNotFoundError- If no capsule with the given ID exists.
AsyncCapsulesResource Objects
create
templatestr | None - Template name to boot from.vcpusint | None - Number of virtual CPUs.memory_mbint | None - Memory in MiB.timeout_secint | None - Inactivity TTL in seconds before auto-pause.0disables auto-pause.
CapsuleModel- The newly created capsule.
list
list[CapsuleModel]- All capsules belonging to the team.
get
idstr - Capsule ID.
CapsuleModel- Current state of the capsule.
WrennNotFoundError- If no capsule with the given ID exists.
destroy
idstr - Capsule ID.
WrennNotFoundError- If no capsule with the given ID exists.
pause
idstr - Capsule ID.
CapsuleModel- Updated capsule state.
WrennNotFoundError- If no capsule with the given ID exists.
resume
idstr - Capsule ID.
CapsuleModel- Updated capsule state.
WrennNotFoundError- If no capsule with the given ID exists.
ping
idstr - Capsule ID.
WrennNotFoundError- If no capsule with the given ID exists.
SnapshotsResource Objects
create
capsule_idstr - ID of the capsule to snapshot.namestr | None - Name for the snapshot template. Auto-generated if not provided.overwritebool - IfTrue, overwrite an existing template with the same name. Defaults toFalse.
Template- The created snapshot template.
list
typestr | None - Filter by template type. Returns all templates if not provided.
list[Template]- Matching snapshot templates.
delete
namestr - Template name to delete.
WrennNotFoundError- If no template with the given name exists.
AsyncSnapshotsResource Objects
create
capsule_idstr - ID of the capsule to snapshot.namestr | None - Name for the snapshot template. Auto-generated if not provided.overwritebool - IfTrue, overwrite an existing template with the same name. Defaults toFalse.
Template- The created snapshot template.
list
typestr | None - Filter by template type. Returns all templates if not provided.
list[Template]- Matching snapshot templates.
delete
namestr - Template name to delete.
WrennNotFoundError- If no template with the given name exists.
WrennClient Objects
api_key- API key (wrn_...). Falls back toWRENN_API_KEYenv var.base_url- Wrenn API base URL.
http
close
AsyncWrennClient Objects
api_key- API key (wrn_...). Falls back toWRENN_API_KEYenv var.base_url- Wrenn API base URL. Falls back toWRENN_BASE_URLenv var.
http
aclose
wrenn.sandbox
wrenn.commands
CommandResult Objects
CommandHandle Objects
ProcessInfo Objects
StreamEvent Objects
Commands Objects
capsule.commands.
run
cmdstr - Shell command string to execute.backgroundbool - IfTrue, launch the process in the background and return a :class:CommandHandleimmediately. Defaults toFalse.timeoutint | None - Seconds before the foreground command times out. Ignored for background commands. Defaults to30.envsdict[str, str] | None - Additional environment variables to set for the process.cwdstr | None - Working directory for the process.tagstr | None - Optional label attached to background processes for later retrieval via :meth:connect.
-
CommandResult- stdout, stderr, exit code, and duration for foreground commands (background=False). -
CommandHandle- PID and tag for background commands (background=True).
list
list[ProcessInfo]- Running processes with their PID, tag, and command information.
kill
pidint - PID of the process to kill.
WrennNotFoundError- If no process with the given PID exists.
connect
pidint - PID of the background process to attach to.
StreamEvent- Successive output events. Stops on :class:StreamExitEventor :class:StreamErrorEvent.
stream
cmdstr - Command to execute.argslist[str] | None - Additional arguments for the command. When omitted, cmd is interpreted as a shell command string and executed via/bin/sh -c.
StreamEvent- Successive events including :class:StreamStartEvent, :class:StreamStdoutEvent, :class:StreamStderrEvent, :class:StreamExitEvent, and :class:StreamErrorEvent.
AsyncCommands Objects
capsule.commands.
run
cmdstr - Shell command string to execute.backgroundbool - IfTrue, launch the process in the background and return a :class:CommandHandleimmediately. Defaults toFalse.timeoutint | None - Seconds before the foreground command times out. Ignored for background commands. Defaults to30.envsdict[str, str] | None - Additional environment variables to set for the process.cwdstr | None - Working directory for the process.tagstr | None - Optional label attached to background processes for later retrieval via :meth:connect.
-
CommandResult- stdout, stderr, exit code, and duration for foreground commands (background=False). -
CommandHandle- PID and tag for background commands (background=True).
list
list[ProcessInfo]- Running processes with their PID, tag, and command information.
kill
pidint - PID of the process to kill.
WrennNotFoundError- If no process with the given PID exists.
connect
pidint - PID of the background process to attach to.
StreamEvent- Successive output events. Stops on :class:StreamExitEventor :class:StreamErrorEvent.
stream
cmdstr - Command to execute.argslist[str] | None - Additional arguments for the command. When omitted, cmd is interpreted as a shell command string and executed via/bin/sh -c.
StreamEvent- Successive events including :class:StreamStartEvent, :class:StreamStdoutEvent, :class:StreamStderrEvent, :class:StreamExitEvent, and :class:StreamErrorEvent.
wrenn.files
Files Objects
capsule.files.
read
pathstr - Absolute path to the file inside the capsule.
str- File contents decoded as UTF-8.
WrennNotFoundError- If the path does not exist.
read_bytes
pathstr - Absolute path to the file inside the capsule.
bytes- Raw file contents.
WrennNotFoundError- If the path does not exist.
write
pathstr - Absolute destination path inside the capsule.datastr | bytes - Content to write. Strings are UTF-8 encoded.
list
pathstr - Absolute path to the directory inside the capsule.depthint - Recursion depth.1lists only immediate children. Defaults to1.
list[FileEntry]- Entries in the directory.
WrennNotFoundError- If the path does not exist.
exists
pathstr - Absolute path to check.
bool-Trueif the path exists.
make_dir
pathstr - Absolute path of the directory to create.
FileEntry- The created (or already-existing) directory entry.
remove
pathstr - Absolute path to remove.
WrennNotFoundError- If the path does not exist.
upload_stream
write when the file is too large to hold in
memory.
Arguments:
pathstr - Absolute destination path inside the capsule.streamIterator[bytes] - Iterable of byte chunks to upload.
download_stream
read_bytes when the file is too large to hold
in memory.
Arguments:
pathstr - Absolute path to the file inside the capsule.
bytes- Successive byte chunks of the file.
WrennNotFoundError- If the path does not exist.
AsyncFiles Objects
capsule.files.
read
pathstr - Absolute path to the file inside the capsule.
str- File contents decoded as UTF-8.
WrennNotFoundError- If the path does not exist.
read_bytes
pathstr - Absolute path to the file inside the capsule.
bytes- Raw file contents.
WrennNotFoundError- If the path does not exist.
write
pathstr - Absolute destination path inside the capsule.datastr | bytes - Content to write. Strings are UTF-8 encoded.
list
pathstr - Absolute path to the directory inside the capsule.depthint - Recursion depth.1lists only immediate children. Defaults to1.
list[FileEntry]- Entries in the directory.
WrennNotFoundError- If the path does not exist.
exists
pathstr - Absolute path to check.
bool-Trueif the path exists.
make_dir
pathstr - Absolute path of the directory to create.
FileEntry- The created (or already-existing) directory entry.
remove
pathstr - Absolute path to remove.
WrennNotFoundError- If the path does not exist.
upload_stream
write when the file is too large to hold in
memory.
Arguments:
pathstr - Absolute destination path inside the capsule.streamAsyncIterator[bytes] - Async iterable of byte chunks to upload.
download_stream
read_bytes when the file is too large to hold
in memory.
Arguments:
pathstr - Absolute path to the file inside the capsule.
bytes- Successive byte chunks of the file.
WrennNotFoundError- If the path does not exist.
wrenn.code_interpreter.models
ExecutionError Objects
name- Exception class name (e.g."NameError").value- Exception message.traceback- Full traceback string.
Logs Objects
Result Objects
execute_result
(the expression value) and zero or more display_data messages
(from plt.show(), display(), etc.). Each becomes a
Result.
Known MIME types are unpacked into named attributes; anything else
lands in :pyattr:extra.
text
text/plain representation.
html
text/html representation.
markdown
text/markdown representation.
svg
image/svg+xml representation.
png
image/png — base64-encoded.
jpeg
image/jpeg — base64-encoded.
application/pdf — base64-encoded.
latex
text/latex representation.
json
application/json representation.
javascript
application/javascript representation.
extra
MIME types not covered by the named fields above.is_main_result
True when this came from an execute_result message
(i.e. the value of the last expression in the cell). False
for display_data outputs.
from_bundle
Result from a Jupyter MIME bundle dict.
formats
None MIME-type fields.
Execution Objects
run_code call.
Attributes:
results- All rich outputs produced by the cell — charts, tables, images, expression values, etc.logs- Captured stdout/stderr text.error- Populated when the cell raised an exception.execution_count- Jupyter execution counter (the[N]number).
text
text/plain of the main execute_result,
or None if the cell had no expression value.
wrenn.code_interpreter.async_capsule
AsyncCapsule Objects
run_code support.
Uses code-runner-beta template by default::
from wrenn.code_interpreter import AsyncCapsule
capsule = await AsyncCapsule.create()
result = await capsule.run_code(“print(‘hello’)“)
create
templatestr | None - Template to boot from. Defaults to"code-runner-beta".vcpusint | None - Number of virtual CPUs.memory_mbint | None - Memory in MiB.timeoutint | None - Inactivity TTL in seconds before auto-pause.waitbool - Await until the capsule reachesrunningstatus.api_keystr | None - Wrenn API key. Falls back toWRENN_API_KEYenv var.base_urlstr | None - API base URL override.
AsyncCapsule- A new async code interpreter capsule instance.
run_code
code- Code string to execute.language- Execution backend language. Currently only"python".timeout- Maximum seconds to wait for execution to complete.jupyter_timeout- Maximum seconds to wait for Jupyter to become available.on_result- Called for each rich output (charts, images, expression values).on_stdout- Called for each stdout chunk.on_stderr- Called for each stderr chunk.on_error- Called when the cell raises an exception.
Execution with .results, .logs, .error,
and a convenience .text property.
wrenn.code_interpreter
wrenn.code_interpreter.capsule
Capsule Objects
run_code support.
Uses code-runner-beta template by default::
from wrenn.code_interpreter import Capsule
capsule = Capsule()
result = capsule.run_code(“print(‘hello’)”)
print(result.logs.stdout) # [“hello\n”]
__init__
templatestr | None - Template to boot from. Defaults to"code-runner-beta".vcpusint | None - Number of virtual CPUs.memory_mbint | None - Memory in MiB.timeoutint | None - Inactivity TTL in seconds before auto-pause.api_keystr | None - Wrenn API key. Falls back toWRENN_API_KEYenv var.base_urlstr | None - API base URL override.
create
templatestr | None - Template to boot from. Defaults to"code-runner-beta".vcpusint | None - Number of virtual CPUs.memory_mbint | None - Memory in MiB.timeoutint | None - Inactivity TTL in seconds before auto-pause.waitbool - Block until the capsule reachesrunningstatus.api_keystr | None - Wrenn API key. Falls back toWRENN_API_KEYenv var.base_urlstr | None - API base URL override.
Capsule- A new code interpreter capsule instance.
run_code
code- Code string to execute.language- Execution backend language. Currently only"python".timeout- Maximum seconds to wait for execution to complete.jupyter_timeout- Maximum seconds to wait for Jupyter to become available.on_result- Called for each rich output (charts, images, expression values).on_stdout- Called for each stdout chunk.on_stderr- Called for each stderr chunk.on_error- Called when the cell raises an exception.
Execution with .results, .logs, .error,
and a convenience .text property.
wrenn.exceptions
WrennError Objects
WrennError to handle any API error generically.
Attributes:
codestr - Machine-readable error code from the API (e.g."not_found").messagestr - Human-readable error description.status_codeint - HTTP status code of the response.
__init__
codestr - Machine-readable error code.messagestr - Human-readable error description.status_codeint - HTTP status code of the response.
WrennValidationError Objects
WrennAuthenticationError Objects
WrennForbiddenError Objects
WrennNotFoundError Objects
WrennConflictError Objects
WrennHostHasCapsulesError Objects
capsule_idslist[str] - IDs of the capsules still running on the host.
__init__
codestr - Machine-readable error code.messagestr - Human-readable error description.status_codeint - HTTP status code of the response.capsule_idslist[str] - IDs of capsules still on the host.
WrennHostUnavailableError Objects
WrennAgentError Objects
WrennInternalError Objects
wrenn.async_capsule
AsyncCapsule Objects
capsule_id
str- Capsule ID assigned by the Wrenn API.
info
None
if the capsule was connected without an initial fetch.
create
templatestr | None - Template name to boot from.vcpusint | None - Number of virtual CPUs.memory_mbint | None - Memory in MiB.timeoutint | None - Inactivity TTL in seconds before auto-pause.waitbool - Await until the capsule reachesrunningstatus.api_keystr | None - Wrenn API key. Falls back toWRENN_API_KEYenv var.base_urlstr | None - API base URL override.
AsyncCapsule- A new capsule instance.
connect
capsule_idstr - ID of the capsule to connect to.api_keystr | None - Wrenn API key. Falls back toWRENN_API_KEYenv var.base_urlstr | None - API base URL override.
AsyncCapsule- A capsule instance bound to the existing capsule.
WrennNotFoundError- If no capsule with the given ID exists.
ping
wait_ready
running.
Arguments:
timeoutfloat - Maximum seconds to wait. Defaults to30.intervalfloat - Polling interval in seconds. Defaults to0.5.
TimeoutError- If the capsule does not reachrunningstate withintimeoutseconds.RuntimeError- If the capsule enters an error, stopped, or paused state while waiting.
is_running
bool-Trueif the capsule status isrunning.
list
api_keystr | None - Wrenn API key. Falls back toWRENN_API_KEYenv var.base_urlstr | None - API base URL override.
list[CapsuleModel]- All capsules for the authenticated team.
pty
PtyEvent objects::
async with capsule.pty() as term:
await term.write(b”echo hello\n”)
async for event in term:
if event.type == “output”:
print(event.data.decode())
Arguments:
cmdstr - Command to run inside the PTY. Defaults to"/bin/bash".argslist[str] | None - Additional arguments forcmd.colsint - Initial terminal column count. Defaults to80.rowsint - Initial terminal row count. Defaults to24.envsdict[str, str] | None - Additional environment variables to inject into the process.cwdstr | None - Working directory for the process.
AsyncPtySession- An interactive async PTY session.
pty_connect
tagstr - Session tag returned in thestartedPTY event.
AsyncPtySession- The reconnected async PTY session.
get_url
portint - Port number to proxy.
str- Awss://(orws://) URL that proxies to the given port inside the capsule.
create_snapshot
namestr | None - Name for the snapshot template. Auto-generated if not provided.overwritebool - IfTrue, overwrite an existing template with the same name. Defaults toFalse.
Template- The created snapshot template.
wrenn.pty
PtySession Objects
tag
started event.
pid
started event.
write
data- Raw bytes to send. Base64-encoded internally.
resize
cols- New column count. Must be > 0.rows- New row count. Must be > 0.
ValueError- If cols or rows is 0.
kill
AsyncPtySession Objects
tag
started event.
pid
started event.
write
data- Raw bytes to send. Base64-encoded internally.
resize
cols- New column count. Must be > 0.rows- New row count. Must be > 0.
ValueError- If cols or rows is 0.
kill
wrenn.models._generated
Peaks Objects
Series Objects
Encoding Objects
Type2 Objects
wrenn.models
wrenn.capsule
Capsule Objects
__init__
templatestr | None - Template name to boot from. Defaults to the server-side default ("minimal").vcpusint | None - Number of virtual CPUs. Defaults to the server-side default.memory_mbint | None - Memory in MiB. Defaults to the server-side default.timeoutint | None - Inactivity TTL in seconds before the capsule is auto-paused.0disables auto-pause.waitbool - IfTrue, block until the capsule status isrunningbefore returning.api_keystr | None - Wrenn API key (wrn_...). Falls back to theWRENN_API_KEYenvironment variable.base_urlstr | None - Wrenn API base URL. Falls back toWRENN_BASE_URLor the default production endpoint.
capsule_id
str- Capsule ID assigned by the Wrenn API.
info
None
if the capsule was connected without an initial fetch.
create
Capsule(...) directly.
Arguments:
templatestr | None - Template name to boot from.vcpusint | None - Number of virtual CPUs.memory_mbint | None - Memory in MiB.timeoutint | None - Inactivity TTL in seconds before auto-pause.waitbool - Block until the capsule reachesrunningstatus.api_keystr | None - Wrenn API key. Falls back toWRENN_API_KEYenv var.base_urlstr | None - API base URL override.
Capsule- A new capsule instance.
connect
capsule_idstr - ID of the capsule to connect to.api_keystr | None - Wrenn API key. Falls back toWRENN_API_KEYenv var.base_urlstr | None - API base URL override.
Capsule- A capsule instance bound to the existing capsule.
WrennNotFoundError- If no capsule with the given ID exists.
ping
wait_ready
running.
Arguments:
timeoutfloat - Maximum seconds to wait. Defaults to30.intervalfloat - Polling interval in seconds. Defaults to0.5.
TimeoutError- If the capsule does not reachrunningstate withintimeoutseconds.RuntimeError- If the capsule enters an error, stopped, or paused state while waiting.
is_running
bool-Trueif the capsule status isrunning.
list
api_keystr | None - Wrenn API key. Falls back toWRENN_API_KEYenv var.base_urlstr | None - API base URL override.
list[CapsuleModel]- All capsules for the authenticated team.
pty
PtyEvent objects::
with capsule.pty() as term:
term.write(b”echo hello\n”)
for event in term:
if event.type == “output”:
print(event.data.decode())
Arguments:
cmdstr - Command to run inside the PTY. Defaults to"/bin/bash".argslist[str] | None - Additional arguments forcmd.colsint - Initial terminal column count. Defaults to80.rowsint - Initial terminal row count. Defaults to24.envsdict[str, str] | None - Additional environment variables to inject into the process.cwdstr | None - Working directory for the process.
PtySession- An interactive PTY session.
pty_connect
tagstr - Session tag returned in thestartedPTY event.
PtySession- The reconnected PTY session.
get_url
portint - Port number to proxy.
str- Awss://(orws://) URL that proxies to the given port inside the capsule.
create_snapshot
namestr | None - Name for the snapshot template. Auto-generated if not provided.overwritebool - IfTrue, overwrite an existing template with the same name. Defaults toFalse.
Template- The created snapshot template.
wrenn._config
ConnectionConfig Objects
wrenn._git._auth
embed_credentials
url- Git repository URL.username- Username for authentication.password- Password or personal access token.
username:password@ embedded in the netloc.
Raises:
ValueError- If the URL scheme is nothttporhttps.
strip_credentials
url- Git repository URL, possibly with credentials.
is_auth_error
stderr- Combined stderr output from a git command.
True if any known auth-failure pattern is found.
build_credential_approve_cmd
git credential approve.
Arguments:
username- Git username.password- Password or personal access token.host- Target host. Defaults to"github.com".protocol- Protocol. Defaults to"https".
commands.run().
wrenn._git._cmd
Pure functions that build git argument lists and parse git output. No I/O, no network, no imports fromwrenn. Every build_* function
returns a list[str] suitable for shlex.join(). Every parse_*
function takes raw stdout and returns a typed structure.
FileStatus Objects
git status --porcelain=v1.
Attributes:
pathstr - File path relative to the repository root.index_statusstr - Index (staged) status character.work_tree_statusstr - Working-tree status character.renamed_fromstr | None - Original path when status is a rename.
staged
status
GitStatus Objects
git status --porcelain=v1 --branch.
Attributes:
branchstr | None - Current branch name, orNoneif detached.upstreamstr | None - Upstream tracking branch.aheadint - Commits ahead of upstream.behindint - Commits behind upstream.detachedbool - Whether HEAD is detached.fileslist[FileStatus] - Per-file status entries.
is_clean
True when there are no changed or untracked files.
has_staged
True when at least one file has staged changes.
has_untracked
True when at least one file is untracked.
has_conflicts
True when at least one file has merge conflicts.
GitBranch Objects
namestr - Branch name (short ref).is_currentbool - Whether this is the checked-out branch.
build_clone
git clone arguments.
build_init
git init arguments.
build_add
git add arguments.
build_commit
git commit arguments.
build_push
git push arguments.
build_pull
git pull arguments.
build_status
git status arguments for porcelain parsing.
build_branches
git branch arguments for structured parsing.
build_create_branch
git checkout -b arguments.
build_checkout
git checkout arguments.
build_delete_branch
git branch -d/-D arguments.
build_remote_add
git remote add arguments.
build_remote_get_url
git remote get-url arguments.
build_remote_set_url
git remote set-url arguments.
build_reset
git reset arguments.
Arguments:
mode- Reset mode (soft,mixed,hard,merge,keep).ref- Commit, branch, or ref to reset to.paths- Paths to reset (mutually exclusive withmode).
build_restore
git restore arguments.
Arguments:
paths- Paths to restore.staged- Restore the index (unstage).worktree- Restore working-tree files.source- Commit or ref to restore from.
build_config_set
git config set arguments.
build_config_get
git config --get arguments.
build_has_upstream
parse_status
git status --porcelain=v1 --branch output.
Arguments:
stdout- Raw stdout from the git status command.
GitStatus.
parse_branches
git branch --format=%(refname:short)\t%(HEAD) output.
Arguments:
stdout- Raw stdout from the git branch command.
GitBranch.
wrenn._git.exceptions
GitError Objects
WrennError because git errors originate
from a process exit code, not an HTTP response.
Attributes:
messagestr - Human-readable error description.stderrstr - Raw stderr output from the git process.exit_codeint - Process exit code.
GitCommandError Objects
GitAuthError Objects
wrenn._git
Git operations inside a Wrenn capsule. Provides :class:Git (sync) and :class:AsyncGit (async) interfaces
accessed via capsule.git. All operations execute the real git
binary inside the capsule through :class:~wrenn.commands.Commands.
Git Objects
capsule.git.
Executes the real git binary inside the capsule through
:meth:Commands.run. Methods raise :class:GitCommandError (or
:class:GitAuthError) on non-zero exit codes.
clone
url- Remote repository URL.dest- Destination path. Defaults to the repository name derived from the URL.branch- Branch or tag to check out.depth- Create a shallow clone with this many commits.username- Username for HTTP(S) authentication.password- Password or token for HTTP(S) authentication.dangerously_store_credentials- IfTrue, leave credentials embedded in the remote URL after cloning.cwd- Working directory for the command.envs- Extra environment variables.timeout- Command timeout in seconds. Defaults to300.
GitAuthError- If the remote rejected authentication.GitCommandError- If clone failed for another reason.ValueError- If password is provided without username.
init
path- Destination path for the repository.bare- Create a bare repository.initial_branch- Name for the initial branch (e.g."main").cwd- Working directory for the command.envs- Extra environment variables.timeout- Command timeout in seconds.
GitCommandError- If init failed.
add
paths- Specific files to stage. IfNone, stages the current directory (or all withall=True).all- Stage all changes including untracked files.cwd- Working directory (repository root).envs- Extra environment variables.timeout- Command timeout in seconds.
GitCommandError- If add failed.
commit
message- Commit message.allow_empty- Allow creating a commit with no changes.author_name- Override the commit author name.author_email- Override the commit author email.cwd- Working directory (repository root).envs- Extra environment variables.timeout- Command timeout in seconds.
GitCommandError- If commit failed.
push
remote- Remote name. Defaults to"origin".branch- Branch to push. Defaults to the current branch.force- Force-push.set_upstream- Set upstream tracking reference.username- Username for HTTP(S) authentication.password- Password or token for HTTP(S) authentication.cwd- Working directory (repository root).envs- Extra environment variables.timeout- Command timeout in seconds.
GitAuthError- If authentication failed.GitCommandError- If push failed.
pull
remote- Remote name. Defaults to"origin".branch- Branch to pull.rebase- Rebase instead of merge.ff_only- Only allow fast-forward merges.username- Username for HTTP(S) authentication.password- Password or token for HTTP(S) authentication.cwd- Working directory (repository root).envs- Extra environment variables.timeout- Command timeout in seconds.
GitAuthError- If authentication failed.GitCommandError- If pull failed.
status
cwd- Working directory (repository root).envs- Extra environment variables.timeout- Command timeout in seconds.
GitStatus with branch info and file changes.
Raises:
GitCommandError- If the command failed.
branches
cwd- Working directory (repository root).envs- Extra environment variables.timeout- Command timeout in seconds.
GitBranch.
Raises:
GitCommandError- If the command failed.
create_branch
name- Branch name.start_point- Commit or ref to branch from.cwd- Working directory (repository root).envs- Extra environment variables.timeout- Command timeout in seconds.
GitCommandError- If the command failed.
checkout_branch
name- Branch name.cwd- Working directory (repository root).envs- Extra environment variables.timeout- Command timeout in seconds.
GitCommandError- If the command failed.
delete_branch
name- Branch name.force- Force-delete with-D.cwd- Working directory (repository root).envs- Extra environment variables.timeout- Command timeout in seconds.
GitCommandError- If the command failed.
remote_add
name- Remote name (e.g."origin").url- Remote URL.fetch- Fetch after adding.cwd- Working directory (repository root).envs- Extra environment variables.timeout- Command timeout in seconds.
GitCommandError- If the command failed.
remote_get
None if the remote does not exist rather than raising.
Arguments:
name- Remote name. Defaults to"origin".cwd- Working directory (repository root).envs- Extra environment variables.timeout- Command timeout in seconds.
None.
reset
mode- Reset mode (soft,mixed,hard,merge,keep).ref- Commit, branch, or ref to reset to.paths- Paths to reset.cwd- Working directory (repository root).envs- Extra environment variables.timeout- Command timeout in seconds.
GitCommandError- If the command failed.
restore
paths- Paths to restore.staged- Restore the index (unstage).worktree- Restore working-tree files.source- Commit or ref to restore from.cwd- Working directory (repository root).envs- Extra environment variables.timeout- Command timeout in seconds.
GitCommandError- If the command failed.
set_config
key- Config key (e.g."user.name").value- Config value.scope- Config scope:"local","global", or"system".cwd- Working directory (repository root). Required when scope is"local".envs- Extra environment variables.timeout- Command timeout in seconds.
GitCommandError- If the command failed.
get_config
None if the key is not set rather than raising.
Arguments:
key- Config key (e.g."user.name").scope- Config scope:"local","global", or"system".cwd- Working directory (repository root). Required when scope is"local".envs- Extra environment variables.timeout- Command timeout in seconds.
None.
configure_user
name- Git user name.email- Git user email.scope- Config scope. Defaults to"global".cwd- Working directory (repository root). Required when scope is"local".envs- Extra environment variables.timeout- Command timeout in seconds.
ValueError- If name or email is empty.GitCommandError- If a config command failed.
dangerously_authenticate
username/password
parameters on :meth:clone, :meth:push, and :meth:pull
instead.
Arguments:
username- Git username.password- Password or personal access token.host- Target host. Defaults to"github.com".protocol- Protocol. Defaults to"https".cwd- Working directory.envs- Extra environment variables.timeout- Command timeout in seconds.
ValueError- If username or password is empty.GitCommandError- If a command failed.
AsyncGit Objects
capsule.git.
Async mirror of :class:Git. See that class for full method
documentation.
clone
init
add
commit
push
pull
status
branches
create_branch
checkout_branch
delete_branch
remote_add
remote_get
None if not found.
reset
restore
set_config
get_config
None if not set.
configure_user
dangerously_authenticate
username/password
parameters instead.