Skip to main content

Control module exports

Project description

export

Control module exports

About

This library dynamically generates an __all__ attribute for modules

Usage

Private by Default

Does export objects marked public, doesn't export everything else

# lib.py

import export

export.init(default=export.PRIVATE)

@export.public
def foo():
    pass

def bar():
    pass

def baz():
    pass
>>> import lib
>>> 
>>> lib.__all__
['foo']

Public by Default

Doesn't export objects marked private, does export everything else

# lib.py

import export

export.init(default=export.PUBLIC)

def foo():
    pass

@export.private
def bar():
    pass

@export.private
def baz():
    pass
>>> import lib
>>> 
>>> lib.__all__
['export', 'foo']

Project details


Download files

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

Source Distribution

export-0.2.0.tar.gz (2.9 kB view hashes)

Uploaded source

Built Distribution

export-0.2.0-py3-none-any.whl (3.5 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page