ddocs

Offline and fast documentation (+ source code) cli viewer for python libraries. For when using a browser can be a pain. Also an optional gui.


Keywords
docs, library, offline, documentation
License
MIT
Install
pip install ddocs==0.1.2

Documentation

A quick offline terminal based python doc filterer.

When you want to find what's in a module, it's classes and functions.. OR you remember the functions in a module, but want a quick refresher.

Orginally I was going to add javascript/Go support, but it feels meh to in this era of GPTs.

You can add and generate the data for non-standard library modules by adding modules on your system to the python.txt file in the languages directory, and calling the py_data.py script to create a new ddocs.db with custom data... Maybe I should be making it more streamlined for users, but for now it'll be a long term todo.

So theoretically you could do something like,

./ddocs.py numpy

Examples

./ddocs.py bisect bisect_left

Module bisect:

Bisection algorithms.

-----------------

Entity bisect_left (function):

Signature: 
Return: 

bisect_left(a, x[, lo[, hi]]) -> index

Return the index where to insert item x in list a, assuming a is sorted.

The return value i is such that all e in a[:i] have e < x, and all e in
a[i:] have e >= x.  So if x already appears in the list, i points just
before the leftmost x already there.

Optional args lo (default 0) and hi (default len(a)) bound the
slice of a to be searched.

Source: 

-----------------
Children entities:
- __call__ (function)
- __class__ (class)
- __delattr__ (function)
- __dir__ (function)
- __eq__ (function)
- __format__ (function)
- __ge__ (function)
- __getattribute__ (function)
- __gt__ (function)
- __hash__ (function)
- __init__ (function)
- __init_subclass__ (function)
- __le__ (function)
- __lt__ (function)
- __ne__ (function)
- __new__ (function)
- __reduce__ (function)
- __reduce_ex__ (function)
- __repr__ (function)
- __setattr__ (function)
- __sizeof__ (function)
- __str__ (function)
- __subclasshook__ (function)

./ddocs.py itertools product

Module itertools:

Functional tools for creating and using iterators.

Infinite iterators:
count(start=0, step=1) --> start, start+step, start+2*step, ...
cycle(p) --> p0, p1, ... plast, p0, p1, ...
repeat(elem [,n]) --> elem, elem, elem, ... endlessly or up to n times

Iterators terminating on the shortest input sequence:
accumulate(p[, func]) --> p0, p0+p1, p0+p1+p2
chain(p, q, ...) --> p0, p1, ... plast, q0, q1, ...
chain.from_iterable([p, q, ...]) --> p0, p1, ... plast, q0, q1, ...
compress(data, selectors) --> (d[0] if s[0]), (d[1] if s[1]), ...
dropwhile(pred, seq) --> seq[n], seq[n+1], starting when pred fails
groupby(iterable[, keyfunc]) --> sub-iterators grouped by value of keyfunc(v)
filterfalse(pred, seq) --> elements of seq where pred(elem) is False
islice(seq, [start,] stop [, step]) --> elements from
       seq[start:stop:step]
starmap(fun, seq) --> fun(*seq[0]), fun(*seq[1]), ...
tee(it, n=2) --> (it1, it2 , ... itn) splits one iterator into n
takewhile(pred, seq) --> seq[0], seq[1], until pred fails
zip_longest(p, q, ...) --> (p[0], q[0]), (p[1], q[1]), ...

Combinatoric generators:
product(p, q, ... [repeat=1]) --> cartesian product
permutations(p[, r])
combinations(p, r)
combinations_with_replacement(p, r)

-----------------

Entity product (class):

Signature: 
Return: 

product(*iterables, repeat=1) --> product object

Cartesian product of input iterables.  Equivalent to nested for-loops.

For example, product(A, B) returns the same as:  ((x,y) for x in A for y in B).
The leftmost iterators are in the outermost for-loop, so the output tuples
cycle in a manner similar to an odometer (with the rightmost element changing
on every iteration).

To compute the product of an iterable with itself, specify the number
of repetitions with the optional repeat keyword argument. For example,
product(A, repeat=4) means the same as product(A, A, A, A).

product('ab', range(3)) --> ('a',0) ('a',1) ('a',2) ('b',0) ('b',1) ('b',2)
product((0,1), (0,1), (0,1)) --> (0,0,0) (0,0,1) (0,1,0) (0,1,1) (1,0,0) ...

Source: 

-----------------
Children entities:
- __class__ (class)
- __delattr__ (function)
- __dir__ (function)
- __eq__ (function)
- __format__ (function)
- __ge__ (function)
- __getattribute__ (function)
- __gt__ (function)
- __hash__ (function)
- __init__ (function)
- __init_subclass__ (function)
- __iter__ (function)
- __le__ (function)
- __lt__ (function)
- __ne__ (function)
- __new__ (function)
- __next__ (function)
- __reduce__ (function)
- __reduce_ex__ (function)
- __repr__ (function)
- __setattr__ (function)
- __setstate__ (function)
- __sizeof__ (function)
- __str__ (function)
- __subclasshook__ (function)