{"id":13595784,"url":"https://github.com/csurfer/blackcellmagic","last_synced_at":"2025-09-10T14:11:26.719Z","repository":{"id":31961126,"uuid":"131018956","full_name":"csurfer/blackcellmagic","owner":"csurfer","description":"IPython magic command to format python code in cell using black.","archived":false,"fork":false,"pushed_at":"2022-05-31T19:59:44.000Z","size":40,"stargazers_count":306,"open_issues_count":7,"forks_count":13,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-10-13T11:26:19.714Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/csurfer.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-25T14:27:26.000Z","updated_at":"2024-09-27T20:46:10.000Z","dependencies_parsed_at":"2022-09-12T11:20:32.906Z","dependency_job_id":null,"html_url":"https://github.com/csurfer/blackcellmagic","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csurfer%2Fblackcellmagic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csurfer%2Fblackcellmagic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csurfer%2Fblackcellmagic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csurfer%2Fblackcellmagic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csurfer","download_url":"https://codeload.github.com/csurfer/blackcellmagic/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247256107,"owners_count":20909240,"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":[],"created_at":"2024-08-01T16:01:57.572Z","updated_at":"2025-04-04T22:04:02.056Z","avatar_url":"https://github.com/csurfer.png","language":"Python","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_donations\u0026business=3BSBW7D45C4YN\u0026lc=US\u0026currency_code=USD\u0026bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted"],"categories":["Python","Jupyter-magic拓展"],"sub_categories":[],"readme":"# blackcellmagic\n\n[![pypiv](https://img.shields.io/pypi/v/blackcellmagic.svg)](https://pypi.python.org/pypi/blackcellmagic)\n[![pyv](https://img.shields.io/pypi/pyversions/blackcellmagic.svg)](https://pypi.python.org/pypi/blackcellmagic)\n[![Licence](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/csurfer/blackcellmagic/master/LICENSE)\n[![Downloads](https://pepy.tech/badge/blackcellmagic)](https://pepy.tech/project/blackcellmagic)\n\nIPython magic command to format python code in cell using [black](https://github.com/ambv/black).\n\n![Demo](https://i.imgur.com/9W8NLUu.gif)\n\n## What is the magic command?\n\n```python\n%%black\n```\n\n## Setup\n\n### Using pip\n\n```bash\npip install blackcellmagic\n```\n\n### Directly from the repository\n\n```bash\ngit clone https://github.com/csurfer/blackcellmagic.git\npython blackcellmagic/setup.py install\n```\n\n### Load Extension in IPython\n\n```python\n%load_ext blackcellmagic\n```\n\n## Usage\n\n```python\n# To have it formatted to black default length 88 with string normalization.\n%%black\n\n# To have it formatted to a particular line length.\n%%black -l 79\n%%black --line-length 79\n\n# To skip string normalization.\n%%black -S\n%%black --skip-string-normalization\n```\n\n## Extras\n\nTobin Jones has been kind enough to develop a NPM package over blackcellmagic to format all cells at once which can be found [here](https://github.com/tobinjones/jupyterlab_formatblack).\n\n## Contributing\n\n### Bug Reports and Feature Requests\n\nPlease use [issue tracker](https://github.com/csurfer/blackcellmagic/issues) for reporting bugs or feature requests.\n\n### Development\n\nPull requests are most welcome.\n\n### Buy the developer a cup of coffee!\n\nIf you found the utility helpful you can buy me a cup of coffee using\n\n[![Donate](https://www.paypalobjects.com/webstatic/en_US/i/btn/png/silver-pill-paypal-44px.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations\u0026business=3BSBW7D45C4YN\u0026lc=US\u0026currency_code=USD\u0026bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsurfer%2Fblackcellmagic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsurfer%2Fblackcellmagic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsurfer%2Fblackcellmagic/lists"}