lightning-utilities


Namelightning-utilities JSON
Version 0.15.0 PyPI version JSON
download
home_pagehttps://github.com/Lightning-AI/utilities
SummaryLightning toolbox for across the our ecosystem.
upload_time2025-07-26 08:47:36
maintainerNone
docs_urlNone
authorLightning AI et al.
requires_python>=3.9
licenseApache-2.0
keywords utilities devops ci/cd
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Lightning Utilities

[![PyPI Status](https://badge.fury.io/py/lightning-utilities.svg)](https://badge.fury.io/py/lightning-utilities)
[![license](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/Lightning-AI/utilities/blob/main/LICENSE)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/lightning-utilities)](https://pepy.tech/project/lightning-utilities)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/lightning-utilities)](https://pypi.org/project/lightning-utilities/)

[![UnitTests](https://github.com/Lightning-AI/utilities/actions/workflows/ci-testing.yml/badge.svg?event=push)](https://github.com/Lightning-AI/utilities/actions/workflows/ci-testing.yml)
[![Apply checks](https://github.com/Lightning-AI/utilities/actions/workflows/ci-use-checks.yaml/badge.svg?event=push)](https://github.com/Lightning-AI/utilities/actions/workflows/ci-use-checks.yaml)
[![Docs Status](https://readthedocs.org/projects/lit-utilities/badge/?version=latest)](https://lit-utilities.readthedocs.io/en/latest/?badge=latest)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/Lightning-AI/utilities/main.svg)](https://results.pre-commit.ci/latest/github/Lightning-AI/utilities/main)

__This repository covers the following use-cases:__

1. _Reusable GitHub workflows_
2. _Shared GitHub actions_
3. _General Python utilities in `lightning_utilities.core`_
4. _CLI `python -m lightning_utilities.cli --help`_

## 1. Reusable workflows

__Usage:__

```yaml
name: Check schema

on: [push]

jobs:

  check-schema:
    uses: Lightning-AI/utilities/.github/workflows/check-schema.yml@v0.5.0
    with:
      azure-dir: ""  # skip Azure check

  check-code:
    uses: Lightning-AI/utilities/.github/workflows/check-code.yml@main
    with:
      actions-ref: main  # normally you shall use the same version as the workflow
```

See usage of other workflows in [.github/workflows/ci-use-checks.yaml](https://github.com/Lightning-AI/utilities/tree/main/.github/workflows/ci-use-checks.yaml).

## 2. Reusable composite actions

See available composite actions [.github/actions/](https://github.com/Lightning-AI/utilities/tree/main/.github/actions).

__Usage:__

```yaml
name: Do something with cache

on: [push]

jobs:
  pytest:
    runs-on: ubuntu-24.04
    steps:
    - uses: actions/checkout@v3
    - uses: actions/setup-python@v4
      with:
        python-version: 3.9
    - uses: Lightning-AI/utilities/.github/actions/cache
      with:
        python-version: 3.9
        requires: oldest # or latest
```

## 3. General Python utilities `lightning_utilities.core`

<details>
  <summary>Installation</summary>
From source:

```bash
pip install https://github.com/Lightning-AI/utilities/archive/refs/heads/main.zip
```

From pypi:

```bash
pip install lightning_utilities
```

</details>

__Usage:__

Example for optional imports:

```python
from lightning_utilities.core.imports import module_available

if module_available("some_package.something"):
    from some_package import something
```

## 4. CLI `lightning_utilities.cli`

The package provides common CLI commands.

<details>
  <summary>Installation</summary>

From pypi:

```bash
pip install lightning_utilities[cli]
```

</details>

__Usage:__

```bash
python -m lightning_utilities.cli [group] [command]
```

<details>
  <summary>Example for setting min versions</summary>

```console
$ cat requirements/test.txt
coverage>=5.0
codecov>=2.1
pytest>=6.0
pytest-cov
pytest-timeout
$ python -m lightning_utilities.cli requirements set-oldest
$ cat requirements/test.txt
coverage==5.0
codecov==2.1
pytest==6.0
pytest-cov
pytest-timeout
```

</details>

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Lightning-AI/utilities",
    "name": "lightning-utilities",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "Utilities, DevOps, CI/CD",
    "author": "Lightning AI et al.",
    "author_email": "developer@lightning.ai",
    "download_url": "https://files.pythonhosted.org/packages/09/2a/3f347a83b61449ea204505fcbe3885ec17ea406c5ac34687631c0caff01f/lightning_utilities-0.15.0.tar.gz",
    "platform": null,
    "description": "# Lightning Utilities\n\n[![PyPI Status](https://badge.fury.io/py/lightning-utilities.svg)](https://badge.fury.io/py/lightning-utilities)\n[![license](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/Lightning-AI/utilities/blob/main/LICENSE)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/lightning-utilities)](https://pepy.tech/project/lightning-utilities)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/lightning-utilities)](https://pypi.org/project/lightning-utilities/)\n\n[![UnitTests](https://github.com/Lightning-AI/utilities/actions/workflows/ci-testing.yml/badge.svg?event=push)](https://github.com/Lightning-AI/utilities/actions/workflows/ci-testing.yml)\n[![Apply checks](https://github.com/Lightning-AI/utilities/actions/workflows/ci-use-checks.yaml/badge.svg?event=push)](https://github.com/Lightning-AI/utilities/actions/workflows/ci-use-checks.yaml)\n[![Docs Status](https://readthedocs.org/projects/lit-utilities/badge/?version=latest)](https://lit-utilities.readthedocs.io/en/latest/?badge=latest)\n[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/Lightning-AI/utilities/main.svg)](https://results.pre-commit.ci/latest/github/Lightning-AI/utilities/main)\n\n__This repository covers the following use-cases:__\n\n1. _Reusable GitHub workflows_\n2. _Shared GitHub actions_\n3. _General Python utilities in `lightning_utilities.core`_\n4. _CLI `python -m lightning_utilities.cli --help`_\n\n## 1. Reusable workflows\n\n__Usage:__\n\n```yaml\nname: Check schema\n\non: [push]\n\njobs:\n\n  check-schema:\n    uses: Lightning-AI/utilities/.github/workflows/check-schema.yml@v0.5.0\n    with:\n      azure-dir: \"\"  # skip Azure check\n\n  check-code:\n    uses: Lightning-AI/utilities/.github/workflows/check-code.yml@main\n    with:\n      actions-ref: main  # normally you shall use the same version as the workflow\n```\n\nSee usage of other workflows in [.github/workflows/ci-use-checks.yaml](https://github.com/Lightning-AI/utilities/tree/main/.github/workflows/ci-use-checks.yaml).\n\n## 2. Reusable composite actions\n\nSee available composite actions [.github/actions/](https://github.com/Lightning-AI/utilities/tree/main/.github/actions).\n\n__Usage:__\n\n```yaml\nname: Do something with cache\n\non: [push]\n\njobs:\n  pytest:\n    runs-on: ubuntu-24.04\n    steps:\n    - uses: actions/checkout@v3\n    - uses: actions/setup-python@v4\n      with:\n        python-version: 3.9\n    - uses: Lightning-AI/utilities/.github/actions/cache\n      with:\n        python-version: 3.9\n        requires: oldest # or latest\n```\n\n## 3. General Python utilities `lightning_utilities.core`\n\n<details>\n  <summary>Installation</summary>\nFrom source:\n\n```bash\npip install https://github.com/Lightning-AI/utilities/archive/refs/heads/main.zip\n```\n\nFrom pypi:\n\n```bash\npip install lightning_utilities\n```\n\n</details>\n\n__Usage:__\n\nExample for optional imports:\n\n```python\nfrom lightning_utilities.core.imports import module_available\n\nif module_available(\"some_package.something\"):\n    from some_package import something\n```\n\n## 4. CLI `lightning_utilities.cli`\n\nThe package provides common CLI commands.\n\n<details>\n  <summary>Installation</summary>\n\nFrom pypi:\n\n```bash\npip install lightning_utilities[cli]\n```\n\n</details>\n\n__Usage:__\n\n```bash\npython -m lightning_utilities.cli [group] [command]\n```\n\n<details>\n  <summary>Example for setting min versions</summary>\n\n```console\n$ cat requirements/test.txt\ncoverage>=5.0\ncodecov>=2.1\npytest>=6.0\npytest-cov\npytest-timeout\n$ python -m lightning_utilities.cli requirements set-oldest\n$ cat requirements/test.txt\ncoverage==5.0\ncodecov==2.1\npytest==6.0\npytest-cov\npytest-timeout\n```\n\n</details>\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Lightning toolbox for across the our ecosystem.",
    "version": "0.15.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/Lightning-AI/utilities/issues",
        "Documentation": "https://dev-toolbox.rtfd.io/en/latest/",
        "Download": "https://github.com/Lightning-AI/utilities",
        "Homepage": "https://github.com/Lightning-AI/utilities",
        "Source Code": "https://github.com/Lightning-AI/utilities"
    },
    "split_keywords": [
        "utilities",
        " devops",
        " ci/cd"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "d05ed2ddba803d14c17812f132beb1db8a5e6b60273d764694316e0616451972",
                "md5": "71a0b202fe9ad5aa5c74b2a0f8424d7b",
                "sha256": "652fea9ca0523418fc731e081485744c7cafea2054f5fff12eea1b2d04441b06"
            },
            "downloads": -1,
            "filename": "lightning_utilities-0.15.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "71a0b202fe9ad5aa5c74b2a0f8424d7b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 29427,
            "upload_time": "2025-07-26T08:47:35",
            "upload_time_iso_8601": "2025-07-26T08:47:35.763823Z",
            "url": "https://files.pythonhosted.org/packages/d0/5e/d2ddba803d14c17812f132beb1db8a5e6b60273d764694316e0616451972/lightning_utilities-0.15.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "092a3f347a83b61449ea204505fcbe3885ec17ea406c5ac34687631c0caff01f",
                "md5": "4efaa989ecf8558fe0e0790ee59a8099",
                "sha256": "3e934ae9c2a77e2f617a4377750e2564d614c391445368d2116a2efe70143ebc"
            },
            "downloads": -1,
            "filename": "lightning_utilities-0.15.0.tar.gz",
            "has_sig": false,
            "md5_digest": "4efaa989ecf8558fe0e0790ee59a8099",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 31023,
            "upload_time": "2025-07-26T08:47:36",
            "upload_time_iso_8601": "2025-07-26T08:47:36.942347Z",
            "url": "https://files.pythonhosted.org/packages/09/2a/3f347a83b61449ea204505fcbe3885ec17ea406c5ac34687631c0caff01f/lightning_utilities-0.15.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-26 08:47:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Lightning-AI",
    "github_project": "utilities",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "lightning-utilities"
}
        
Elapsed time: 2.11496s