{ "info": { "author": "Dalen Bernaca", "author_email": "dbernaca@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License (GPL)", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.5", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "This module provides a built-in help() function support for Python ctypes bindings.\n\nCopyright (C) 2018 by Dalen Bernaca\n\nhelp_support enables you to use help() on modules containing functions from\nctypes linked libraries.\nIt uses pydoc and it is based on it and tries to emulate the original help() function as much as possible,\nbut I took some liberties to change the output a little.\nSubmodules are not shown and the order of presentation is slightly different.\n\nFeatures it shows (in presented order) are:\n NAME\n FILE\n [MODULE DOCS]\n [DESCRIPTION]\n [CTYPES FUNCTIONS]\n [CTYPES STRUCTURES]\n [PYTHON FUNCTIONS]\n [PYTHON CLASSES]\n [DATA]\n [VERSION]\n [DATE]\n [AUTHOR]\n [CREDITS]\n\nHow does it work?\n\nIt substitutes __builtin__.help() with a new\n_Helper() object that will always call original help() except in cases where\npresented object is a module containing ctypes._CFuncPtr i.e. the ctypes function(s) and/or ctypes structure(s)\nor the object is one of the listed itself.\nAll variables containing some other ctypes types are recognized as DATA.\n\nIn order for the module to show the output that makes sense your ctypes functions should have\nthe \"__doc__\" attribute added with the __doc__ string and properly configured attributes \"argtypes\" and \"restype\".\n\nAn extra, help_support specific, \"argnames\" attribute can be added to your ctypes function to improve the representation of the function's arguments.\nIt is a list containing strings with names of each argument in a row.\nIf \"argnames\" is properly specified then help() will show a defined name along with the argument's type.\n\n* Note that defining \"argnames\" will not have inpact on the function itself.\n It is only used by help_support to make the help() more descriptive and remind\n developers what goes where when the function is called.\n\nStructures can also have a \"__doc__\" string and they should have the \"_fields\"_ attribute.\n\nWhen you are making a ctypes Python bindings, just include the\nhelp_support in your package and keep good documentation\nof each function pulled from the DLL/DYLIB/SO and declared structures.\n\nExample:\n # examp_module:\n import ctypes\n import ctypes.util\n\n import help_support\n del help_support # If you want you can remove it now\n # to avoid cluttering your globals() namespace.\n # Once it is called you do not usually need it any more.\n\n l = ctypes.CDLL(ctypes.util.find_library(\"c\"))\n\n # Pull the time() function from libc,\n # declare and document it:\n time = l.time\n time.argtypes = []\n #time.argnames = [\"c_void\"] # The function takes no arguments, but you can trick help_support \n # to show something in parenthesis if you want to be consistent with C\n # If there is/are argument(s) you should put its/their name(s) in \"argnames\".\n time.restype = ctypes.c_int\n time.__doc__ = \"Function that returns a system time in seconds.\"\n -------------------------------------------\n >>> # Usage:\n >>> import examp_module\n >>> help(examp_module)\n >>> help(examp_module.time)\n >>>\n\nThe usage is simple.\nJust pack it into your ctypes bindings and import it in every module containing ctypes functions and/or structures.\nUsers of your package will hardly notice that help() was changed a little and they will be glad it did anyway\nbecause they will be able to use it on your bindings and thus\nspeed up their development.\n\nThe module is not very extensively tested and still may have bugs in getting the documentation,\npresenting a proper ctypes type names and help's formatting in general.\n\nThe module was tested for Python 2.5, 2.6 and 2.7 on the following platforms:\nUbuntu 16.04, Windows XP and Cygwin.", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "help,ctypes,functions,structures,shared object,dynamic linked library,dylib,so,dll", "license": "GPL", "maintainer": "", "maintainer_email": "", "name": "help-support", "package_url": "https://pypi.org/project/help-support/", "platform": "", "project_url": "https://pypi.org/project/help-support/", "project_urls": null, "release_url": "https://pypi.org/project/help-support/0.2/", "requires_dist": null, "requires_python": "", "summary": "Python built-in help() function support for linked ctypes functions and structures.", "version": "0.2" }, "last_serial": 4087551, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "a77452d9a7a8caa5b41daabe8d2b112d", "sha256": "93c41569655f6a084906b442238d605202f86fd54e7e856b604d87d83abf04a8" }, "downloads": -1, "filename": "help_support-0.2.zip", "has_sig": false, "md5_digest": "a77452d9a7a8caa5b41daabe8d2b112d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10821, "upload_time": "2018-07-21T00:31:41", "url": "https://files.pythonhosted.org/packages/55/a9/8338f17156a3aebe6fbff0dc5a60d9a935a193c4302e53a7f918a87b70dc/help_support-0.2.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a77452d9a7a8caa5b41daabe8d2b112d", "sha256": "93c41569655f6a084906b442238d605202f86fd54e7e856b604d87d83abf04a8" }, "downloads": -1, "filename": "help_support-0.2.zip", "has_sig": false, "md5_digest": "a77452d9a7a8caa5b41daabe8d2b112d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10821, "upload_time": "2018-07-21T00:31:41", "url": "https://files.pythonhosted.org/packages/55/a9/8338f17156a3aebe6fbff0dc5a60d9a935a193c4302e53a7f918a87b70dc/help_support-0.2.zip" } ] }