{"id":13419547,"url":"https://github.com/manrajgrover/halo","last_synced_at":"2025-04-25T14:47:57.186Z","repository":{"id":41063266,"uuid":"102246567","full_name":"manrajgrover/halo","owner":"manrajgrover","description":"💫 Beautiful spinners for terminal, IPython and Jupyter","archived":false,"fork":false,"pushed_at":"2024-06-16T08:11:53.000Z","size":543,"stargazers_count":2931,"open_issues_count":55,"forks_count":152,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-04-24T08:52:04.408Z","etag":null,"topics":["async","halo","ipython","jupyter","ora","python","spinner"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/manrajgrover.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-03T06:50:47.000Z","updated_at":"2025-04-23T16:02:30.000Z","dependencies_parsed_at":"2024-06-18T11:22:13.602Z","dependency_job_id":"c9600fdc-615d-498d-955b-7f5f7fd69f88","html_url":"https://github.com/manrajgrover/halo","commit_stats":{"total_commits":294,"total_committers":30,"mean_commits":9.8,"dds":0.3571428571428571,"last_synced_commit":"89c7934ddc79b544b48357822f4136c5a18d9cce"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manrajgrover%2Fhalo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manrajgrover%2Fhalo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manrajgrover%2Fhalo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manrajgrover%2Fhalo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/manrajgrover","download_url":"https://codeload.github.com/manrajgrover/halo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250837681,"owners_count":21495584,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async","halo","ipython","jupyter","ora","python","spinner"],"created_at":"2024-07-30T22:01:17.527Z","updated_at":"2025-04-25T14:47:57.154Z","avatar_url":"https://github.com/manrajgrover.png","language":"Python","funding_links":[],"categories":["Python","语言资源库"],"sub_categories":["python"],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/manrajgrover/halo/master/art/halo.png\" height=\"50px\"/\u003e\n  \u003cbr\u003e\n  halo\n\u003c/h1\u003e\n\n[![Build Status](https://travis-ci.com/manrajgrover/halo.svg?branch=master)](https://travis-ci.com/manrajgrover/halo) [![Build status](https://ci.appveyor.com/api/projects/status/wa6t414gltr403ff?svg=true)](https://ci.appveyor.com/project/manrajgrover/halo) [![Coverage Status](https://coveralls.io/repos/github/manrajgrover/halo/badge.svg?branch=master)](https://coveralls.io/github/manrajgrover/halo?branch=master)\n [![PyPI](https://img.shields.io/pypi/v/halo.svg)](https://github.com/manrajgrover/halo) ![awesome](https://img.shields.io/badge/awesome-yes-green.svg) [![Downloads](https://pepy.tech/badge/halo)](https://pepy.tech/project/halo) [![Downloads](https://pepy.tech/badge/halo/month)](https://pepy.tech/project/halo/month)\n\u003e Beautiful spinners for terminal, IPython and Jupyter\n\n![halo](https://raw.github.com/manrajgrover/halo/master/art/doge_spin.svg?sanitize=true)\n\n## Install\n\n```shell\n$ pip install halo\n```\n\n## Usage\n\n```py\nfrom halo import Halo\n\nspinner = Halo(text='Loading', spinner='dots')\nspinner.start()\n\n# Run time consuming work here\n# You can also change properties for spinner as and when you want\n\nspinner.stop()\n```\n\nAlternatively, you can use halo with Python's `with` statement:\n\n```py\nfrom halo import Halo\n\nwith Halo(text='Loading', spinner='dots'):\n    # Run time consuming work here\n```\n\nFinally, you can use halo as a decorator:\n\n```py\nfrom halo import Halo\n\n@Halo(text='Loading', spinner='dots')\ndef long_running_function():\n    # Run time consuming work here\n    pass\n\nlong_running_function()\n```\n\n## API\n\n#### `Halo([text|text_color|spinner|animation|placement|color|interval|stream|enabled])`\n\n##### `text`\n*Type*: `str`\n\nText shown along with spinner.\n\n##### `text_color`\n*Type*: `str`\n*Values*: `grey`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`\n\nColor of the spinner text. Defaults to `None`.\n\n##### `spinner`\n*Type*: `str|dict`\n\nIf string, it should be one of the spinners listed in the given [json](https://github.com/sindresorhus/cli-spinners/blob/dac4fc6571059bb9e9bc204711e9dfe8f72e5c6f/spinners.json) file. If a dict is passed, it should define `interval` and `frames`. Something like:\n\n```py\n{\n    'interval': 100,\n    'frames': ['-', '+', '*', '+', '-']\n}\n```\n\nDefaults to `dots` spinner. For Windows users, it defaults to `line` spinner.\n\n##### `animation`\n*Type*: `str`\n*Values*: `bounce`, `marquee`\n\nAnimation to apply to the text if it's too large and doesn't fit in the terminal. If no animation is defined, the text will be ellipsed.\n\n##### `placement`\n*Type*: `str`\n*Values*: `left`, `right`\n\nWhich side of the text the spinner should be displayed. Defaults to `left`\n\n##### `color`\n*Type*: `str`\n*Values*: `grey`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`\n\nColor of the spinner. Defaults to `cyan`.\n\n##### `interval`\n*Type*: `float`\n\nInterval between each frame. Defaults to spinner interval (recommended).\n\n##### `stream`\n*Type*: `file`\n\nStream to write the output. Defaults to `sys.stdout`.\n\n##### `enabled`\n*Type*: `bool`\n\nEnable or disable the spinner. Defaults to `True`.\n\n### Methods\n\nFollowing are the methods available:\n\n#### `spinner.start([text])`\n\nStarts the spinner. If `text` is passed, it is set as spinner text. Returns the instance.\n\n#### `spinner.stop()`\n\nStops and clears the spinner. Returns the instance.\n\n#### `spinner.clear()`\n\nClears the spinner. Returns the instance.\n\n#### `spinner.render()`\n\nManually renders a new frame. Returns the instance.\n\n#### `spinner.frame()`\n\nReturns next frame to be rendered.\n\n#### `spinner.succeed([text])`\n##### `text`: *Type*: `str`\n\nStops the spinner and changes symbol to `✔`. If text is provided, it is persisted else current text is persisted. Returns the instance.\n\n#### `spinner.fail([text])`\n##### `text`: *Type*: `str`\n\nStops the spinner and changes symbol to `✖`. If text is provided, it is persisted else current text is persisted. Returns the instance.\n\n#### `spinner.warn([text])`\n##### `text`: *Type*: `str`\n\nStops the spinner and changes symbol to `⚠`. If text is provided, it is persisted else current text is persisted. Returns the instance.\n\n#### `spinner.info([text])`\n##### `text`: *Type*: `str`\n\nStops the spinner and changes symbol to `ℹ`. If text is provided, it is persisted else current text is persisted. Returns the instance.\n\n#### `spinner.stop_and_persist([symbol|text])`\nStops the spinner and changes symbol and text. Returns the instance.\n\n##### `symbol`\n*Type*: `str`\n\nSymbol to replace the spinner with. Defaults to `' '`.\n\n##### `text`\n*Type*: `str`\n\nText to be persisted. Defaults to instance text.\n\n![Persist spin](https://raw.github.com/manrajgrover/halo/master/art/persist_spin.svg?sanitize=true)\n\n#### `spinner.text`\nChange the text of spinner.\n\n#### `spinner.color`\nChange the color of spinner\n\n#### `spinner.spinner`\nChange the spinner itself.\n\n#### `spinner.enabled`\nEnable or disable the spinner.\n\n## How to contribute?\n\nPlease see [Contributing guidelines](https://github.com/manrajgrover/halo/blob/master/.github/CONTRIBUTING.md) for more information.\n\n## Like it?\n\n🌟 this repo to show support. Let me know you liked it on [Twitter](https://twitter.com/manrajsgrover).\nAlso, share the [project](https://twitter.com/intent/tweet?url=https%3A%2F%2Fgithub.com%2Fmanrajgrover%2Fhalo\u0026via=manrajsgrover\u0026text=Checkout%20%23halo%20-%20a%20beautiful%20%23terminal%20%23spinners%20library%20for%20%23python\u0026hashtags=github%2C%20pypi).\n\n## Related\n\n* [py-spinners](https://github.com/manrajgrover/py-spinners) - Spinners in Python\n* [py-log-symbols](https://github.com/manrajgrover/py-log-symbols) - Log Symbols in Python\n* [ora](https://github.com/sindresorhus/ora) - Elegant terminal spinners in JavaScript (inspiration behind this project) \n\n## License\n[MIT](https://github.com/manrajgrover/halo/blob/master/LICENSE) © Manraj Singh\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanrajgrover%2Fhalo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanrajgrover%2Fhalo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanrajgrover%2Fhalo/lists"}