how to use module from github to jupyter notebook - github

I am a new user of python and github.
I want to use, with anaconda-jupyter on windows 10, a new repository (module) published on github ( https://github.com/jamesbowman/raytrace ).
I downloaded the zip folder and extracted it in my download folder (F:\Téléchargement\raytrace-master). , but I don’t know how to use this module with jupyter .
How can I import this module into jupyter .
I tried some method but without success
Why it is not possible to copy and paste directly a folder from my download folder (F:/téléchargement/) to a jupyter notebook folder (…/source/repos/ for example ) ?
Thanks!

Try using the http copy url from the Github site and use that with
!git clone <https://github.com...> in a jupyter notebook cell
then you can do !ls to check that the repository downloaded. The exclamation points mean that you can do command line commands from your notebook!
Alternatively, you could try unzipping and moving the repo to the same directory where you are running jupyter and search for it with an !ls

Related

Running another notebook inside a notebook which is connected to git

In our company we learned to connect our notebook to git repository, however there is an issue.
Running a notebook inside another notebook. This is the way that we have discovered, however this solution cant go into production because it included an employee username in the path.
What is/are solution to solve it?
You need to use relative paths for %run command. For example:
./name for notebook in current directory
../name for notebook in parent directory
../../name for notebook in two levels higher
subdir/name for notebook in sub-directory with name subdir
You can also consider to use arbitrary files support in Repos, although it's mostly for Python & R modules.

Open and Run Python file after cloning from Github

I have made a clone of a repository of Github in Google Colab. It is done successfully and I can see the files there. After cloning when I tried to open the individual file of python I was unable to open the individual file.
Kindly guide me on how to work on individual files after creating a clone as we open them as a normal file directly from the link of GitHub in collab.
Thanks

Github local repo with VS code : Too many changes

I have install Github Enterprise on a self-managed server. I am connecting to my Github repo through VS Code. Every time I open VS code:
1 - It's trying to connect automatically to my cloud repo (Which I would like to be able to manually connect)
2 - VS code is installed in Anaconda and it's detecting 5000 changes....all anaconda files on my local machine
Can anyone help me with this issue?
thank you
I guess you have Anaconda or a conda environment installed into your project folder? Then you have to add that folder to your .gitignore file.
In VSCode you can rightclick on one of the 5000 files, select "Add to .gitignore" from the context menu, then the file .gitignore opens and you can delete everything but the top folder from the new entry and then that folder will be ignored.
Btw., VSCode doesn't update your local git repository automatically but just checks, if there are new changes in your remote repo (github) or how far it is behind your local changes. You can see that in the VSCode status bar. If you want to actually change one of the repos you either have to "pull" or "push" manually.

import github repo to colab. Imports as notebook into google drive, not a directory

Basically all that I wish to do is to run the files in a github repository in colab. Some files are ipynb and some are data that they will use. I have read many posts and I have imported the github repository but I am not doing something right.
I have started a google colab from my google drive. Then I have mounted the drive with
"from google.colab import drive
drive.mount('/content/drive')"
And, I use "!git clone [repository address].
The repository is definitely mounted and I can see the files, some of which are data and some are python notebook files, by using "!ls".
However, when I go to my google drive, I don't see this directory but I do see a colab notebook. If I click on it I am brought to the same colab notebook that I just left. I expected that in the google drive I would see a directory with the same structure as the github repository.
Ultimately, What I want to do is to be able to run the files that are ipynb from the google drive but I am not given this option. In fact, I really don't know how I can run these ipynb files.
I am almost there but missing something simple but vital.
Thank You
I figured out the problem. Evidently, the problem was that I had not descended the directory structure on my google drive enough. Just importing to "/content/drive" imports what ever github repository as a ipynb file. I descended to '/content/drive/My Drive/projects' and imported the github repository there. It was then available in google drive as a directory, complete with ipynb files and other data.

Install Jupyter Notebook extensions on copy hosted on cloned Github Repository?

I have a cloned Jupyter Notebook hosted on Github. Locally, I have installed Jupyter Notebook extensions but these are not maintained within the Github environment.
Is there a way to install the extensions on the Github server so that cells can be toggled on/off with notebook extensions? Or will I have to go with a Javascript hack as per https://gist.github.com/Zsailer/5d1f4e357c78409dd9a5a4e5c61be552?
It appears this cant' be done as per below:
When you add Jupyter Notebook or IPython Notebook files with a .ipynb extension on GitHub, they will render as static HTML files in your repository.
The interactive features of the notebook, such as custom JavaScript plots, will not work in your repository on GitHub. For an example, see Linking and Interactions.ipynb.
To view your Jupyter notebook with JavaScript content rendered or to share your notebook files with others you can use nbviewer. For an example, see Linking and Interactions.ipynb rendered on nbviewer.
from: https://help.github.com/en/articles/working-with-jupyter-notebook-files-on-github