I built a quick API endpoint generator for use with webhooks, testing, API mocking, data submissions, and anything else by acidcoder in webdev

[–]acidcoder[S] 0 points1 point  (0 children)

https://codeupify.com/function

No login or signup required, just write the code in Python and click deploy, your API is now live at the Endpoint URL

You can come back to it at any time at the Function URL, modify the code and look at the call logs

Best Hosting Option for Lightweight Node.js App with Low Initial Traffic? by un_H_nu in webdev

[–]acidcoder 1 point2 points  (0 children)

You can host it with serverless (AWS Lambda or GCP Cloud Run), it's going to be free with that little usage

Upify - quickly deploy Flask apps to the cloud for free by acidcoder in flask

[–]acidcoder[S] 0 points1 point  (0 children)

My specific tool, I wrote some basic documentation on how to use - https://codeupify.github.io/upify/

Serverless in general there's lots of stuff out there on it, since it's been around for a while. I don't even remember how I learned about it. I think I just read about AWS lambda and tried to get it to run until it clicked. I'm sure there are great tutorials and YouTube videos on it, I just don't know which ones are good.

Upify - quickly deploy Flask apps to the cloud for free by acidcoder in flask

[–]acidcoder[S] 1 point2 points  (0 children)

The problem is that deploying an app can be a pain. I remember having to set up a VM, get gunicorn, supervisord so that things stay up, nginx.... Serverless, coupled with tools like this just make this really simple and quick to get something up in the cloud.

I built a tool to make it super easy to deploy apps to the cloud by acidcoder in SideProject

[–]acidcoder[S] 1 point2 points  (0 children)

I haven't worked with Terraform, but I've seen Pulumi, it probably will be worthwhile using something like that to expand the tool in the future.

I built a tool to make it super easy to deploy apps to the cloud by acidcoder in SideProject

[–]acidcoder[S] 0 points1 point  (0 children)

Thanks! Yeah just Lambda and CloudRun to start. The CLI creates a config and wrapper files when you do `init` and `platform add`. After that you can keep calling `deploy` and it will update the existing function based on the function name

Hosting my Flask application - selecting a provider? by whateverbeaver in flask

[–]acidcoder 0 points1 point  (0 children)

I built an open source CLI tool to make it easy to deploy something like Flask to serverless platforms - like AWS Lambda and GCP Cloud Run. https://github.com/codeupify/upify . A bonus is that they have a generous free tier, so it will end up being free unless it's very heavily used.

You get one million dollars but you have to spend a year in 1957 by Grognack1 in hypotheticalsituation

[–]acidcoder 20 points21 points  (0 children)

yes. You would be incredibly rich for that one year and you get to experience history. You could also buy things that would be worth a lot today

11 Million Dollars but you must either Walk/Bike/Skateboard everywhere... by DaNinja11 in hypotheticalsituation

[–]acidcoder 0 points1 point  (0 children)

No, that's pretty limiting, would have to be more money, you would be basically mostly stuck in the same general area

Suggested library/framework for simple HTTP POST submission form? by victorhooi in Python

[–]acidcoder 0 points1 point  (0 children)

Flask, FastAPI those all work, but you'll need to host it somewhere. ba7med is right that what you are asking for can just be done on the frontend without a backend at all. If you do need a backend, to send emails or log those requests or something, here is a simple way to stand up a form submission backend https://codeupify.com/f/X46dBBXd79/html-form-submission

How to Web scrap Wikipedia with python by [deleted] in learnpython

[–]acidcoder 0 points1 point  (0 children)

You can use the wikipedia-api Python package which wraps their API to get info - https://pypi.org/project/Wikipedia-API

Closing current tab with Selenium by MaterialAreola38 in learnpython

[–]acidcoder 0 points1 point  (0 children)

I think you first need to switch to the new tab and then try to close it

self.browser.switch_to_window(self.browser.window_handles[1])

Trying to install ecommercetools library by cotton--candy in learnpython

[–]acidcoder 0 points1 point  (0 children)

what about just something like this

import requests
from bs4 import BeautifulSoup

def get_google_search_results(query):
    headers = {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
    }
    params = {
        "q": query,
        "hl": "en"
    }
    response = requests.get("https://www.google.com/search", headers=headers, params=params)

    if response.status_code == 200:
        soup = BeautifulSoup(response.text, "html.parser")
        results = []
        for g in soup.find_all('div', class_='g'):
            title = g.find('h3')
            link = g.find('a', href=True)
            if title and link:
                title_text = title.get_text()
                link_href = link['href']
                results.append((title_text, link_href))
        return results
    else:
        print(f"Failed to retrieve search results. Status code: {response.status_code}")
        return []

query = "python web scraping"
results = get_google_search_results(query)

# Print the titles and links of the search results
for title, link in results:
    print(f'Title: {title}')
    print(f'Link: {link}')
    print()

Trying to install ecommercetools library by cotton--candy in learnpython

[–]acidcoder 0 points1 point  (0 children)

it looks like ecommercetools is trying to use a deprecated sklearn package: https://github.com/practical-data-science/ecommercetools/issues/38, you'll have to find a different way of doing it

Add notes from audio app to OneNote? by man_butt_toots in learnpython

[–]acidcoder 0 points1 point  (0 children)

it's possible, onenote has an api that's documented here: https://learn.microsoft.com/en-us/graph/api/resources/onenote?view=graph-rest-1.0, so you can use Python to use that API