hyperscript-cli


Namehyperscript-cli JSON
Version 1.0.7 PyPI version JSON
download
home_pagehttps://github.com/happer64bit/hyperscript
SummaryPowerful HTTP Request Tester
upload_time2024-09-13 03:19:45
maintainerNone
docs_urlNone
authorHapper
requires_python>=3.8
licenseNone
keywords configuration requests api handling
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Hyperscript

**Hyperscript** is a tool for testing HTTP requests with flexible configuration and validation.

<a href="https://www.producthunt.com/posts/hyperscript?embed=true&utm_source=badge-featured&utm_medium=badge&utm_souce=badge-hyperscript" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=476454&theme=light" alt="HyperScript - Powerful&#0032;HTTP&#0032;Request&#0032;Tester&#0032;⌚ | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54" /></a>

## Features

- **HTTP Methods**: Test GET, POST, PUT, and DELETE requests.
- **Validation**: Check status codes, content types, and body content.
- **Conditions**: Validate if responses contain specific values, match exact values, or if numeric fields meet criteria (less than, greater than, equal to).
- **Concurrency**: Run tests in parallel to improve efficiency.
- **Reporting**: Detailed success and failure messages, with optional verbose output.

## Installation

Install with pip:

```bash
pip install hyperscript-cli
```

## Configuration

Create a YAML file (`config.yaml`) for your tests. Example:

```yaml
global:
  url: https://freetestapi.com

run:
  - name: Get All Cars
    path: /api/v1/cars
    expect:
      contentType: application/json
      status: 200

  - name: Get Single Car
    path: /api/v1/cars/1
    expect:
      contentType: application/json
      status:
        - value: 200
        - value: 201
      contains:
        id: 1
      equalTo:
        make: Toyota
        model: Corolla
      lessThan:
        price: 30000
      greaterThan:
        year: 2010
      body:
        make: Toyota
        model: Corolla
        color: Silver
```

### Environment Variables

You can use environment variables in your configuration. For example, use `{{VARIABLE_NAME}}` syntax to reference environment variables.

Set environment variables before running your tests:

```bash
export BASE_URL=https://freetestapi.com
export CAR_ID=1
```

Update `config.yaml` to use these variables:

```yaml
global:
  url: "{{BASE_URL}}"

run:
  - name: Get Single Car
    path: /api/v1/cars/{{CAR_ID}}
    expect:
      contentType: application/json
      status:
        - value: 200
        - value: 201
```

## Usage

Run tests with the `hyperscript` command:

```bash
hyperscript path/to/config.yaml
```

### Command-Line Arguments

- `config_file`: Path to the YAML configuration file. Default is `hypertest.yml`.

  Example:
  ```bash
  hyperscript path/to/config.yaml
  ```

- `--skip-error`: Continue with the next test on error.

  Example:
  ```bash
  hyperscript path/to/config.yaml --skip-error
  ```

- `--verbose`: Enable detailed logging for more comprehensive output.

  Example:
  ```bash
  hyperscript path/to/config.yaml --verbose
  ```

- `--concurrency`: Set the number of concurrent tests to run. If not specified, tests will run sequentially.

  Example:
  ```bash
  hyperscript path/to/config.yaml --concurrency 5
  ```

## Contributing

Fork the repository and submit a pull request with your changes.

## License

MIT License. See the [LICENSE](LICENSE) file.

## Contact

For questions, email [happer64bit@gmail.com](mailto:happer64bit@gmail.com).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/happer64bit/hyperscript",
    "name": "hyperscript-cli",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "configuration requests API handling",
    "author": "Happer",
    "author_email": "happer64bit@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/7e/57/e823b46673e1ce12b8d63a567e98c2f5b25437f46c96262e56193fe79845/hyperscript_cli-1.0.7.tar.gz",
    "platform": null,
    "description": "# Hyperscript\n\n**Hyperscript** is a tool for testing HTTP requests with flexible configuration and validation.\n\n<a href=\"https://www.producthunt.com/posts/hyperscript?embed=true&utm_source=badge-featured&utm_medium=badge&utm_souce=badge-hyperscript\" target=\"_blank\"><img src=\"https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=476454&theme=light\" alt=\"HyperScript - Powerful&#0032;HTTP&#0032;Request&#0032;Tester&#0032;\u231a | Product Hunt\" style=\"width: 250px; height: 54px;\" width=\"250\" height=\"54\" /></a>\n\n## Features\n\n- **HTTP Methods**: Test GET, POST, PUT, and DELETE requests.\n- **Validation**: Check status codes, content types, and body content.\n- **Conditions**: Validate if responses contain specific values, match exact values, or if numeric fields meet criteria (less than, greater than, equal to).\n- **Concurrency**: Run tests in parallel to improve efficiency.\n- **Reporting**: Detailed success and failure messages, with optional verbose output.\n\n## Installation\n\nInstall with pip:\n\n```bash\npip install hyperscript-cli\n```\n\n## Configuration\n\nCreate a YAML file (`config.yaml`) for your tests. Example:\n\n```yaml\nglobal:\n  url: https://freetestapi.com\n\nrun:\n  - name: Get All Cars\n    path: /api/v1/cars\n    expect:\n      contentType: application/json\n      status: 200\n\n  - name: Get Single Car\n    path: /api/v1/cars/1\n    expect:\n      contentType: application/json\n      status:\n        - value: 200\n        - value: 201\n      contains:\n        id: 1\n      equalTo:\n        make: Toyota\n        model: Corolla\n      lessThan:\n        price: 30000\n      greaterThan:\n        year: 2010\n      body:\n        make: Toyota\n        model: Corolla\n        color: Silver\n```\n\n### Environment Variables\n\nYou can use environment variables in your configuration. For example, use `{{VARIABLE_NAME}}` syntax to reference environment variables.\n\nSet environment variables before running your tests:\n\n```bash\nexport BASE_URL=https://freetestapi.com\nexport CAR_ID=1\n```\n\nUpdate `config.yaml` to use these variables:\n\n```yaml\nglobal:\n  url: \"{{BASE_URL}}\"\n\nrun:\n  - name: Get Single Car\n    path: /api/v1/cars/{{CAR_ID}}\n    expect:\n      contentType: application/json\n      status:\n        - value: 200\n        - value: 201\n```\n\n## Usage\n\nRun tests with the `hyperscript` command:\n\n```bash\nhyperscript path/to/config.yaml\n```\n\n### Command-Line Arguments\n\n- `config_file`: Path to the YAML configuration file. Default is `hypertest.yml`.\n\n  Example:\n  ```bash\n  hyperscript path/to/config.yaml\n  ```\n\n- `--skip-error`: Continue with the next test on error.\n\n  Example:\n  ```bash\n  hyperscript path/to/config.yaml --skip-error\n  ```\n\n- `--verbose`: Enable detailed logging for more comprehensive output.\n\n  Example:\n  ```bash\n  hyperscript path/to/config.yaml --verbose\n  ```\n\n- `--concurrency`: Set the number of concurrent tests to run. If not specified, tests will run sequentially.\n\n  Example:\n  ```bash\n  hyperscript path/to/config.yaml --concurrency 5\n  ```\n\n## Contributing\n\nFork the repository and submit a pull request with your changes.\n\n## License\n\nMIT License. See the [LICENSE](LICENSE) file.\n\n## Contact\n\nFor questions, email [happer64bit@gmail.com](mailto:happer64bit@gmail.com).\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Powerful HTTP Request Tester",
    "version": "1.0.7",
    "project_urls": {
        "Homepage": "https://github.com/happer64bit/hyperscript"
    },
    "split_keywords": [
        "configuration",
        "requests",
        "api",
        "handling"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "387e091d1839b90932fbc575effa78860949ff7e375f696eadacad42c7c45164",
                "md5": "4e1af6eb381796c0b751695182ae3246",
                "sha256": "0eb1e2928a0b4d2375ddfe5e9bad7385cbb4cf90cfcffe2e2a304599d760a13f"
            },
            "downloads": -1,
            "filename": "hyperscript_cli-1.0.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4e1af6eb381796c0b751695182ae3246",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 7255,
            "upload_time": "2024-09-13T03:19:44",
            "upload_time_iso_8601": "2024-09-13T03:19:44.535302Z",
            "url": "https://files.pythonhosted.org/packages/38/7e/091d1839b90932fbc575effa78860949ff7e375f696eadacad42c7c45164/hyperscript_cli-1.0.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7e57e823b46673e1ce12b8d63a567e98c2f5b25437f46c96262e56193fe79845",
                "md5": "8ca2e5b2cef252c5468525a160c6c45c",
                "sha256": "c233c0f136993a3e2c58f61b0bf0983d0e4b984193bf51e7318d85d20ccde79f"
            },
            "downloads": -1,
            "filename": "hyperscript_cli-1.0.7.tar.gz",
            "has_sig": false,
            "md5_digest": "8ca2e5b2cef252c5468525a160c6c45c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 6404,
            "upload_time": "2024-09-13T03:19:45",
            "upload_time_iso_8601": "2024-09-13T03:19:45.978159Z",
            "url": "https://files.pythonhosted.org/packages/7e/57/e823b46673e1ce12b8d63a567e98c2f5b25437f46c96262e56193fe79845/hyperscript_cli-1.0.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-13 03:19:45",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "happer64bit",
    "github_project": "hyperscript",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "hyperscript-cli"
}
        
Elapsed time: 0.32014s