{ "info": { "author": "Layne Sadler", "author_email": "layne.sadler@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "---\n# GORpyter\n\n1. Python package (with pandas serialization) that wraps the R SDK of the GOR Query API.\n2. Docker image for JupyterLab (Python & R kernels) with both the Python & R SDK dependencies installed.\n\n* `gp.query()` converts the R tibble dataframe into a pandas dataframe on the fly.\n* rpy2 package is used to wrap the gorr R library functions in Python.\n* Jupyter R kernel has tidyverse (tricky install) and gorr (non-CRAN) packages installed.\n* Docker image also includes OpenJDK 1.8 in case users want to install Spark.\n\n\n##### TLDR \n```\n$ docker pull hashrocketsyntax/gorpyter:augustus\n$ docker run -it -p 8888:8888 hashrocketsyntax/gorpyter:augustus\n```\nRead the rest of the documentation for complete setup & usage.\n\n---\n\n# 1. Docker Environment\n##### LOCAL NOTEBOOK FOLDER\nCreate a folder on your local machine's desktop where you will store your notebooks. Keep the output of `pwd` handy as we will use it with the `volumes` yml key below. You can name the folder whatever you like. We'll call it 'notebooks'\n```\n$ cd ~/Desktop\n$ mkdir notebooks\n$ cd notebooks\n$ pwd\n''\n```\n\n##### DOCKER HARDWARE RESOURCES\nIn order to convert large (1M rows) R dataframes to Pandas dataframes, your Docker environment may need access to more memory. The `memory` is the most important setting below.\n\n* Stop any running containers.\n* Click on Docker icon in system tray.\n* Navigate to 'Preferences.'\n* Click the 'Resources' or 'Advanced' tab depending on your version of Docker.\n* Set the resources to the following:\n* Click 'Apply & Restart'\n\n```\nCPU: \nMemory: \nSwap: \nDisk Image Size: \n```\n\n##### DOCKER IMAGE & MANIFEST\nPull in this pre-built image which contains a Jupyter environment equipped with R and Python 3.7 kernels as well as the GORpyter dependencies. It's built on top of Jupyter's latest DockerHub image `jupyter/datascience-notebook:2ce7c06a61a1`. If you want to customize this image your self, see Section 3.\n```\n$ docker pull hashrocketsyntax/gorpyter:augustus\n```\nCreate a file named `docker-compose.yml` and open it with a text editor (nano or SublimeText). \n```\n$ touch docker-compose.yml\n$ nano docker-compose.yml\n```\nPaste the text below into that file. Under the `volumes` key, paste in the output of `pwd` from above.\n```\n#docker-compose.yml\nversion: \"3\"\nservices:\n jupyter:\n image: \"hashrocketsyntax/gorpyter:augustus\"\n ports:\n - \"8888:8888\"\n volumes:\n - :/usr/local/share/man/user_notebooks\n```\nMake sure you are in the same directory as the .yml file and run it like so.\n```\n$ docker-compose up\n```\nFrom the console output, grab the URL that looks like this `http://127.0.0.1:8888/?token=` and paste it into a browser.\n\n---\n\n# 2. JupyterLab Notebooks\n##### TUTORIAL NOTEBOOKS\nThe Docker environment comes with example notebooks for both the Python and R SDK.\n\nIf you are running these notebook in the pre-built Docker environment, know that only files in the `user_notebooks` folder will be saved/ persisted. In fact, you won't be able to add/remove/copy/delete/save-changes to files outside of the `user_notebooks` directory.\n\n```\n#python_sdk_gorpyter.ipynb\n\n\npip install gorpyter --upgrade\nimport gorpyter as gp\n\n\ngp.setup()\n\"\"\"\n CHECKLIST\n =============================================\n\n\t\u2713 -- The version of your Jupyter Python environment is '3.7.3'.\n\t\u2713 -- The path of the Jupyter R enviroment being accessed by `rpy2` is '/opt/conda/lib/R'.\n\n\t\u2713 -- The Python dependencies of `gorpyter` are installed.\n\t\u2713 -- The `tidyverse` R library is installed in your R environment.\n\t\u2713 -- The `gorr` R library is installed in your R environment.\n\t\u2713 -- Python was able to successfully load `gorr` as a module via `rpy2`.\n\n =============================================\n\"\"\"\n\n\napi_key = \"\"\nproject = \"\"\nconn = gp.connect(api_key, project)\n\n\ngp.query(\"\", conn)\n\"\"\"\n\tnor example -- \"nor ./\"\n\tgor example -- \"gor -p chr10 #dbsnp# | TOP 100\"\n\n\tTested successfully on a 1,000,000 row result.\n\n\tDespite being run in Python, interupting the client's execution \n of this function in `ctrl+c` manner is surprisingly still gracefully \n intercepted by the gorr R library, and thus the server-side \n execution of the query is simultaneously cleaned up.\n\"\"\"\n```\n##### PYTHON PACKAGE\n```\npip install gorpyter --upgrade\n```\n* `conda install` will *not* work as this package has not been published to conda-forge.\n* Latest version number can be seen here `https://pypi.org/project/gorpyter`, as compared to output of `pip show gorpyter`.\n* Installing gorpyter will also install these dependencies: rpy2>=3.0.5, tzlocal>=2.0.0, pandas>=0.25.0, numpy>=1.17.0.\n\n##### GOR QUERY LANGUAGE\n> http://docs.wuxinextcode.com/gor/basicGORqueries.html\n\n---\n\n# 3. Optional -- Customizing the Docker Image\nIn order to create your own Docker image based on `jupyter/datascience-notebook:latest`, follow these instructions.\n\nWith these files in the same directory:\n* Dockerfile\n* python_sdk.ipynb\n* r_sdk.ipynb\n\nRun `docker build -t your-image-name:your-new-tag .` from within that directory.\n\nHere are the commands contained in the Dockerfile.\n```\n#Dockerfile\nFROM jupyter/datascience-notebook:latest\nMAINTAINER layne sadler \n\n\n# ====== PRE SUDO ======\nENV JUPYTER_ENABLE_LAB=yes\n\n# If you run pip as sudo it continually prints errors.\n# Tidyverse is already installed, and installing gorpyter installs the correct versions of other Python dependencies.\nRUN pip install gorpyter\nRUN Rscript -e \"install.packages('https://cdn.nextcode.com/public/libraries/gorr_0.2.5.tar.gz', repos = NULL, type = 'source')\"\nENV R_HOME=/opt/conda/lib/R\n\n# https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s09.html\n# Looks like /usr/local/man is symlinking all R/W toward /usr/local/share/man instead\nCOPY python_sdk.ipynb /usr/local/share/man\nCOPY r_sdk.ipynb /usr/local/share/man\nENV NOTEBOOK_DIR=/usr/local/share/man\nWORKDIR /usr/local/share/man\n\n\n# ====== SUDO ======\nUSER root\n\n# Spark requires Java 8.\nRUN sudo apt-get update && sudo apt-get install openjdk-8-jdk -y\nENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java\n\n# If you COPY files into the same VOLUME that you mount in docker-compose.yml, then those files will disappear at runtime.\n# `user_notebooks/` is the folder that gets mapped as a VOLUME to the user's local folder during runtime.\nRUN mkdir /usr/local/share/man/user_notebooks\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://pypi.org/project/gorpyter/", "keywords": "", "license": "WXNC", "maintainer": "", "maintainer_email": "", "name": "gorpyter", "package_url": "https://pypi.org/project/gorpyter/", "platform": "", "project_url": "https://pypi.org/project/gorpyter/", "project_urls": { "Homepage": "https://pypi.org/project/gorpyter/" }, "release_url": "https://pypi.org/project/gorpyter/0.6.6/", "requires_dist": [ "rpy2 (>=3.0.5)", "tzlocal (>=2.0.0)", "pandas (>=0.25.0)", "numpy (>=1.17.0)" ], "requires_python": "", "summary": "Python wrapper for GOR's R SDK with Pandas serialization.", "version": "0.6.6" }, "last_serial": 5720768, "releases": { "0.6.0": [ { "comment_text": "", "digests": { "md5": "ecb4e15b528c0f014d0655bf0f950cd4", "sha256": "4056643e37b238d11f5929fc1457a6c78b1c81d92d165b397ab34a46a306ca95" }, "downloads": -1, "filename": "gorpyter-0.6.0-py3-none-any.whl", "has_sig": false, "md5_digest": "ecb4e15b528c0f014d0655bf0f950cd4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5914, "upload_time": "2019-08-22T14:37:16", "url": "https://files.pythonhosted.org/packages/59/0e/74e75a415889e0b9e782a61c85ff16f10697c91b489bbf3d78f238d0df1a/gorpyter-0.6.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2be3de217281569bae381a2cff2431bb", "sha256": "17a40e98adc5053b1afd2dd3ca8aa17bb10540759dec192b7eecdf794f6769f8" }, "downloads": -1, "filename": "gorpyter-0.6.0.tar.gz", "has_sig": false, "md5_digest": "2be3de217281569bae381a2cff2431bb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5832, "upload_time": "2019-08-22T14:37:17", "url": "https://files.pythonhosted.org/packages/2c/65/cb17fdea4dcadf1e7e6723191bed0a71eaf0cff8376d49d55437cd8081ff/gorpyter-0.6.0.tar.gz" } ], "0.6.1": [ { "comment_text": "", "digests": { "md5": "da204f1a9f7347081a8d784bb482841a", "sha256": "d10845fedd03a153f0a6a841f457a9c9732ef58d68b32a48d52da81070e16ee6" }, "downloads": -1, "filename": "gorpyter-0.6.1-py3-none-any.whl", "has_sig": false, "md5_digest": "da204f1a9f7347081a8d784bb482841a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5949, "upload_time": "2019-08-22T16:37:29", "url": "https://files.pythonhosted.org/packages/1c/f8/651c03d7ca87502674d23d0131dd194b9c01711f868d7227164c4ada2e4b/gorpyter-0.6.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "904c4ecf7b2dddc17c312026b3ba38ab", "sha256": "854751e4b68605bf7cd16b8ba9ee877dd9bd81b0146d03a03274fc700b5a2bfd" }, "downloads": -1, "filename": "gorpyter-0.6.1.tar.gz", "has_sig": false, "md5_digest": "904c4ecf7b2dddc17c312026b3ba38ab", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5864, "upload_time": "2019-08-22T16:37:30", "url": "https://files.pythonhosted.org/packages/df/8f/7554abcf76a3e5834ab138d40db28037745d3648340011f4e3a225bddee1/gorpyter-0.6.1.tar.gz" } ], "0.6.2": [ { "comment_text": "", "digests": { "md5": "45919698a3de12fe0169da3ee2d472cb", "sha256": "d40a235f8c49ad36a80c18e7d482502cbd63a989c1cbb47bec1a740f36cc5b40" }, "downloads": -1, "filename": "gorpyter-0.6.2-py3-none-any.whl", "has_sig": false, "md5_digest": "45919698a3de12fe0169da3ee2d472cb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5950, "upload_time": "2019-08-22T22:15:01", "url": "https://files.pythonhosted.org/packages/cd/82/a7fce2a188f1c3e3b0cb65857fe8c6315b8a49c9630959b567801a21375d/gorpyter-0.6.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "17cd755ef6937fb9256d89c8c3603f5d", "sha256": "e398a880fbb51cabc34de1ddbcd28d90753a508686bd49c7627a915ac027d42d" }, "downloads": -1, "filename": "gorpyter-0.6.2.tar.gz", "has_sig": false, "md5_digest": "17cd755ef6937fb9256d89c8c3603f5d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5873, "upload_time": "2019-08-22T22:15:03", "url": "https://files.pythonhosted.org/packages/70/0f/ee912dc4abd67a810cb42415d4bb7718dccdb7f5f612378e5753ad9e27b6/gorpyter-0.6.2.tar.gz" } ], "0.6.4": [ { "comment_text": "", "digests": { "md5": "14b2cfc8483da57dcb8ebd8281221b11", "sha256": "55d2c8aadd9e0659a828cdc76ba500f6235181a83718281ed389b210262a78a3" }, "downloads": -1, "filename": "gorpyter-0.6.4-py3-none-any.whl", "has_sig": false, "md5_digest": "14b2cfc8483da57dcb8ebd8281221b11", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5999, "upload_time": "2019-08-22T22:25:07", "url": "https://files.pythonhosted.org/packages/48/86/86d158f55551c12ecf7dd86398f513bde2834bb6789d6d66a8887d8b81ac/gorpyter-0.6.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4106f8b444f4f9cd933c6edc5d5461c7", "sha256": "af74e885e69dc45c556aeb7ff29d0adca33b3e82d81c9ee37dd9bffb017bf309" }, "downloads": -1, "filename": "gorpyter-0.6.4.tar.gz", "has_sig": false, "md5_digest": "4106f8b444f4f9cd933c6edc5d5461c7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5924, "upload_time": "2019-08-22T22:25:09", "url": "https://files.pythonhosted.org/packages/77/49/193881106609c0cdacdb37a0ce0d6df17471b48e85fa531512b2f6037845/gorpyter-0.6.4.tar.gz" } ], "0.6.5": [ { "comment_text": "", "digests": { "md5": "01e7fe859c6cfc07ef319eacbe929abc", "sha256": "810c8c69b0731d054dd419ece6c890a7f837ecbbe63533e8ad458adb87af2c09" }, "downloads": -1, "filename": "gorpyter-0.6.5-py3-none-any.whl", "has_sig": false, "md5_digest": "01e7fe859c6cfc07ef319eacbe929abc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5998, "upload_time": "2019-08-22T22:32:58", "url": "https://files.pythonhosted.org/packages/ae/aa/733afe395454f157dd8caafc6595148b13b812b2f315887699009980dd09/gorpyter-0.6.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "81b1791827ef8ee8a4903e203fcb8ae4", "sha256": "6a3455282c4e882039673e149c902f505e9fc4707cdf2900bc4181958a8195fa" }, "downloads": -1, "filename": "gorpyter-0.6.5.tar.gz", "has_sig": false, "md5_digest": "81b1791827ef8ee8a4903e203fcb8ae4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5919, "upload_time": "2019-08-22T22:32:59", "url": "https://files.pythonhosted.org/packages/7c/b1/d60b26539be9bc1501cb7c7930c31aaadcdaf1747c11bc8d347ad0d1adfa/gorpyter-0.6.5.tar.gz" } ], "0.6.6": [ { "comment_text": "", "digests": { "md5": "13e4edbfd06e095f6a723290ab09c6a9", "sha256": "4fef891ce5bed1cfe64411b13824dfe24c0f06630fc8e10618bc4747e2e177c8" }, "downloads": -1, "filename": "gorpyter-0.6.6-py3-none-any.whl", "has_sig": false, "md5_digest": "13e4edbfd06e095f6a723290ab09c6a9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6314, "upload_time": "2019-08-23T13:27:03", "url": "https://files.pythonhosted.org/packages/51/3c/f628395d3276b939cb25165db4608bebf5ac215a8511929457ff67d4a87c/gorpyter-0.6.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "736335071169608af1e10385244a935c", "sha256": "72e03afda38cd245bd6593f3580d842c4732e8fd664f981bd69b82ecb7b39701" }, "downloads": -1, "filename": "gorpyter-0.6.6.tar.gz", "has_sig": false, "md5_digest": "736335071169608af1e10385244a935c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6340, "upload_time": "2019-08-23T13:27:04", "url": "https://files.pythonhosted.org/packages/29/5c/eff368f63108218de5558d462b5a6d2db22117e5b6c60f313ddc45c737ac/gorpyter-0.6.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "13e4edbfd06e095f6a723290ab09c6a9", "sha256": "4fef891ce5bed1cfe64411b13824dfe24c0f06630fc8e10618bc4747e2e177c8" }, "downloads": -1, "filename": "gorpyter-0.6.6-py3-none-any.whl", "has_sig": false, "md5_digest": "13e4edbfd06e095f6a723290ab09c6a9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6314, "upload_time": "2019-08-23T13:27:03", "url": "https://files.pythonhosted.org/packages/51/3c/f628395d3276b939cb25165db4608bebf5ac215a8511929457ff67d4a87c/gorpyter-0.6.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "736335071169608af1e10385244a935c", "sha256": "72e03afda38cd245bd6593f3580d842c4732e8fd664f981bd69b82ecb7b39701" }, "downloads": -1, "filename": "gorpyter-0.6.6.tar.gz", "has_sig": false, "md5_digest": "736335071169608af1e10385244a935c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6340, "upload_time": "2019-08-23T13:27:04", "url": "https://files.pythonhosted.org/packages/29/5c/eff368f63108218de5558d462b5a6d2db22117e5b6c60f313ddc45c737ac/gorpyter-0.6.6.tar.gz" } ] }