burpy-cli


Nameburpy-cli JSON
Version 0.1.2 PyPI version JSON
download
home_pageNone
SummaryA rich tool to create CLI application in python with ease and almost zero dependency on third party packages
upload_time2024-12-28 19:09:25
maintainerNone
docs_urlNone
authorMukundSinghRajput
requires_python>=3.9
licenseMIT
keywords cli command-line framework python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">
  <img src="assets/wtr.png" alt="example" />
</div>

# Burpy CLI Framework

## ๐Ÿš€ Burpy: Pythonic CLI Framework

Burpy is a lightweight, flexible, and powerful Command Line Interface (CLI) framework for Python that makes building command-line applications a breeze.

## โœจ Features

- ๐Ÿ”ง Easy command registration
- ๐Ÿšฉ Flexible flag support
- ๐Ÿ”„ Async and sync command support
- ๐ŸŽจ Rich text formatting
- ๐Ÿงช Comprehensive testing
- ๐Ÿ“ฆ Cross-platform compatibility

## ๐Ÿ“ฆ Installation

### Using pip

```bash
pip install burpy-cli
```

### From Source

```bash
git clone https://github.com/MukundSinghRajput/burpy-cli
cd burpy-cli
pip install .
```

## ๐Ÿš€ Quick Start

### Basic Example

```python
from burpy import Burpy, Context

cli = Burpy("myapp", "A sample CLI application")

@cli.command(help="Greet a user")
@cli.flag(help="Name to greet", long="name", short="n")
def greet(ctx: Context, args: list):
    name = ctx.get_flag("name", "World")
    print(f"Hello, {name}!")

if __name__ == "__main__":
    cli.run()
```

### Advanced Example with Async Support

```python
import asyncio
from burpy import Burpy, Context

cli = Burpy("weather", "Get weather information")

@cli.command(help="Fetch weather for a location")
@cli.flag(help="City name", long="city", short="c")
@cli.flag(help="Verbose output", long="verbose", is_bool=True)
async def weather(ctx: Context, args: list):
    city = ctx.get_flag("city", "Lucknow")
    verbose = ctx.get_flag("verbose", False)
    
    # Simulated async weather fetch
    await asyncio.sleep(1)
    print(f"Weather in {city}: Sunny ๐ŸŒž")
    
    if verbose:
        print("Detailed weather information...")

if __name__ == "__main__":
    cli.run()
```

## ๐Ÿ“‹ Command Usage

Create an executable using pyinstaller and start using your CLI tool

```bash
# Basic command
myapp greet --name Alice

# Help for entire CLI
myapp -h

# Help for a specific command
myapp greet -h

# Version information
myapp -V
```

## ๐ŸŒŸ Key Concepts

### Commands

- Register commands using @cli.command
- Optional custom command names
- Support for help descriptions

### Flags

- Add flags with @cli.flag
- Support short and long flag formats
- Boolean and value-based flags

### Context

- Access flag values via ctx.get_flag()
- Default values supported
- Works with both sync and async commands

## ๐Ÿ“ฆ Supported Platforms
- Linux
- macOS
- Windows
- Python >=3.9


## ๐Ÿ”ง Development

```bash
git clone https://github.com/MukundSinghRajput/burpy-cli
cd burpy-cli

# Create virtual environment
poetry shell

# Install development dependencies 
poetry install
```

## License

This project is licensed under the MIT License - see the [LICENSE](https://github.com/MukundSinghRajput/burpy-cli/blob/MukunD/LICENSE) file for details.

## ๐Ÿค Contributing

Contributions are welcome! Please see [CONTRIBUTING.md](https://github.com/MukundSinghRajput/burpy-cli/blob/MukunD/CONTRIBUTING.md) for details.

## ๐Ÿ“ž Support

- Open an [issue](https://github.com/MukundSinghRajput/burpy-cli/issuess)
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "burpy-cli",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "cli, command-line, framework, python",
    "author": "MukundSinghRajput",
    "author_email": "mukundsrajput@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/17/6c/7939f27450eedff08759eeb5f03eaf4fd0b4457c98b555af0791b1766460/burpy_cli-0.1.2.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n  <img src=\"assets/wtr.png\" alt=\"example\" />\n</div>\n\n# Burpy CLI Framework\n\n## \ud83d\ude80 Burpy: Pythonic CLI Framework\n\nBurpy is a lightweight, flexible, and powerful Command Line Interface (CLI) framework for Python that makes building command-line applications a breeze.\n\n## \u2728 Features\n\n- \ud83d\udd27 Easy command registration\n- \ud83d\udea9 Flexible flag support\n- \ud83d\udd04 Async and sync command support\n- \ud83c\udfa8 Rich text formatting\n- \ud83e\uddea Comprehensive testing\n- \ud83d\udce6 Cross-platform compatibility\n\n## \ud83d\udce6 Installation\n\n### Using pip\n\n```bash\npip install burpy-cli\n```\n\n### From Source\n\n```bash\ngit clone https://github.com/MukundSinghRajput/burpy-cli\ncd burpy-cli\npip install .\n```\n\n## \ud83d\ude80 Quick Start\n\n### Basic Example\n\n```python\nfrom burpy import Burpy, Context\n\ncli = Burpy(\"myapp\", \"A sample CLI application\")\n\n@cli.command(help=\"Greet a user\")\n@cli.flag(help=\"Name to greet\", long=\"name\", short=\"n\")\ndef greet(ctx: Context, args: list):\n    name = ctx.get_flag(\"name\", \"World\")\n    print(f\"Hello, {name}!\")\n\nif __name__ == \"__main__\":\n    cli.run()\n```\n\n### Advanced Example with Async Support\n\n```python\nimport asyncio\nfrom burpy import Burpy, Context\n\ncli = Burpy(\"weather\", \"Get weather information\")\n\n@cli.command(help=\"Fetch weather for a location\")\n@cli.flag(help=\"City name\", long=\"city\", short=\"c\")\n@cli.flag(help=\"Verbose output\", long=\"verbose\", is_bool=True)\nasync def weather(ctx: Context, args: list):\n    city = ctx.get_flag(\"city\", \"Lucknow\")\n    verbose = ctx.get_flag(\"verbose\", False)\n    \n    # Simulated async weather fetch\n    await asyncio.sleep(1)\n    print(f\"Weather in {city}: Sunny \ud83c\udf1e\")\n    \n    if verbose:\n        print(\"Detailed weather information...\")\n\nif __name__ == \"__main__\":\n    cli.run()\n```\n\n## \ud83d\udccb Command Usage\n\nCreate an executable using pyinstaller and start using your CLI tool\n\n```bash\n# Basic command\nmyapp greet --name Alice\n\n# Help for entire CLI\nmyapp -h\n\n# Help for a specific command\nmyapp greet -h\n\n# Version information\nmyapp -V\n```\n\n## \ud83c\udf1f Key Concepts\n\n### Commands\n\n- Register commands using @cli.command\n- Optional custom command names\n- Support for help descriptions\n\n### Flags\n\n- Add flags with @cli.flag\n- Support short and long flag formats\n- Boolean and value-based flags\n\n### Context\n\n- Access flag values via ctx.get_flag()\n- Default values supported\n- Works with both sync and async commands\n\n## \ud83d\udce6 Supported Platforms\n- Linux\n- macOS\n- Windows\n- Python >=3.9\n\n\n## \ud83d\udd27 Development\n\n```bash\ngit clone https://github.com/MukundSinghRajput/burpy-cli\ncd burpy-cli\n\n# Create virtual environment\npoetry shell\n\n# Install development dependencies \npoetry install\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/MukundSinghRajput/burpy-cli/blob/MukunD/LICENSE) file for details.\n\n## \ud83e\udd1d Contributing\n\nContributions are welcome! Please see [CONTRIBUTING.md](https://github.com/MukundSinghRajput/burpy-cli/blob/MukunD/CONTRIBUTING.md) for details.\n\n## \ud83d\udcde Support\n\n- Open an [issue](https://github.com/MukundSinghRajput/burpy-cli/issuess)",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A rich tool to create CLI application in python with ease and almost zero dependency on third party packages",
    "version": "0.1.2",
    "project_urls": {
        "Bug Tracker": "https://github.com/MukundSinghRajput/burpy-cli/issues",
        "Homepage": "https://github.com/MukundSinghRajput/burpy-cli"
    },
    "split_keywords": [
        "cli",
        " command-line",
        " framework",
        " python"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ec16b1e308b2a925e8c2e4839f2833a01dcf52ab1f1e8c0e4caf82b6a0aaf2d8",
                "md5": "ab03eec65332f1b5bef16589496bacd7",
                "sha256": "ff1388b4995e15d48e11f2216112313fad79ce50f56b5571bc8132f8aa3b7f22"
            },
            "downloads": -1,
            "filename": "burpy_cli-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ab03eec65332f1b5bef16589496bacd7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 7565,
            "upload_time": "2024-12-28T19:09:23",
            "upload_time_iso_8601": "2024-12-28T19:09:23.438332Z",
            "url": "https://files.pythonhosted.org/packages/ec/16/b1e308b2a925e8c2e4839f2833a01dcf52ab1f1e8c0e4caf82b6a0aaf2d8/burpy_cli-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "176c7939f27450eedff08759eeb5f03eaf4fd0b4457c98b555af0791b1766460",
                "md5": "f4bea096a754ed546e87ddd44fb52cc4",
                "sha256": "069312223cea1e9867d77d2799c77d65599fa68dfee97d75d458d1e4e1bcce65"
            },
            "downloads": -1,
            "filename": "burpy_cli-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "f4bea096a754ed546e87ddd44fb52cc4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 7029,
            "upload_time": "2024-12-28T19:09:25",
            "upload_time_iso_8601": "2024-12-28T19:09:25.213631Z",
            "url": "https://files.pythonhosted.org/packages/17/6c/7939f27450eedff08759eeb5f03eaf4fd0b4457c98b555af0791b1766460/burpy_cli-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-28 19:09:25",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "MukundSinghRajput",
    "github_project": "burpy-cli",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "burpy-cli"
}
        
Elapsed time: 0.38527s