Poetry, FastAPI, BlendOS and Python in Excel

You can find this article in the Cisco Communities here.

Remember Poetry?

Try using Poetry to test out FastAPI. FastAPI is a speedster of a way to get web services up and running via Python.?

In case you don't recall, Poetry is a project management tool for Python. Here's a post I made about?Poetry.? Below are some sample commands to get started with FastAPI, a companion library you'll need (uvicorn) using Poetry. Poetry handles its own virtual environments. It does so automatically but I'm the paranoid type, so you'll see me enter a Poetry shell in the commands below. This changes the prompt so I know for a fact I'm using a Poetry virtual environment because the prompt tells me so.?

$ poetry new FAPI 
$ cd FAPI 
$ poetry shell 
(fapi-py3.11) $ pip install fastapi 
(fapi-py3.11) $ pip install uvicorn        

Now you're ready to put together a web service. For example, enter this in a file "main.py":

from fastapi import FastAPI 

app = FastAPI() 

@app.get("/") async def root(): 
    return {"hello":"Hello world"}         

?Now run it with uvicorn:

(fapi-py3.11) PS C:\FAPI> uvicorn main:app 
INFO: Started server process [36188] 
INFO: Waiting for application startup. 
INFO: Application startup complete. 
INFO: Uvicorn running on https://127.0.0.1:8000 (Press CTRL+C to quit)        

?Set your browser to localhost:8000 and you'll get the response:

?{"hello":"Hello world"}

?Read up on FastAPI, it's quite a cool library for quickly creating web services.

Python In Excel

There's already a paid project app and add-in that lets you use Python with Excel. But Microsoft is adding the capability free. You can get it if you have a Microsoft Office 365 insider account for now, but they'll add it later for everyone. I have the insider account, but my Office 365 hasn't updated with the capability yet. In the future, you go to Functions in Excel and choose to Insert Python.?

BlendOS

There's a Linux distribution out of India called BlendOS. This version of Linux is based on Arch Linux, but the cool thing about it is that you can add other distributions to run in Docker containers. So you start with BlendOS, then add other distros like Ubuntu, Debian, Fedora, etc. This basically gives you multiple Linux distributions all running in their separate containers. One click takes you to a command shell for any distribution you've added, from which you can add that distro's packages and run them. You can even assign commands to a specific distribution. So if you only want to run Gimp from Fedora, you tell BlendOS that when you run Gimp, it does it from the Fedora container.?

It's easy to install and use. Just check it out here. Two words of warning: Use?balenaEtcher to burn the ISO to a thumb drive (don't use rufus?which is what I normally use to burn an ISO to a thumb drive). And although BlendOS gives you the option, don't install Android on it. It works fine, but it's funky and there's no easy way to get rid of it.?

要查看或添加评论,请登录

Nicholas Petreley的更多文章

  • BTECH F8HP Pro and John 3:16

    BTECH F8HP Pro and John 3:16

    I am reviewing a radio sold by BTECH, the BF-F8HP Pro. The box for the radio has two scripture references; John 3:16…

  • Linux on the Desktop

    Linux on the Desktop

    First, a disclaimer: I set up my computer to boot a multitude of operating systems. I often use Linux (Debian and…

    2 条评论
  • ThousandEyes Trek: The Motion Picture

    ThousandEyes Trek: The Motion Picture

    WARNING: You may have to have suffered through the 1979 “Star Trek: The Motion Picture,” the worst Star Trek movie ever…

    1 条评论
  • ThousandEyes and Echolink

    ThousandEyes and Echolink

    I’m working with a Cisco service called ThousandEyes. Now, the best application of ThousandEyes would be to spot…

  • The Garbage In Garbage Out Nature of Machine Learning and AI

    The Garbage In Garbage Out Nature of Machine Learning and AI

    ChatGPT AI may be groundbreaking, but for the meantime, AI itself will rarely if ever make any groundbreaking…

  • Qt and WASM

    Qt and WASM

    Allow me to confess to the mistakes I made right from the start. My biggest mistake was being a man.

  • Get Ooey GUI with PyQt6 Zeep and AXL

    Get Ooey GUI with PyQt6 Zeep and AXL

    You’re a Python aficionado. Want to build a Python AXL administration and configuration app with a GUI? Have I got the…

  • Proxmox, Ubuntu 22.04 & Kubernetes How-To

    Proxmox, Ubuntu 22.04 & Kubernetes How-To

    A Kubernetes cluster consists of a control plane and one or more worker nodes. These instructions are specifically for…

    1 条评论
  • Fractured Christmas Carols

    Fractured Christmas Carols

    Joy for AI (To the tune of Joy to the World) Joy to the world, AI has come! Get all your problems solved! It curates…

    1 条评论
  • A Salt and Battery

    A Salt and Battery

    The original post is here in Cisco Community. A Salt and Battery Arizona State University is mixing lithium and sodium…

社区洞察

其他会员也浏览了