Skip to main content

Control module exports

Project description

export

Control module exports

About

This library dynamically generates an __all__ attribute for modules

Install

pip install export

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.1.tar.gz (3.1 kB view hashes)

Uploaded Source

Built Distribution

export-0.2.1-py3-none-any.whl (4.1 kB view hashes)

Uploaded Python 3

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