title: How to expose only few 'names' (variables/functions) in a python (importable) script
body: <p>I have following Python script:</p>
  
  <pre class="lang-py prettyprint-override"><code>#! /usr/bin/python3 -u
  # encoding: utf-8
  
  import zmq
  import logging
  import os
  
  _zmq_channel = "ipc:///tmp/hms_logger.ipc"
  
  
  class _Logger:
      _instance = None
      _instance_pid = 0
  
      def __init__(self):
          ctx = zmq.Context.instance()
          self._logger = ctx.socket(zmq.PUB)
          self._logger.connect(zmq_channel)
  
      @classmethod
      def instance(cls):
          if cls._instance is None or cls._instance_pid != os.getpid():
              cls._instance = cls()
              cls._instance_pid = os.getpid()
          # print(cls._instance)
          return cls._instance
  
      def _write(self, obj):
          self._logger.send_pyobj(obj)
  
      def debug(self, msg: str):
          self._write((logging.DEBUG, msg))
  
      def info(self, msg: str):
          self._write((logging.INFO, msg))
  
      def warn(self, msg: str):
          self.warning(msg)
  
      def warning(self, msg: str):
          self._write((logging.WARNING, msg))
  
      def error(self, msg: str):
          self._write((logging.ERROR, msg))
  
      def critical(self, msg: str):
          self._write((logging.CRITICAL, msg))
  
  
  def get_logger():
      return _Logger.instance()
  
  </code></pre>
  
  <p>If I import above script, how can I make sure only <code>get_logger()</code> is imported and other names like <code>_Logger</code>, <code>_zmq_channel</code> are not imported, i.e. importing them should generate some error or warning</p>