Skip to main content

Stop your users from doing whatever they want

PyPI - Version PyPI - Python Version

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:

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:

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:

from disallow_import_star

disallow_import_star.disallow_import_star_EVERYWHERE()

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

disallow_import_star-0.4.1.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

disallow_import_star-0.4.1-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file disallow_import_star-0.4.1.tar.gz.

File metadata

  • Download URL: disallow_import_star-0.4.1.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.23.0

File hashes

Hashes for disallow_import_star-0.4.1.tar.gz
Algorithm Hash digest
SHA256 ef7e690e70835664dbf80ee8d4aa16ecb515bd490d2f3b33beeb5cce214c2a93
MD5 e78779b99a003e4c928246778e281ca2
BLAKE2b-256 749ad2d73e6b4ea752f91665449eeacc95109fde78f36eaa5c6cefc76804a340

See more details on using hashes here.

File details

Details for the file disallow_import_star-0.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for disallow_import_star-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 aa7562e4b4d15f6af78c3380c0e866cb1d876d61c7fb084d7c73fe25052f1e29
MD5 ec96b2b1b093513f5455ce356d551cfb
BLAKE2b-256 884b1272740dca84c0086894aca4b062b3768573c8386ae5db097f4c38304649

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 files

0.0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page