GhoslInk


NameGhoslInk JSON
Version 0.0.5 PyPI version JSON
download
home_pagehttps://github.com/Yeeloman/GhostInk
SummaryA task management tool for developers.
upload_time2024-11-04 01:05:14
maintainerNone
docs_urlNone
authorYeeloman
requires_python>=3.6
licenseNone
keywords task management debugging development tools logging task tracker python console output debugging tools task organizer development productivity software development
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # GhostInk

**GhostInk** is a Python utility to streamline debugging and etch(task) tracking by printing detailed file information for each call. This tool eliminates the need to manually add `print` statements and hunt for line numbers or file names, providing an organized, colorful output to track etchings, debug info, and errors across your project.

---

## Installation

To install `GhostInk`, add it to your project with pip:

```bash
pip install ghosink
```

Then, import `GhostInk` into your Python files:

```python
from ghosink import GhostInk
```

---

## Usage

### Initialize GhostInk

To start, create a `GhostInk` instance with optional parameters:

```python
ink = GhostInk(
    title="My Project Debugger",
    project_root=".",         # Set the project root for relative path display
    log_to_file=True,         # Enable/disable logging to a file
    log_file="debug.log"      # Specify log file name if logging is enabled
)
```

### Adding etchings (tasks) with Modes

Add etchings with `inkdrop`, assigning modes such as `TODO`, `INFO`, `DEBUG`, `WARN`, or `ERROR`. Modes allow you to manage and filter etchings effectively.

```python
ink.inkdrop("Refactor this method", mode=GhostInk.mode.TODO)
ink.inkdrop("This is debug info", mode=GhostInk.mode.DEBUG)
```

### Printing Location Information with `haunt`

If you simply want to print the current file location (file, line, function, and timestamp) without adding a etch, use `haunt`:

```python
ink.haunt("Executing important operation")
```

### Viewing and Filtering etchings with `whisper`

View all tracked etchings using `whisper`, with optional filters by mode or file name:

```python
ink.whisper(mode_mask=GhostInk.mode.TODO)
ink.whisper(file_mask="main.py")
```

---

## Key Methods

1. **`haunt(msg: str = None)`**  
   - Prints file, line, function, and timestamp for tracking execution points.
   - **Parameters**:
     - `msg`: Optional message displayed before the file information.

2. **`inkdrop(etch_input: any, mode: mode = mode.TODO)`**  
   - Adds a etch with text and a specific mode to the etch list.
   - **Parameters**:
     - `etch_input`: Text, dictionary, or object to record as a etch.
     - `mode`: etch mode (TODO, INFO, DEBUG, WARN, ERROR).

3. **`whisper(filter_mode: str = None, filter_filename: str = None)`**  
   - Prints filtered etchings based on mode and filename.
   - **Parameters**:
     - `filter_mode`: Filter etchings by mode.
     - `filter_filename`: Filter etchings by specific file name.

4. **`_color_text(mode: mode, text: str = "")`**  
   - Colors output based on etch mode (internal use).

5. **`_get_relative_path()`**  
   - Retrieves relative path, line number, and function name for etchings.

---

## Example

```python
from ghosink import GhostInk

# Initialize with logging enabled
ink = GhostInk(title="Project Debugger", log_to_file=True)

# Add etchings
ink.inkdrop("Fix memory leak", mode=GhostInk.mode.TODO)
ink.inkdrop("Checkpoint reached", mode=GhostInk.mode.INFO)
ink.inkdrop("Debug, Error, Warn itchs", mode=GhostInk.mode.DEBUG)

# Print a debug statement with file details
ink.haunt("Debugging current function")

# View all etchings
ink.whisper()
```

### Example Output

![example output](assets/exalple_output.png)

---

## Benefits

- No more manually adding and searching for `print` statements!
- Clearly organized, color-coded outputs make etchings easy to spot and review.
- Optional file logging to retain records and analyze later.
- Filters for viewing etchings by file and mode allow better focus and etch management.

---

**Start using GhostInk** and turn your debug prints into an organized, colorful log. Perfect for developers who want a better way to keep track of etchings and debug information without losing context!

---

## Inspired By

This project is inspired by the [icecream](https://github.com/gruns/icecream) library.

---

## Contributing

Contributions are welcome! If you have suggestions or improvements, please create a pull request.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Yeeloman/GhostInk",
    "name": "GhoslInk",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "task management, debugging, development tools, logging, task tracker, Python, console output, debugging tools, task organizer, development, productivity, software development",
    "author": "Yeeloman",
    "author_email": "yami.onlyme@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/a4/1a/e29b93d013b67cd2b8efe2c22469418c369313afea69b303824b262838aa/ghoslink-0.0.5.tar.gz",
    "platform": null,
    "description": "# GhostInk\n\n**GhostInk** is a Python utility to streamline debugging and etch(task) tracking by printing detailed file information for each call. This tool eliminates the need to manually add `print` statements and hunt for line numbers or file names, providing an organized, colorful output to track etchings, debug info, and errors across your project.\n\n---\n\n## Installation\n\nTo install `GhostInk`, add it to your project with pip:\n\n```bash\npip install ghosink\n```\n\nThen, import `GhostInk` into your Python files:\n\n```python\nfrom ghosink import GhostInk\n```\n\n---\n\n## Usage\n\n### Initialize GhostInk\n\nTo start, create a `GhostInk` instance with optional parameters:\n\n```python\nink = GhostInk(\n    title=\"My Project Debugger\",\n    project_root=\".\",         # Set the project root for relative path display\n    log_to_file=True,         # Enable/disable logging to a file\n    log_file=\"debug.log\"      # Specify log file name if logging is enabled\n)\n```\n\n### Adding etchings (tasks) with Modes\n\nAdd etchings with `inkdrop`, assigning modes such as `TODO`, `INFO`, `DEBUG`, `WARN`, or `ERROR`. Modes allow you to manage and filter etchings effectively.\n\n```python\nink.inkdrop(\"Refactor this method\", mode=GhostInk.mode.TODO)\nink.inkdrop(\"This is debug info\", mode=GhostInk.mode.DEBUG)\n```\n\n### Printing Location Information with `haunt`\n\nIf you simply want to print the current file location (file, line, function, and timestamp) without adding a etch, use `haunt`:\n\n```python\nink.haunt(\"Executing important operation\")\n```\n\n### Viewing and Filtering etchings with `whisper`\n\nView all tracked etchings using `whisper`, with optional filters by mode or file name:\n\n```python\nink.whisper(mode_mask=GhostInk.mode.TODO)\nink.whisper(file_mask=\"main.py\")\n```\n\n---\n\n## Key Methods\n\n1. **`haunt(msg: str = None)`**  \n   - Prints file, line, function, and timestamp for tracking execution points.\n   - **Parameters**:\n     - `msg`: Optional message displayed before the file information.\n\n2. **`inkdrop(etch_input: any, mode: mode = mode.TODO)`**  \n   - Adds a etch with text and a specific mode to the etch list.\n   - **Parameters**:\n     - `etch_input`: Text, dictionary, or object to record as a etch.\n     - `mode`: etch mode (TODO, INFO, DEBUG, WARN, ERROR).\n\n3. **`whisper(filter_mode: str = None, filter_filename: str = None)`**  \n   - Prints filtered etchings based on mode and filename.\n   - **Parameters**:\n     - `filter_mode`: Filter etchings by mode.\n     - `filter_filename`: Filter etchings by specific file name.\n\n4. **`_color_text(mode: mode, text: str = \"\")`**  \n   - Colors output based on etch mode (internal use).\n\n5. **`_get_relative_path()`**  \n   - Retrieves relative path, line number, and function name for etchings.\n\n---\n\n## Example\n\n```python\nfrom ghosink import GhostInk\n\n# Initialize with logging enabled\nink = GhostInk(title=\"Project Debugger\", log_to_file=True)\n\n# Add etchings\nink.inkdrop(\"Fix memory leak\", mode=GhostInk.mode.TODO)\nink.inkdrop(\"Checkpoint reached\", mode=GhostInk.mode.INFO)\nink.inkdrop(\"Debug, Error, Warn itchs\", mode=GhostInk.mode.DEBUG)\n\n# Print a debug statement with file details\nink.haunt(\"Debugging current function\")\n\n# View all etchings\nink.whisper()\n```\n\n### Example Output\n\n![example output](assets/exalple_output.png)\n\n---\n\n## Benefits\n\n- No more manually adding and searching for `print` statements!\n- Clearly organized, color-coded outputs make etchings easy to spot and review.\n- Optional file logging to retain records and analyze later.\n- Filters for viewing etchings by file and mode allow better focus and etch management.\n\n---\n\n**Start using GhostInk** and turn your debug prints into an organized, colorful log. Perfect for developers who want a better way to keep track of etchings and debug information without losing context!\n\n---\n\n## Inspired By\n\nThis project is inspired by the [icecream](https://github.com/gruns/icecream) library.\n\n---\n\n## Contributing\n\nContributions are welcome! If you have suggestions or improvements, please create a pull request.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A task management tool for developers.",
    "version": "0.0.5",
    "project_urls": {
        "Homepage": "https://github.com/Yeeloman/GhostInk"
    },
    "split_keywords": [
        "task management",
        " debugging",
        " development tools",
        " logging",
        " task tracker",
        " python",
        " console output",
        " debugging tools",
        " task organizer",
        " development",
        " productivity",
        " software development"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5cc4ae6bd949cd5e373996153a69d57b099e2ed18af9476837ea85d0cd883eed",
                "md5": "bc8d71506cf1a5f67d125537968c6635",
                "sha256": "0fdd2977abc5f01bc89ea9736fb0132028c435baf6eaeac46e6e0437b7d613ee"
            },
            "downloads": -1,
            "filename": "GhoslInk-0.0.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bc8d71506cf1a5f67d125537968c6635",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 8406,
            "upload_time": "2024-11-04T01:05:12",
            "upload_time_iso_8601": "2024-11-04T01:05:12.984487Z",
            "url": "https://files.pythonhosted.org/packages/5c/c4/ae6bd949cd5e373996153a69d57b099e2ed18af9476837ea85d0cd883eed/GhoslInk-0.0.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a41ae29b93d013b67cd2b8efe2c22469418c369313afea69b303824b262838aa",
                "md5": "85a7a47a0aade4878bd8c71187d502cd",
                "sha256": "760cf13992d48148022538bb7eb2540204866807bdc17a57a4687c8351b6408d"
            },
            "downloads": -1,
            "filename": "ghoslink-0.0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "85a7a47a0aade4878bd8c71187d502cd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 7429,
            "upload_time": "2024-11-04T01:05:14",
            "upload_time_iso_8601": "2024-11-04T01:05:14.703814Z",
            "url": "https://files.pythonhosted.org/packages/a4/1a/e29b93d013b67cd2b8efe2c22469418c369313afea69b303824b262838aa/ghoslink-0.0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-04 01:05:14",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Yeeloman",
    "github_project": "GhostInk",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "ghoslink"
}
        
Elapsed time: 1.08050s