Sunjeet Tools Documentation

Personal utility library with common development tools.

Installation

pip install sunjeet-tools

Quick Start

from sunjeet_tools import gacp

# Git add, commit, and push in one line
gacp(".", "Initial commit", "main")

Contents

API Reference

Sunjeet Tools - Personal utility library.

sunjeet_tools.gacp(files='.', commit_message=None, branch='main')[source]

Git Add, Commit, Push in one command.

Parameters:
  • files (str) – Files to add. Defaults to “.” (all files).

  • commit_message (str) – Commit message. Required.

  • branch (str) – Branch to push to. Defaults to “main”.

Returns:

True if successful, False otherwise.

Return type:

bool

Example

>>> from sunjeet_tools import gacp
>>> gacp(".", "Initial commit", "main")
✅ Successfully added, committed, and pushed
True

Git Tools

Git utility functions.

sunjeet_tools.git_tools.gacp(files='.', commit_message=None, branch='main')[source]

Git Add, Commit, Push in one command.

Parameters:
  • files (str) – Files to add. Defaults to “.” (all files).

  • commit_message (str) – Commit message. Required.

  • branch (str) – Branch to push to. Defaults to “main”.

Returns:

True if successful, False otherwise.

Return type:

bool

Example

>>> from sunjeet_tools import gacp
>>> gacp(".", "Initial commit", "main")
✅ Successfully added, committed, and pushed
True

Utils

General utility functions.

sunjeet_tools.utils.ensure_dir(path)[source]

Ensure directory exists.

Parameters:

path (str) – Directory path to create.

Example

>>> ensure_dir("path/to/directory")
sunjeet_tools.utils.read_json(filepath)[source]

Read JSON file.

Parameters:

filepath (str) – Path to JSON file.

Returns:

Parsed JSON data.

Return type:

dict

Example

>>> data = read_json("config.json")
sunjeet_tools.utils.write_json(data, filepath)[source]

Write data to JSON file.

Parameters:
  • data (dict) – Data to write.

  • filepath (str) – Path to output file.

Example

>>> write_json({"key": "value"}, "output.json")