perhaps in a more beautiful way, but:
import numpy as np doc_string = np.random.__doc__ doc_string = doc_string.split("\n") distribs = [] for line in doc_string: if 'distribution' in line: word = line.split()[0] if word[0].islower(): distribs.append(word)
gives
>>> distribs ['beta', 'binomial', 'chisquare', 'exponential', 'f', 'gamma', 'geometric', 'gumbel', 'hypergeometric', 'laplace', 'logistic', 'lognormal', 'logseries', 'negative_binomial', 'noncentral_chisquare', 'noncentral_f', 'normal', 'pareto', 'poisson', 'power', 'rayleigh', 'triangular', 'uniform', 'vonmises', 'wald', 'weibull', 'zipf', 'dirichlet', 'multinomial', 'multivariate_normal', 'standard_cauchy', 'standard_exponential', 'standard_gamma', 'standard_normal', 'standard_t']
edit: headers are included randomly.
edit2: Soravux is right that this is bad and is unlikely to work forever.