Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tokusumi/noglobal-magic
Magic command for jupyter notebook, to stop / warning function declaration including global variables. It helps to avoid side effect involving global variables.
https://github.com/tokusumi/noglobal-magic
jupyter-notebook
Last synced: about 1 month ago
JSON representation
Magic command for jupyter notebook, to stop / warning function declaration including global variables. It helps to avoid side effect involving global variables.
- Host: GitHub
- URL: https://github.com/tokusumi/noglobal-magic
- Owner: tokusumi
- License: mit
- Created: 2020-12-15T08:58:18.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-03-13T11:01:01.000Z (over 3 years ago)
- Last Synced: 2024-10-01T09:24:59.247Z (about 2 months ago)
- Topics: jupyter-notebook
- Language: Python
- Homepage:
- Size: 37.1 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# noglobal-magic
[![Tests](https://github.com/tokusumi/noglobal-magic/actions/workflows/testing.yml/badge.svg)](https://github.com/tokusumi/noglobal-magic/actions/workflows/testing.yml)
[![PyPI version](https://badge.fury.io/py/noglobal-magic.svg)](https://badge.fury.io/py/noglobal-magic)For Jupyter Notebook user's, [noglobal-magic](https://github.com/tokusumi/noglobal-magic) find global variables in a local scope.
With:
* No need to wait executing a function
* `flake8` style ignoring-error annotation (`# noqa`)
* `no_global` magic command makes raise error, and `warn_global` tells a just warning## Installation
Make sure you've this `noglobal-magic` (And the Python package `pyflakes`).
```shell
pip install noglobal-magic
```## How to use
In a cell on Jupyter Notebook, load and activate this extension:
```notebook
%load_ext noglobal_magic
%no_global
```You've ready to enjoy coding.
Let's see in [colab](https://colab.research.google.com/drive/1y7Zr-RD2RPcSTjs0ml6vswbc96_IKt2y?usp=sharing) how it works.