AutoRunCmd


NameAutoRunCmd JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://github.com/rakeshkanna-rk/pyautorun/
SummaryRuns multi scripts with a simple line of prompt with a config dot file in your environment
upload_time2024-10-26 18:36:20
maintainerNone
docs_urlNone
authorRakesh Kanna
requires_python>=3.6
licenseMIT
keywords automation build tools makefile python scripts task runner command-line tool config file
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # AutoRunCmd

**autoruncmd** is a Python module that acts like a Makefile for Python projects. It allows you to define and execute a set of scripts easily using a configuration file. This tool helps in organizing and automating common project commands.

## Features
- **Configuration Management**: Store and organize scripts in a configuration file.
- **Easy Initialization**: Quickly create a default configuration file.
- **Add Scripts**: Append new commands to your configuration.
- **Search**: Find specific commands within the configuration.
- **Execute Scripts**: Run entire sections or individual commands by referencing their headers.

## Installation

To install autorunrun, use pip:

```bash
pip install AutoRunCmd
```

## Configuration File Format

The default configuration file is `.pyscripts`, but you can specify a custom config file if needed. 

### **Rules for Configuration File**
1. **LOC Header**: The first line of the configuration file must always contain the **Line Of Configuration (LOC)** metadata, as follows:
   ```bash
   # Line Of Configuration (LOC) file = <filename> [<timestamp>]
   ```
   - This line will be automatically added during initialization `autorun init`.

2. **Headers**: Every section must have a header. Headers should:
   - Begin with `[py.` and end with `]`.
   - Be properly closed, e.g., `[py.header]`.
   - One header can contain multiple commands.
   
3. **Commands**: Commands under each header must follow this format:
   - Each command should have a name and be assigned using `name = command`.
   - The first `=` in a line is prioritized to separate the command name from the script.

4. **Comments**: Comments can be prefixed with `#` and end with a newline.
   
5. **Ignored Lines**: Any lines that do not follow these rules will be ignored during execution.

### Example `.pyscripts` File

```ini
# Line Of Configuration (LOC) file = .pyscripts [Sun Oct 13 22:44:48 2024]

# comment
[py.header1]
cmd1_h1 = command 1 execution
cmd2_h1 = command 2 execution

[py.help]
help = python --help
python = python
```

### Structure
- Each header (e.g., `[py.header1]`) contains one or more command lines.
- Commands are defined using `name = command` pairs, where the name is the command name and the command is the script to execute.

## Usage

### 1. Create a Config File
To initialize a configuration file, use the `init` command:

```bash
autorun init <file_name(optional)>
```

By default, the config file is created as `.pyscripts`, but you can provide a custom file name.

### 2. Add Commands
Add commands to a header within your config file using the `add` command:

```bash
autorun add -h <header_name> -s '<script>' -c <configfile(optional)>
```

- `-h <header_name>`: Specify the header to add the command to.
- `-s '<script>'`: The script to be added, in the format `name = command`.
- `-c <configfile>`: Optional argument to specify the configuration file (default: `.pyscripts`).

### 3. Find Commands
Search for commands in the config file that start with a specific string:

```bash
autorun find -l <line Startswith> -h <header> -c <configfile(optional)>
```
 - `-l <line Startswith>`: Specify the line to find.
 - `-h <header>`: Specify the header to find.
 - `-c <configfile>`: Optional argument to specify the configuration file (default: `.pyscripts`).

This will output all lines or header in the file that match the specified prefix.

### 4. Run Commands
Run all the commands in a specific header or a particular command by referencing it:

- To run all commands in a header:

```bash
autorun cmd <header>
```

- To run a specific command within a header:

```bash
autorun cmd <header>.<command_name>
```

## Example Workflow

1. **Initialize the config**:
   ```bash
   autorun init .autoruncmd.test
   ```

2. **Add a new command**:
   ```bash
   autorun add -h tests -s "test = tested sucessfully" -c .autoruncmd.test 
   ```

3. **Run a command from the header**:
   ```bash
   autorun run tests -c .autoruncmd.test
   ```

4. **Find commands starting with a specific line**:
   ```bash
   autorun find -l test -h tests -c .autoruncmd.test
   ```

## Contributing

If you have any suggestions or feedback, please [open an issue](https://github.com/rakeshkanna-rk/autoruncmd/issues) or [create a pull request](https://github.com/rakeshkanna-rk/autoruncmd/pulls).

## License

This project is licensed under the [MIT License](https://github.com/rakeshkanna-rk/autoruncmd/blob/main/LICENSE).

## Package Information

**Version**: 0.1.1
**Title**: AutoRunCmd
**Author**: [Rakesh Kanna](https://github.com/rakeshkanna-rk/)
**Github**: [https://github.com/rakeshkanna-rk/autoruncmd](https://github.com/rakeshkanna-rk/autoruncmd)
**PyPI**: [https://pypi.org/project/autoruncmd/](https://pypi.org/project/autoruncmd/)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/rakeshkanna-rk/pyautorun/",
    "name": "AutoRunCmd",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "automation, build tools, makefile, python scripts, task runner, command-line tool, config file",
    "author": "Rakesh Kanna",
    "author_email": "rakeshkanna0108@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/6e/79/4cf87c9819832d3beddb3a07823b86ade2238b48668c8c7229f4807603b4/autoruncmd-0.1.1.tar.gz",
    "platform": null,
    "description": "# AutoRunCmd\r\n\r\n**autoruncmd** is a Python module that acts like a Makefile for Python projects. It allows you to define and execute a set of scripts easily using a configuration file. This tool helps in organizing and automating common project commands.\r\n\r\n## Features\r\n- **Configuration Management**: Store and organize scripts in a configuration file.\r\n- **Easy Initialization**: Quickly create a default configuration file.\r\n- **Add Scripts**: Append new commands to your configuration.\r\n- **Search**: Find specific commands within the configuration.\r\n- **Execute Scripts**: Run entire sections or individual commands by referencing their headers.\r\n\r\n## Installation\r\n\r\nTo install autorunrun, use pip:\r\n\r\n```bash\r\npip install AutoRunCmd\r\n```\r\n\r\n## Configuration File Format\r\n\r\nThe default configuration file is `.pyscripts`, but you can specify a custom config file if needed. \r\n\r\n### **Rules for Configuration File**\r\n1. **LOC Header**: The first line of the configuration file must always contain the **Line Of Configuration (LOC)** metadata, as follows:\r\n   ```bash\r\n   # Line Of Configuration (LOC) file = <filename> [<timestamp>]\r\n   ```\r\n   - This line will be automatically added during initialization `autorun init`.\r\n\r\n2. **Headers**: Every section must have a header. Headers should:\r\n   - Begin with `[py.` and end with `]`.\r\n   - Be properly closed, e.g., `[py.header]`.\r\n   - One header can contain multiple commands.\r\n   \r\n3. **Commands**: Commands under each header must follow this format:\r\n   - Each command should have a name and be assigned using `name = command`.\r\n   - The first `=` in a line is prioritized to separate the command name from the script.\r\n\r\n4. **Comments**: Comments can be prefixed with `#` and end with a newline.\r\n   \r\n5. **Ignored Lines**: Any lines that do not follow these rules will be ignored during execution.\r\n\r\n### Example `.pyscripts` File\r\n\r\n```ini\r\n# Line Of Configuration (LOC) file = .pyscripts [Sun Oct 13 22:44:48 2024]\r\n\r\n# comment\r\n[py.header1]\r\ncmd1_h1 = command 1 execution\r\ncmd2_h1 = command 2 execution\r\n\r\n[py.help]\r\nhelp = python --help\r\npython = python\r\n```\r\n\r\n### Structure\r\n- Each header (e.g., `[py.header1]`) contains one or more command lines.\r\n- Commands are defined using `name = command` pairs, where the name is the command name and the command is the script to execute.\r\n\r\n## Usage\r\n\r\n### 1. Create a Config File\r\nTo initialize a configuration file, use the `init` command:\r\n\r\n```bash\r\nautorun init <file_name(optional)>\r\n```\r\n\r\nBy default, the config file is created as `.pyscripts`, but you can provide a custom file name.\r\n\r\n### 2. Add Commands\r\nAdd commands to a header within your config file using the `add` command:\r\n\r\n```bash\r\nautorun add -h <header_name> -s '<script>' -c <configfile(optional)>\r\n```\r\n\r\n- `-h <header_name>`: Specify the header to add the command to.\r\n- `-s '<script>'`: The script to be added, in the format `name = command`.\r\n- `-c <configfile>`: Optional argument to specify the configuration file (default: `.pyscripts`).\r\n\r\n### 3. Find Commands\r\nSearch for commands in the config file that start with a specific string:\r\n\r\n```bash\r\nautorun find -l <line Startswith> -h <header> -c <configfile(optional)>\r\n```\r\n - `-l <line Startswith>`: Specify the line to find.\r\n - `-h <header>`: Specify the header to find.\r\n - `-c <configfile>`: Optional argument to specify the configuration file (default: `.pyscripts`).\r\n\r\nThis will output all lines or header in the file that match the specified prefix.\r\n\r\n### 4. Run Commands\r\nRun all the commands in a specific header or a particular command by referencing it:\r\n\r\n- To run all commands in a header:\r\n\r\n```bash\r\nautorun cmd <header>\r\n```\r\n\r\n- To run a specific command within a header:\r\n\r\n```bash\r\nautorun cmd <header>.<command_name>\r\n```\r\n\r\n## Example Workflow\r\n\r\n1. **Initialize the config**:\r\n   ```bash\r\n   autorun init .autoruncmd.test\r\n   ```\r\n\r\n2. **Add a new command**:\r\n   ```bash\r\n   autorun add -h tests -s \"test = tested sucessfully\" -c .autoruncmd.test \r\n   ```\r\n\r\n3. **Run a command from the header**:\r\n   ```bash\r\n   autorun run tests -c .autoruncmd.test\r\n   ```\r\n\r\n4. **Find commands starting with a specific line**:\r\n   ```bash\r\n   autorun find -l test -h tests -c .autoruncmd.test\r\n   ```\r\n\r\n## Contributing\r\n\r\nIf you have any suggestions or feedback, please [open an issue](https://github.com/rakeshkanna-rk/autoruncmd/issues) or [create a pull request](https://github.com/rakeshkanna-rk/autoruncmd/pulls).\r\n\r\n## License\r\n\r\nThis project is licensed under the [MIT License](https://github.com/rakeshkanna-rk/autoruncmd/blob/main/LICENSE).\r\n\r\n## Package Information\r\n\r\n**Version**: 0.1.1\r\n**Title**: AutoRunCmd\r\n**Author**: [Rakesh Kanna](https://github.com/rakeshkanna-rk/)\r\n**Github**: [https://github.com/rakeshkanna-rk/autoruncmd](https://github.com/rakeshkanna-rk/autoruncmd)\r\n**PyPI**: [https://pypi.org/project/autoruncmd/](https://pypi.org/project/autoruncmd/)\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Runs multi scripts with a simple line of prompt with a config dot file in your environment",
    "version": "0.1.1",
    "project_urls": {
        "GitHub": "https://github.com/rakeshkanna-rk/pyautorun/",
        "Homepage": "https://github.com/rakeshkanna-rk/pyautorun/",
        "PyPI": "https://pypi.org/project/pyautorun/"
    },
    "split_keywords": [
        "automation",
        " build tools",
        " makefile",
        " python scripts",
        " task runner",
        " command-line tool",
        " config file"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c27e9a382e761c90f165494eefca1a73d4b1b5464dca1278f0c28f8730a37a0d",
                "md5": "05c6a0dc4c522c133b4e0b98ab99e29f",
                "sha256": "327f162544e5844c8117a8aadf191e829a505970bc0c66fbb12c09168638e15f"
            },
            "downloads": -1,
            "filename": "AutoRunCmd-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "05c6a0dc4c522c133b4e0b98ab99e29f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 15312,
            "upload_time": "2024-10-26T18:36:18",
            "upload_time_iso_8601": "2024-10-26T18:36:18.731408Z",
            "url": "https://files.pythonhosted.org/packages/c2/7e/9a382e761c90f165494eefca1a73d4b1b5464dca1278f0c28f8730a37a0d/AutoRunCmd-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6e794cf87c9819832d3beddb3a07823b86ade2238b48668c8c7229f4807603b4",
                "md5": "5508509a309ea6a95e748898990d7316",
                "sha256": "2b18d2d82cf7c115278daabc570f3744742ea4dfdbf6b8b1a589d38ef166fb8e"
            },
            "downloads": -1,
            "filename": "autoruncmd-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "5508509a309ea6a95e748898990d7316",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 8145,
            "upload_time": "2024-10-26T18:36:20",
            "upload_time_iso_8601": "2024-10-26T18:36:20.770391Z",
            "url": "https://files.pythonhosted.org/packages/6e/79/4cf87c9819832d3beddb3a07823b86ade2238b48668c8c7229f4807603b4/autoruncmd-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-26 18:36:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "rakeshkanna-rk",
    "github_project": "pyautorun",
    "github_not_found": true,
    "lcname": "autoruncmd"
}
        
Elapsed time: 1.35245s