How to setup PyCharm to develop AWS Lambda function on local machine? - python

I am looking forward to developing some AWS lambda functions in python using PyCharm. How can I setup my IDE to develop and test the function locally? Can experts guide how to set it up? Any links or relevant tutorials will be really helpful.

As of the announcement at the re:Invent 2018 keynote, Jetbrains now offers the AWS Toolkit which allows local and remote development of Lambda functions.
Despite some lingering issues it works quite well.
User exan has provided the link on AWS' site here
There is also a blog post when using PyCharm on MacOS
Toolkit page on Jetbrains website
UPDATE April 2019: Jetbrains has been very responsive and active in fixing any issues. Issues with credentials and templates seem resolved and it's quite a joy to work with.

Directly go through the page->
https://medium.com/#bezdelev/how-to-test-a-python-aws-lambda-function-locally-with-pycharm-run-configurations-6de8efc4b206
pip install python-lambda-local
python-lambda-local -f lambda_handler lambda_function.py event.json

Related

Github actions using locally licensed package

I'm trying to setup a CI-pipeline using Github Actions for my Python scripts, but these scripts make use of a package that is not publically available and it requires a local license. Because of this, I cannot use it in Github Actions. I also haven't found a way to run the Github Actions locally using the local package (local Github pipelines often try to download requirements from the internet). Does anyone have a solution for this? Is there perhaps a way to do this in VS Code?

Is it possible to deploy Python AWS Lambda on Windows?

I have a Python AWS Lambda running on a Linux, but due to some dependencies, I need it to be deployed on a Windows. I have tried using Python Azure Functions and have successfully deployed it on a Linux as well, but found out they cannot be deployed on Windows. Is it possible to do it with AWS Lambda?
Basically my solution has a few .exe that need to be run by a python library (Tesseract OCR and pytesseract)
AWS Lambda and Azure Functions are considered Function as a Service (FaaS) solutions, where the developer worries about the code and the cloud provider worries about availability, scalability and the platform underneath to run the code.
In that aspect, you can't run any of them on a server. If you need specific Windows dependencies, you must create a Python project as you normally would, install the dependencies and configure the Windows Server, being responsible for infrastructure and OS configurations and management.

Python development environment for web applications (Django)

the more I read the worse it gets... I am starting out with Python and I cannot make my
mind up on how to set up my dev environment. I want to use Python and Django to build web applications.
Ideally, I'd love to use and IDE on Win7 (which would help with tooltips and help about methods, classes, etc) and have the web app run on a virtual linux machine (need apache+mysql). I have downloaded the turnkey linux appliance for Django and it seems to work fine.
So, in the end, it is unclear to me if people here are recommending to edit my code on the same machine where the app runs. I'd prefer to code on the Win7 machine and then publish the app/files on the fly to the linux virtual box, then accessing the app via the browser.
This is the setup for my current php project at work and I think it works perfectly.
Please clarify if people normally code and run their web apps all on one machine only or not.
Thank you!
I don't know how it can be unclear to you "if people here are recommending to edit my code on the same machine where the app runs". The easy answer is no, no way, never, ever. There can be no ambiguity about that.
Edit Ah, apologies for the misunderstanding - you clarify in the comments that you're not talking about your production environment. In that case, yes it is a perfectly good idea - even preferable - to edit on the same machine as your development app is running. There's no reason not to, and it makes life a whole lot easier.
Note you shouldn't really use Apache in development: it requires a lot of configuration, and doesn't automatically reload after code changes without even more configuration. Use the development server. And in case you were concerned, all of this runs perfectly well on a Windows machine.
I agree with the comment. Personally, I use Aptana Studio (http://www.aptana.com/) alongside GIT to have local version control (integrates well into Aptana). From there on, it is easy to either deploy locally or push the changes to a remote GIT repo.

libspotify Python package for calling Spotify api?

I'm building an app that needs to get artwork information out of the libspotify Spotify API.
I'm building the app in python on google appengine. Does anyone know of a package that will enable me to access the libspotify API? The official page is C and I've googled around to try and find a suitable wrapper but can't seem to find one.
Thanks
Tom
There is also https://github.com/mopidy/pyspotify which is actively used in some applications and up to date.
I don't think you will be able to call libspotify at all. From the docs:
"The Python interpreter runs in a secured "sandbox" environment to isolate your application for service and security. The interpreter can run any Python code, including Python modules you include with your application, as well as the Python standard library. The interpreter cannot load Python modules with C code; it is a "pure" Python environment."
Check Spotimeta
http://pypi.python.org/pypi/spotimeta/

Django: how to publish an app

I have developed an app using Django 1.1.1 and python 2.7.1. I want to publish it on a commercial website, but not sure which one.
the app works fine on the apache server running on my local machine, however, before investing on a host, I want to be sure that I have the necessary requirements, so if it matters, what are the possible hosts I can use?
I use Apache 2.2 with python 2.7.1 on my local machine running with Django 1.1.1. I use the Windows OS. I tried looking at linode but they don't have a documentation for Windows users in using Django and mod_wsgi, so does it even matter?
This is the first time I try to publish on a commercial site, so I don't want to invest on a host and then find myself stuck and not knowing how to upload my Django app.
Thanks,
You can follow the docs on linode just fine, it doesn't matter that you're a Windows user, the app will be deployed on a linux box.
You can also try a shared hosting solution, that will run django right way, without any need to configure and setup a new machine. My personal recommendation is http://www.webfaction.com/ . Another alternative is https://www.djangy.com/.

Categories

Resources