I wanted to share my python program to my friends but the problem is they will have to install python first then all the libraries which I used in order to run my program and it might be hard to do so as I have used too many libraries like 15-20 something.
MY Questions:-
Q1. How can I share my python program without making them install so much stuff?
Q2. Is there any other language on which it could be done?
Thank you.
Regards
Google Colab
You can write your python program in Google Colab and then share the notebook with others to run.
It's free to use and your dependencies can be imported or installed based on the information from this stackoverflow post.
Streamlit
Streamlit allows you to build custom web apps using python that are shareable. It's marketed use is for data science and machine learning python projects. You should check their website to see if it satisfies your specific needs.
repl.it
On the website repl.it you can create public Python projects which can even include PyPI dependencies. The user can then run and edit them, for example here: https://replit.com/#TedTaras/Monster-Hunter. Projects are public by default, private ones cost extra.
Related
Over the past few weeks I've been coding a program which runs a reddit bot locally from my machine. I've perfected it such that it does not reply to the same comment which it has replied to before, it runs quite efficiently, and in my opinion is complete.
Now, I'm looking for a way to get the program to run on a schedule. I currently have the code in google colab, and I don't know how to use google colab for this functionality.
The program does not require any local storage, it's one code file, and does not require much memory, so I wanted to ask if anyone has a resource which has an detailed tutorial accessible for beginners which I could use to host this code
Note: The code requires an installation of PRAW, in google colab I simply do !pip install PRAW if that means anything differently for what I need to do, what should I do differently?
Thank you in advance.
Google Collab is not designed for this kind of things, and most likely it cannot be used to run your app on schedule.
Probably the easiest solution is some kind of Continuous Integration tool that lets you run code remotely.
Step 1 would be to host your code to some remote code repository like GitHub. Since it most likely won't have to be interactive switching from Collab notebook to simple Python script will make your config much easier later on.
Step 2 would be connecting that repo to some CI tool. One I am familiar with that lets you run pipelines on schedule is CircleCI, with this tutorial here showing very simplistic configuration for running Python scripts from a pipeline.
I've made a simple python GUI application using ipywidgets, ipycanvas, and numpy. I made the program on Jupyter notebook as an ipynb file. I would now like to take my application and put it on a webpage. What is the best way to take this Jupyter notebook app and host it on the web?
I've looked a bit into Binder and Django, but I can't seem to find enough resources or documentation on the net to help me learn how to do this.
If you already have it working as a Jupyter notebook (.ipynb file), I'd suggest that sticking with that as the core item for now. I'd suggest getting running via MyBinder.org based on either this example repo or this one. Or a combination of the two.
This video is recent and a good reference for many of the steps of setting up a repo with your content.
You essentially make a copy of the Binder templates under your control and then edit them to have your content. You adapt the URLs that trigger launches so that when you share the link, they launch a session via MyBInder.org with your content. Most often the steps can be performed right in the Github browser-based interface without you needing to use git or work locally. If you have something fancier you need, you may have to move to using more complex configuration file set-ups and those may necessitate some use of git and local editing.
If you hit some technical road blocks, post your questions here using the 'questions' category as suggested in this post about 'Debugging your Binder'.
Maybe once the basics of sharing the notebook or appmode version are working with your own content, you may want to check out Voila or some of the other ways you can share a jupyter notebook-based app discussed here.
Jupyter itself is made with Tornado web framework.
There are many bindings to another popular web frameworks.
I once tried on it, and I found that pyramid-notebook is easy to use.
For a quick build I recommend Binder. This is how you can quickly set up Binder with voila:
Checkout this Git Repo: https://github.com/lschmiddey/book_recommender_voila
In combination with this blogpost: https://lschmiddey.github.io/fastpages_/2020/09/28/Build-binder-app-Part4.html
A friend of mine and me are doing some field research for our Physics degree. And we are using jupyter notebook to analyse the data we get. We usually sit together working at two different copies of the same file that in the end will be drag and dropped together using jupyter lab. This is obviously not ideal, so i thought is there any way for just two people to work on one document in Jupyter, sadly Google Colab has been Deprecated and CoCalc is expensive. So i thought id ask here if there is a way to make one person run a Jupyter notebook and the other one just being able to access it over peer to peer aswell so we could write in the same file at the same time.
Do you guys know something that makes me do this maybe a workaround that i can do.
Thanks for answers in advance
CoCalc is expensive.
Fortunately, we also provide a complete free easy to install open source version of CoCalc, which you can run on any computer that supports Docker. For example, here's how to run it on Google cloud.
(I have put too many years of my life into making realtiime collaboration work for Jupyter via CoCalc... In any case, the open source code has been battle tested in production for a while now and is working well finally. I hope it can solve your problem...)
You can upload your notebook to Deepnote. It provides a hosted environment, where you and your colleague can connect at the same time and work on the same notebook in real-time (the same way you'd do in Google Docs).
Colab is also good, but writing at the same time will result in conflicts.
Notebook itself doesn't support to collaborate simultaneously, but you can use GitHub to manage your python script and upload it into Colab separately. This way Github can help manage the file history and solve the conflicts.
JupyterLab 3.1.0a7 introduced real time collaboration.
There is a screencast showing it in action.
Key thing to note is the new top-level menu item called Share, to the right of Settings & Help.
You can click on launch binder here or here to try it now.
"Once you see the JupyterLab interface, there's a new top-level menu item called "Share"; click that, grab and share that URL, and you're done!"-SOURCE: Step #5 here
There's a gist here that seems to be updated regularly with how to activate the feature.
There's a detailed walk-through here if you want to add the ability into your own repositories that can launch via MyBinder.org. Although if that repo falls behind the gist, you'll probably want to consult the gist for the current best practices once you have the idea from the detailed walk-through.
Closely related question with an answer by #krassowski, is here. You may want to look there for some additional details.
While you can use github for this it can get messy, many people clear output cells when committing to git to avoid conflict issues. Which would defeat the object of your review work.
You should try Curvenote (which we're building for that reason) it doesn't offer compute as its a collaborative writing tool, works on top of Jupyter via a chrome extenson and gives you real time versioning, commenting and diffs.
Google Colab has been Deprecated and CoCalc is expensive
Noteable.io is 100% free for all users including storage, compute, RAM. For your purposes, it will be ideal as you will get Google Drive like collaboration (commenting, #mentioning, Annotating data points), versioning, sharing, interactive visualizations, choice of using Python and SQL in the same notebook and a ton of other features.
Here are good example notebooks on Noteable:
Climate Change: An analysis of Dew Point for the city of Toronto
Healthcare Sector Employee Attrition Exploratory Data Analysis
Exploratory Data Analysis Using SQL and Python - Online Retailer Orders
I inherited an appengine coursebuilder project a couple months ago, and we've been trying to upgrade to a more recent version of coursebuilder. In order to do this, the first step is to download local version of the course.
Whenever I run appcfg.py download_app -A $projectID -V $versionNumber ./folderToSaveTo
It downloads a different version of the course, one that looks like an old test version with old placeholder text, all links to lessons set to private, etc.
When I look at the versions of the course in the appengine dashboard, there is only a single version, so I'm not sure what it's even downloading.
Alternatively, it was suggested I use the ETL tool provided with coursebuilder to download the files instead, but that had a bunch of other issues associated with it as well. Previously I had asked the question directly on the coursebuilder forum where the ETL tool was initially suggested.
Thanks in advance for any help,
-Tyler Nolan
appcfg's download_app will only look within the default module. You should check if there are any drop-downs in the Developers Console UI which will allow you to look into whether there are other modules.
gcloud preview app modules download on the other hand, does allow you to specify modules.
Hopefully this helps you find the "real version" of your app.
It's also possible that what you download is displaying default data because it's not being viewed in a manner which is properly connected to the database, so it falls back to look like that.
I am starting on developing a django application on a shared webhosting server(alwaysdata.com).
I would like to understand what are the packaing options available to package a django application (preferably in compiled form)
I would like to setup the source code repository on my system and build using the python packaging and deploy the package on alwaysdata.com.
I would like the option of not having to share the source code on alwaysdata.com.
Looking at pip , I am not able to find this option.
EDIT
A few more clarification: I would need the ability to not share the sourcecode since it contains the "API secret key" which I would not want to compromise. The more I look into it , the more i believe that there is no way for me to distribute binary only distribution.
I've found fabric to be a pretty nice tool for deploying Django projects. To compile your python code you can use compileall:
python -m compileall <dir>
How is this API key used? Is it a google maps api? Is it provided in scripts that go to the browser? If so, it's already out in the open, anyone using your site will see it, so you're trying to provide a $100 lock for a $0.01 piece of information. If it's a google maps api, it's not secured by keeping it hidden, but rather it's tied to a domain/directory (IIRC).
Can you share a little more what the API key is and is for, then maybe we can help you find a better solution to keep it secure.
Do you think you have to share your source code if you host your application on a 'shared hosting' provider? That's not the case. Your source code should still be private to you but the administrators of your hosting provider can get it too. Other normal Joe Users of the service shouldn't have access to your source code, or your database too. If they do, then get another shared hosting provider!