{ "info": { "author": "Aleksandra Zalcman, Andrey Kislyuk, Anurag Biyani, Geet Duggal, Katherine Lai, Kurt Jensen, Ohad Rodeh, Phil Sung", "author_email": "expert-dev@dnanexus.com", "bugtrack_url": null, "classifiers": [ "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: MacOS :: MacOS X", "Operating System :: POSIX", "Programming Language :: Python :: 3.6", "Programming Language :: Unix Shell", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "dxpy: DNAnexus Python API\n=========================\n\n[API Documentation](http://autodoc.dnanexus.com/bindings/python/current/)\n\nBuilding\n--------\n\nFrom the dx-toolkit root directory:\n\n```\nmake python\n```\n\nDebugging\n---------\n\nSet the `_DX_DEBUG` environment variable to a positive integer before\nrunning a dxpy-based program (such as `dx`) to display the input and\noutput of each API call. Supported values are 1, 2, and 3 with\nincreasing numbers producing successively more verbose output.\n\nExample:\n\n```\n$ _DX_DEBUG=1 dx ls\n```\n\nPython coding style\n-------------------\n\n* Conform to [PEP-8](http://legacy.python.org/dev/peps/pep-0008/).\n * Relax the line length requirement to 120 characters per line, where you judge readability not to be compromised.\n * Relax other PEP-8 requirements at your discretion if it simplifies code or is needed to follow conventions\n established elsewhere at DNAnexus.\n* Document your code in a format usable by [Sphinx Autodoc](http://sphinx-doc.org/ext/autodoc.html).\n* Run `pylint -E` on your code before checking it in.\n* Do not introduce module import-time side effects.\n * Do not add module-level attributes into the API unless you are absolutely certain they will remain constants. For\n example, do not declare an attribute `dxpy.foo` (`dxpy._foo` is OK), or any other non-private variable in the\n global scope of any module. This is because unless the value is a constant, it may need to be updated by an\n initialization method, which may need to run lazily to avoid side effects at module load time. Instead, use\n accessor methods that can perform the updates at call time:\n\n ```python\n _foo = None\n\n def get_foo():\n initialize()\n return _foo\n ```\n\nOther useful resources:\n\n* [Google Python style guide](http://google.github.io/styleguide/pyguide.html)\n\nPython version compatibility\n----------------------------\n\nCode going into the Python codebase should be written in Python 3.3 style, and should be compatible with Python 3.3, 3.4,\nand 2.7. To facilitate Python 2 compatibility, we have the compat module in https://github.com/dnanexus/dx-toolkit/blob/master/src/python/dxpy/compat.py. Also, the following boilerplate should be\ninserted into all Python source files:\n\n```\nfrom __future__ import absolute_import, division, print_function, unicode_literals\n```\n\n- `dxpy.compat` has some simple shims that mirror Python 3.3 builtins and redirect them to Python 2.7 equivalents when on 2.7. Most critically, `from dxpy.compat import str` will import the `unicode` builtin on 2.7 and the `str` builtin on 3.3. Use `str` wherever you would have used `unicode`. To convert unicode strings to bytes, use `.encode('utf-8')`.\n- Use `from __future__ import print_function` and use print as a function. Instead of `print >>sys.stderr`, write `print(..., file=sys.stderr)`.\n- The next most troublesome gotcha after the bytes/unicode conversions is that many iterables operators return generators in Python 3. For example, `map()` returns a generator. This breaks places that expect a list, and requires either explicit casting with `list()`, or the use of list comprehensions (usually preferred).\n- Instead of `raw_input`, use `from dxpy.compat import input`.\n- Instead of `.iteritems()`, use `.items()`. If this is a performance concern on 2.7, introduce a shim in compat.py.\n- Instead of `StringIO.StringIO`, use `from dxpy.compat import BytesIO` (which is StringIO on 2.7).\n- Instead of `.next()`, use `next()`.\n- Instead of `x.has_key(y)`, use `y in x`.\n- Instead of `sort(x, cmp=lambda x, y: ...)`, use `x=sorted(x, key=lambda x: ...)`.\n\nOther useful resources:\n* [The Hitchhiker\u2019s Guide to Python](http://docs.python-guide.org/en/latest/index.html)\n* http://lucumr.pocoo.org/2013/5/21/porting-to-python-3-redux/\n\nConvention for Python scripts that are also modules\n---------------------------------------------------\n\nSome scripts, such as format converters, are useful both as standalone executables and as importable modules.\n\nWe have the following convention for these scripts:\n* Install the script into ```src/python/dxpy/scripts``` with a name like ```dx_useful_script.py```. This will allow\n importing with ```import dxpy.scripts.dx_useful_script```.\n* Include in the script a top-level function called ```main()```, which should be the entry point processor, and\n conclude the script with the following stanza:\n\n ```python\n if __name__ == '__main__':\n main()\n ```\n\n* The dxpy installation process (invoked through ```setup.py``` or with ```make -C src python``` at the top level)\n will find the script and install a launcher for it into the executable path automatically. This is done using the\n ```entry_points``` facility of setuptools/distribute.\n\n * Note: the install script will replace underscores in the name of your module with dashes in the name of the launcher\n script.\n\n* Typically, when called on the command line, *main()* will first parse the command line arguments (sys.argv). However,\n when imported as a module, the arguments need to instead be passed as inputs to a function. The following is a\n suggestion for how to accommodate both styles simultaneously with just one entry point (```main```):\n\n ```python\n def main(**kwargs):\n if len(kwargs) == 0:\n kwargs = vars(arg_parser.parse_args(sys.argv[1:]))\n ...\n\n if __name__ == '__main__':\n main()\n ```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/dnanexus/dx-toolkit", "keywords": "", "license": "Apache Software License", "maintainer": "", "maintainer_email": "", "name": "dxpy3", "package_url": "https://pypi.org/project/dxpy3/", "platform": "", "project_url": "https://pypi.org/project/dxpy3/", "project_urls": { "Homepage": "https://github.com/dnanexus/dx-toolkit" }, "release_url": "https://pypi.org/project/dxpy3/0.265.0/", "requires_dist": [ "argcomplete (>=1.9.4)", "websocket-client (==0.53.0)", "python-dateutil (>=2.5)", "python-magic (==0.4.6)", "beautifulsoup4 (==4.4.1)", "psutil (>=3.3.0)", "requests (>=2.8.0)", "cryptography (<=2.2.2)" ], "requires_python": "", "summary": "DNAnexus Platform API bindings for Python3", "version": "0.265.0" }, "last_serial": 4407654, "releases": { "0.265.0": [ { "comment_text": "", "digests": { "md5": "db7c0b5cebe95a1578d89488ded7f57d", "sha256": "bf5249771c8a54f2abea4bc5a33b2939d8332bbdce649f904fcfedad0c983194" }, "downloads": -1, "filename": "dxpy3-0.265.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "db7c0b5cebe95a1578d89488ded7f57d", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 414262, "upload_time": "2018-10-23T18:55:47", "url": "https://files.pythonhosted.org/packages/ea/c4/1a97736f8f48aee96746cc4ee165f4eaf23891e04513c4f16273b264e733/dxpy3-0.265.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "855584fa80f516d24e401f90ac8e8522", "sha256": "c773a4809cd31530b252461efc608e6603d4194ba1923620d67039004a17f646" }, "downloads": -1, "filename": "dxpy3-0.265.0.tar.gz", "has_sig": true, "md5_digest": "855584fa80f516d24e401f90ac8e8522", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 466696, "upload_time": "2018-10-23T18:55:49", "url": "https://files.pythonhosted.org/packages/5f/37/22f66106448b726891881b26232084e64d4a8decd20cf6d61358090aec4a/dxpy3-0.265.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "db7c0b5cebe95a1578d89488ded7f57d", "sha256": "bf5249771c8a54f2abea4bc5a33b2939d8332bbdce649f904fcfedad0c983194" }, "downloads": -1, "filename": "dxpy3-0.265.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "db7c0b5cebe95a1578d89488ded7f57d", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 414262, "upload_time": "2018-10-23T18:55:47", "url": "https://files.pythonhosted.org/packages/ea/c4/1a97736f8f48aee96746cc4ee165f4eaf23891e04513c4f16273b264e733/dxpy3-0.265.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "855584fa80f516d24e401f90ac8e8522", "sha256": "c773a4809cd31530b252461efc608e6603d4194ba1923620d67039004a17f646" }, "downloads": -1, "filename": "dxpy3-0.265.0.tar.gz", "has_sig": true, "md5_digest": "855584fa80f516d24e401f90ac8e8522", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 466696, "upload_time": "2018-10-23T18:55:49", "url": "https://files.pythonhosted.org/packages/5f/37/22f66106448b726891881b26232084e64d4a8decd20cf6d61358090aec4a/dxpy3-0.265.0.tar.gz" } ] }