Retrieving the list of all the Python APIs given by an application
Question: i would like to retrieve the list of all the APIs that an application is
giving to the users.

The Application is written in C/C++ for the biggest part.

I was hoping that python has a standard function for that, i was also trying
to approach this in terms of namespaces, since i'm not interested in all the
keywords but only in the ones provided with the APIs, but i simply do not know
where to start in terms of functions, i do not know about functions that are
doing something related to what i'm trying to achieve.

The application uses Python 3.x to provide APIs.


Answer: Python doesn't have a notion of an API (or _interface_) as a language
primitive. A module or package will expose some of its members (functions and
variables) and hide others, so if you know _which_ modules you are interested
in, "exposing" in this sense is AFAIK the most meaningful concept.

The exposed members are the same ones that will be imported if you run `from
<module> import *`. As you probably know, member names that begin with a
single underscore, or [begin with two
underscores](http://docs.python.org/reference/expressions.html#atom-
identifiers) and do _not_ end with two, are not meant to be part of the API
and will not be exported; by default everything else will be exposed, but a
module can customize its API by listing what should be exported in the
`__all__` variable-- see [Importing * from a
package](http://docs.python.org/tutorial/modules.html#importing-from-a-
package).

So, to find the APIs you are looking for you must first know which top-level
modules you are interested in. If the application in question is available to
python as a single package, start with it. If it has a `__all__` variable, its
contents are the API for the package. If it does not, look through the
contents of `dir(<package>)` and exclude anything that starts with only a
single underscore, or starts with two underscores but does not end with two.
If you're looking at a large package, some of what you'll find are themselves
modules or packages. Examine them the same way, recursively.

