Documentation for the Code

A pypi demonstration vehicle.

useful #1 – auto members

This is something I want to say that is not in the docstring.

Platforms: Unix, Windows

class an_example_pypi_project.useful_1.MyPublicClass(foo, bar='baz')

We use this as a public class example class.

You never call this class before calling public_fn_with_sphinxy_docstring().

Note

An example of intersphinx is this: you cannot use pickle on this class.

get_foobar(foo, bar=True)

This gets the foobar

This really should have a full function definition, but I am too lazy.

>>> print get_foobar(10, 20)
30
>>> print get_foobar('a', 'b')
ab

Isn’t that what you want?

an_example_pypi_project.useful_1.public_fn_with_googley_docstring(name, state=None)

This function does something.

Args:
name (str): The name to use.
Kwargs:
state (bool): Current state to be in.
Returns:

int. The return code:

0 -- Success!
1 -- No good. 
2 -- Try again. 
Raises:
AttributeError, KeyError

A really great idea. A way you might use me is

>>> print public_fn_with_googley_docstring(name='foo', state=None)
0

BTW, this always returns 0. NEVER use with MyPublicClass.

an_example_pypi_project.useful_1.public_fn_with_sphinxy_docstring(name, state=None)

This function does something.

Parameters:
  • name (str.) – The name to use.
  • state (bool.) – Current state to be in.
Returns:

int – the return code.

Raises:

AttributeError, KeyError

useful #2 – explicit members

This is something I want to say that is not in the docstring.

A very useful module indeed.

an_example_pypi_project.useful_2.public_fn_with_sphinxy_docstring(name, state=None)

This function does something.

Parameters:
  • name (str.) – The name to use.
  • state (bool.) – Current state to be in.
Returns:

int – the return code.

Raises:

AttributeError, KeyError

an_example_pypi_project.useful_2._private_fn_with_docstring(foo, bar='baz', foobarbas=None)
I have a docstring, but won’t be imported if you just use :members:.
class an_example_pypi_project.useful_2.MyPublicClass(foo, bar='baz')

We use this as a public class example class.

You never call this class before calling public_fn_with_sphinxy_docstring().

Note

An example of intersphinx is this: you cannot use pickle on this class.

get_foobar(foo, bar=True)

This gets the foobar

This really should have a full function definition, but I am too lazy.

>>> print get_foobar(10, 20)
30
>>> print get_foobar('a', 'b')
ab

Isn’t that what you want?

_get_baz(baz=None)

A private function to get baz.

This really should have a full function definition, but I am too lazy.

Table Of Contents

Previous topic

Getting Started With setuptools and setup.py

Next topic

Building and Uploading Your Sphinx Docs to pypi

This Page