ddocs


Nameddocs JSON
Version 0.1.2 PyPI version JSON
download
home_page
Summary
upload_time2023-06-24 19:02:05
maintainer
docs_urlNone
authorgkegke
requires_python>=3.8
licenseMIT
keywords docs library offline documentation
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## TL;DR

> pip install ddocs

ddocs numpy => [list of functions and classes in numpy]

ddocs math sqrt => Details of the sqrt function, displays it's __doc__ and etc.

ddocs-gui => opens a very simple gui version based on dearpygui

```
usage: ddocs [-h] [--gui [GUI]] [--search SEARCH] [--update [UPDATE]] [--update-module UPDATE_MODULE]
                [--reset-database [RESET_DATABASE]] [--list-all [LIST_ALL]]
                [module] [entities [entities ...]]

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

positional arguments:
  module                Name of the module e.g. builtins, math, numpy
  entities              Optional name of entities in the module e.g. str, sqrt, vectorize

optional arguments:
  -h, --help            show this help message and exit
  --gui [GUI]           Open simple gui version of ddocs.
  --search SEARCH       Search for modules starting with the argument.
  --update [UPDATE]     Update the database to match the modules located in the languages/python.txt file.
  --update-module UPDATE_MODULE
                        Deletes the input module data from the database and re-downloads the latest data if the module
                        is found in the languages/python.txt file.
  --reset-database [RESET_DATABASE]
                        Resets the entire database, then downloads module data given the languages/python.txt file.
                        This can take some time.
  --list-all [LIST_ALL]
                        List all modules in the database
```

## About

A simple and quick offline terminal based python doc search.

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. For now it's a possible future todo.

You can add and generate the data for non-standard library modules by adding libraries to the python.txt file. then running

> ddocs --update

python.txt file locations,

Linux:        

> ~/.local/share/ddocs

Mac:

> ~/Library/Application Support/ddocs/python.txt

Windows:

> C:\Documents and Settings\<User>\Application Data\Local Settings\gkegke\ddocs

or

> C:\Documents and Settings\<User>\Application Data\gkegke\ddocs

So theoretically you could do something like,

> ./ddocs.py numpy vectorize

# Troubleshooting

Concrete solution is to delete the ddocs folder, and re-run ddocs.

Then, re-add all the modules you want tracked in your languages/python.txt file.

### python.txt

```
# popular non-standard library libraries 
flask
numpy
django
## add more custom libraries you want ddocs to track and store offline data for
# popular 70 libraries from the standard library
argparse
array
ast
asyncio
...
```

Add new libraries you want to track to the list, remove any you feel you don't need/use very
often. Adding a # to the line skips it.

It's simple enough..

e.g.

```
flask
numpy
django
rich
pandas
# popular 70 libraries from the standard library
argparse
builtins
...
```

## Examples

> ddocs 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 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)
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "ddocs",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "docs,library,offline,documentation",
    "author": "gkegke",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/f2/f3/f5b21c42a985753e67760a4b713d9c0e300727b1b7405b0537ff8a2f90aa/ddocs-0.1.2.tar.gz",
    "platform": null,
    "description": "## TL;DR\n\n> pip install ddocs\n\nddocs numpy => [list of functions and classes in numpy]\n\nddocs math sqrt => Details of the sqrt function, displays it's __doc__ and etc.\n\nddocs-gui => opens a very simple gui version based on dearpygui\n\n```\nusage: ddocs [-h] [--gui [GUI]] [--search SEARCH] [--update [UPDATE]] [--update-module UPDATE_MODULE]\n                [--reset-database [RESET_DATABASE]] [--list-all [LIST_ALL]]\n                [module] [entities [entities ...]]\n\nOffline and fast documentation (+ source code) cli viewer for python libraries. For when using a browser can be a pain. Also an optional gui.\n\npositional arguments:\n  module                Name of the module e.g. builtins, math, numpy\n  entities              Optional name of entities in the module e.g. str, sqrt, vectorize\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --gui [GUI]           Open simple gui version of ddocs.\n  --search SEARCH       Search for modules starting with the argument.\n  --update [UPDATE]     Update the database to match the modules located in the languages/python.txt file.\n  --update-module UPDATE_MODULE\n                        Deletes the input module data from the database and re-downloads the latest data if the module\n                        is found in the languages/python.txt file.\n  --reset-database [RESET_DATABASE]\n                        Resets the entire database, then downloads module data given the languages/python.txt file.\n                        This can take some time.\n  --list-all [LIST_ALL]\n                        List all modules in the database\n```\n\n## About\n\nA simple and quick offline terminal based python doc search.\n\nWhen you want to find what's in a module, it's classes and functions..\nOR you remember the functions in a module, but want a quick refresher.\n\nOrginally I was going to add javascript/Go support, but it feels meh to in this era of GPTs. For now it's a possible future todo.\n\nYou can add and generate the data for non-standard library modules by adding libraries to the python.txt file. then running\n\n> ddocs --update\n\npython.txt file locations,\n\nLinux:        \n\n> ~/.local/share/ddocs\n\nMac:\n\n> ~/Library/Application Support/ddocs/python.txt\n\nWindows:\n\n> C:\\Documents and Settings\\<User>\\Application Data\\Local Settings\\gkegke\\ddocs\n\nor\n\n> C:\\Documents and Settings\\<User>\\Application Data\\gkegke\\ddocs\n\nSo theoretically you could do something like,\n\n> ./ddocs.py numpy vectorize\n\n# Troubleshooting\n\nConcrete solution is to delete the ddocs folder, and re-run ddocs.\n\nThen, re-add all the modules you want tracked in your languages/python.txt file.\n\n### python.txt\n\n```\n# popular non-standard library libraries \nflask\nnumpy\ndjango\n## add more custom libraries you want ddocs to track and store offline data for\n# popular 70 libraries from the standard library\nargparse\narray\nast\nasyncio\n...\n```\n\nAdd new libraries you want to track to the list, remove any you feel you don't need/use very\noften. Adding a # to the line skips it.\n\nIt's simple enough..\n\ne.g.\n\n```\nflask\nnumpy\ndjango\nrich\npandas\n# popular 70 libraries from the standard library\nargparse\nbuiltins\n...\n```\n\n## Examples\n\n> ddocs bisect bisect_left\n\n```\nModule bisect:\n\nBisection algorithms.\n\n-----------------\n\nEntity bisect_left (function):\n\nSignature: \nReturn: \n\nbisect_left(a, x[, lo[, hi]]) -> index\n\nReturn the index where to insert item x in list a, assuming a is sorted.\n\nThe return value i is such that all e in a[:i] have e < x, and all e in\na[i:] have e >= x.  So if x already appears in the list, i points just\nbefore the leftmost x already there.\n\nOptional args lo (default 0) and hi (default len(a)) bound the\nslice of a to be searched.\n\nSource: \n\n-----------------\nChildren entities:\n- __call__ (function)\n- __class__ (class)\n- __delattr__ (function)\n- __dir__ (function)\n- __eq__ (function)\n- __format__ (function)\n- __ge__ (function)\n- __getattribute__ (function)\n- __gt__ (function)\n- __hash__ (function)\n- __init__ (function)\n- __init_subclass__ (function)\n- __le__ (function)\n- __lt__ (function)\n- __ne__ (function)\n- __new__ (function)\n- __reduce__ (function)\n- __reduce_ex__ (function)\n- __repr__ (function)\n- __setattr__ (function)\n- __sizeof__ (function)\n- __str__ (function)\n- __subclasshook__ (function)\n```\n\n> ddocs itertools product\n\n```\nModule itertools:\n\nFunctional tools for creating and using iterators.\n\nInfinite iterators:\ncount(start=0, step=1) --> start, start+step, start+2*step, ...\ncycle(p) --> p0, p1, ... plast, p0, p1, ...\nrepeat(elem [,n]) --> elem, elem, elem, ... endlessly or up to n times\n\nIterators terminating on the shortest input sequence:\naccumulate(p[, func]) --> p0, p0+p1, p0+p1+p2\nchain(p, q, ...) --> p0, p1, ... plast, q0, q1, ...\nchain.from_iterable([p, q, ...]) --> p0, p1, ... plast, q0, q1, ...\ncompress(data, selectors) --> (d[0] if s[0]), (d[1] if s[1]), ...\ndropwhile(pred, seq) --> seq[n], seq[n+1], starting when pred fails\ngroupby(iterable[, keyfunc]) --> sub-iterators grouped by value of keyfunc(v)\nfilterfalse(pred, seq) --> elements of seq where pred(elem) is False\nislice(seq, [start,] stop [, step]) --> elements from\n       seq[start:stop:step]\nstarmap(fun, seq) --> fun(*seq[0]), fun(*seq[1]), ...\ntee(it, n=2) --> (it1, it2 , ... itn) splits one iterator into n\ntakewhile(pred, seq) --> seq[0], seq[1], until pred fails\nzip_longest(p, q, ...) --> (p[0], q[0]), (p[1], q[1]), ...\n\nCombinatoric generators:\nproduct(p, q, ... [repeat=1]) --> cartesian product\npermutations(p[, r])\ncombinations(p, r)\ncombinations_with_replacement(p, r)\n\n-----------------\n\nEntity product (class):\n\nSignature: \nReturn: \n\nproduct(*iterables, repeat=1) --> product object\n\nCartesian product of input iterables.  Equivalent to nested for-loops.\n\nFor example, product(A, B) returns the same as:  ((x,y) for x in A for y in B).\nThe leftmost iterators are in the outermost for-loop, so the output tuples\ncycle in a manner similar to an odometer (with the rightmost element changing\non every iteration).\n\nTo compute the product of an iterable with itself, specify the number\nof repetitions with the optional repeat keyword argument. For example,\nproduct(A, repeat=4) means the same as product(A, A, A, A).\n\nproduct('ab', range(3)) --> ('a',0) ('a',1) ('a',2) ('b',0) ('b',1) ('b',2)\nproduct((0,1), (0,1), (0,1)) --> (0,0,0) (0,0,1) (0,1,0) (0,1,1) (1,0,0) ...\n\nSource: \n\n-----------------\nChildren entities:\n- __class__ (class)\n- __delattr__ (function)\n- __dir__ (function)\n- __eq__ (function)\n- __format__ (function)\n- __ge__ (function)\n- __getattribute__ (function)\n- __gt__ (function)\n- __hash__ (function)\n- __init__ (function)\n- __init_subclass__ (function)\n- __iter__ (function)\n- __le__ (function)\n- __lt__ (function)\n- __ne__ (function)\n- __new__ (function)\n- __next__ (function)\n- __reduce__ (function)\n- __reduce_ex__ (function)\n- __repr__ (function)\n- __setattr__ (function)\n- __setstate__ (function)\n- __sizeof__ (function)\n- __str__ (function)\n- __subclasshook__ (function)\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "",
    "version": "0.1.2",
    "project_urls": {
        "Homepage": "https://github.com/gkegke/ddocs"
    },
    "split_keywords": [
        "docs",
        "library",
        "offline",
        "documentation"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "db3a1072a1c0c4ca0fdad3e83a2df9fd14cd9b6bf0757ac1f938afda251fa119",
                "md5": "94e66901e44a6ce68fa5af67b3ee5b6c",
                "sha256": "a016cd843e4988b14a1a675588134e7cb3563e027b77a444af020031887ee48a"
            },
            "downloads": -1,
            "filename": "ddocs-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "94e66901e44a6ce68fa5af67b3ee5b6c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 361023,
            "upload_time": "2023-06-24T19:02:02",
            "upload_time_iso_8601": "2023-06-24T19:02:02.469110Z",
            "url": "https://files.pythonhosted.org/packages/db/3a/1072a1c0c4ca0fdad3e83a2df9fd14cd9b6bf0757ac1f938afda251fa119/ddocs-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f2f3f5b21c42a985753e67760a4b713d9c0e300727b1b7405b0537ff8a2f90aa",
                "md5": "aa4626bd6124834a5606748d41abb601",
                "sha256": "350f5e2a85385faf5a9e8efd5ad539bff1db5175f484078b0e29893ccc007e8f"
            },
            "downloads": -1,
            "filename": "ddocs-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "aa4626bd6124834a5606748d41abb601",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 363468,
            "upload_time": "2023-06-24T19:02:05",
            "upload_time_iso_8601": "2023-06-24T19:02:05.258337Z",
            "url": "https://files.pythonhosted.org/packages/f2/f3/f5b21c42a985753e67760a4b713d9c0e300727b1b7405b0537ff8a2f90aa/ddocs-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-24 19:02:05",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "gkegke",
    "github_project": "ddocs",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "ddocs"
}
        
Elapsed time: 0.08776s