https://github.com/treyhunner/disallow-import-star
Stop your users from using "import *"
https://github.com/treyhunner/disallow-import-star
Last synced: 6 months ago
JSON representation
Stop your users from using "import *"
- Host: GitHub
- URL: https://github.com/treyhunner/disallow-import-star
- Owner: treyhunner
- License: mit
- Created: 2023-04-01T15:55:58.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-03T15:54:30.000Z (over 1 year ago)
- Last Synced: 2024-11-28T16:51:40.817Z (7 months ago)
- Language: Python
- Homepage: https://trey.io/nostar
- Size: 2.93 KB
- Stars: 15
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Stop your users from doing whatever they want
[](https://pypi.org/project/disallow-import-star)
[](https://pypi.org/project/disallow-import-star)Are you a meanie?
Do you feel your users shouldn't be allowed to to use `from your_module import *` whenever they want?This is the package for you!
Just `pip install disallow-import-star` and add this magical lines to your module:
```python
from disallow_import_star import __all__
```## Would you like to impose your will on *other* packages?
If you really want your users to stop using `import *` in *other* their packages, you can monkey patch your user's favorite packages, like this:
```python
from disallow_import_star import __all__
import math
import numpy
import tkinter# Why should our users be able to use import * ANYWHERE?
math.__all__ == __all__
numpy.__all__ == __all__
tkinter.__all__ == __all__
```## Want to control *all* the packages?
To really upset your `import *`-using users, run this:
```python
from disallow_import_stardisallow_import_star.disallow_import_star_EVERYWHERE()
```