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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file export-0.2.1.tar.gz.

File metadata

  • Download URL: export-0.2.1.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.1 CPython/3.10.6 Linux/5.15.0-73-generic

File hashes

Hashes for export-0.2.1.tar.gz
Algorithm Hash digest
SHA256 b206d7c6cb2246781321bc30394bf1364496fdfc1d1ea69cfe67da6d67095a7e
MD5 689a66c8dc648afc4e1f23d1cba7e14c
BLAKE2b-256 9c4e6e9b2a1594d00b138ea8f51007ad73ab646c42f4694b12a0395576d9b9f8

See more details on using hashes here.

File details

Details for the file export-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: export-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.1 CPython/3.10.6 Linux/5.15.0-73-generic

File hashes

Hashes for export-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 223ea74ae90715f56c3009e4cf19c8289b92ab56a3a0a8a00c5cf31e464f58f7
MD5 aaaeabeec745470a8eccd2debf9f8fda
BLAKE2b-256 5b7d1712bd54b282d4e0bef5a7dd08a1211609311c9cfefca979c7123d9eaed1

See more details on using hashes here.

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