git操作
- git clone -b {branch_name} {url}
- git remote -v
- git add .
- git commit -m {message}
- git push
- git pull
- git branch {newbranch}
- git checkout {branch}
- git push --set-upstream origin {new_branch}
- git merge {branch}
conda相关
- conda env list
- conda create -n 环境名 python=3.11
- conda activate 环境名
- conda deactivate
- conda remove -n 环境名 --all
HDFS相关
- hadoop fs -mkdir '/user/hadoop/zhongxinhao/'
- hdfs dfs -ls '/user/hadoop/zhongxinhao/'
- hdfs dfs -put 'file1.json' '/user/hadoop/zhongxinhao/file1.json'
- hdfs dfs -get '/user/hadoop/zhongxinhao/file1.json'
- hdfs dfs -rm '/user/hadoop/zhongxinhao/file1.json'
- hdfs dfs -cat '/user/hadoop/zhongxinhao/file1.txt'
- hdfs dfs -tail '/user/hadoop/zhongxinhao/file1.txt'
- hdfs dfs -mv '/user/hadoop/zhongxinhao/file1.txt /user/hadoop/zhongxinhao/file2.txt'
- hdfs dfs -cp '/user/hadoop/zhongxinhao/file1.txt /user/hadoop/zhongxinhao/file2.txt'
Python包管理uv
pip install uv
uv venv --python 3.9.7
source .venv/bin/activate
uv add requests
uv pip list
FastAPI
简介
- FastAPI 是一个用于构建 API 的现代、快速(高性能)的 web 框架,使用 Python 3.8+ 并基于标准的 Python 类型提示。
- Uvicorn是一个基于ASGI(Asynchronous Server Gateway Interface)的异步Web服务器,用于运行异步Python web应用程序。它是由编写FastAPI框架的开发者设计的,旨在提供高性能和低延迟的Web服务
安装教程
pip install fastapi
pip install uvicorn
快速入门
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
async def index():
return {"message": "Hello World"}
@app.get("/info")
async def info():
return {
"app_name": "FastAPI框架学习",
"app_version": "v0.0.1"
}
if __name__ == "__main__":
uvicorn.run(app, host="0.0.0.0", port=8000)