Python

Write an awesome doc for Python. A very nice an practical one extracted from Python official documentation.

View on GitHub

Package

Using the Sound Package

Clients of this package then can import it like this:

import sound.effects.echo

Now to apply an echo effect we can say:

sound.effects.echo.apply_effect(input, output, delay=0.7, atten=4)

Or you can simplify it a little bit by importing the echo module to use it directly:

from sound.effects import echo
echo.apply_effect(input, output, delay=0.7, atten=4)

Intra-package References

Suppose you need to import sound/effect/echo.py module inside the sound/filters/vocoder.py. We can do it either with:

  1. Absolute imports:

    # sound/filters/vocoder.py
    from sound.effects import echo
    

    Used mainly by the main module.

  2. Or relative imports:

    # sound/filters/vocoder.py
    from ..effect import echo
    

    Can be used in subpackages. But inside a subpackage we can actually use either absolute imports or relative ones.

YouTube/Aparat

Ref