随笔分类 -  python

摘要:配置文件:config.yaml global: dingtalk_webhook: "https://oapi.dingtalk.com/robot/send?access_token=b18fc3a58fd6ab1c153eae423b5d92c3edf90164736190d2e4361d8f 阅读全文
posted @ 2025-04-11 17:27 蒲公英PGY 阅读(74) 评论(0) 推荐(0)
摘要:import psycopg2 from psycopg2 import sql import pandas as pd # 数据库连接配置 DB_CONFIG = { 'host': '', 'port': , 'user': '', 'password': '' } def get_databa 阅读全文
posted @ 2025-03-26 10:03 蒲公英PGY 阅读(55) 评论(0) 推荐(0)
摘要:import os import oss2 import json import logging import threading import traceback from concurrent.futures import ThreadPoolExecutor # 可配置参数 THREAD_CO 阅读全文
posted @ 2025-03-26 10:00 蒲公英PGY 阅读(87) 评论(0) 推荐(0)
摘要:import oss2 import re import logging from datetime import datetime import os # 配置可修改的参数 cutoff_year = 2024 # 需要删除该年份之前的文件 文件名中包含日期的文件 2024-01-01 cutof 阅读全文
posted @ 2025-03-26 09:54 蒲公英PGY 阅读(69) 评论(0) 推荐(0)
摘要:python 递归上传文件到阿里云oss import os import oss2 import json # 阿里云 OSS 访问信息 access_key_id = 'xxxxxxxxx' access_key_secret = 'xxxxxxxxxxxxx' endpoint = 'xxxx 阅读全文
posted @ 2023-11-10 10:12 蒲公英PGY 阅读(219) 评论(0) 推荐(0)
摘要:分片上传和断点续传是常见于文件上传至云存储服务的操作,其中OSS (Object Storage Service) 是阿里云提供的云存储服务。Python 可以用来实现分片上传和断点续传到阿里云 OSS。下面是一个简单的示例,演示了如何使用 Python 和阿里云 OSS SDK 进行分片上传和断点 阅读全文
posted @ 2023-09-14 14:31 蒲公英PGY 阅读(482) 评论(0) 推荐(0)
摘要:一、概述 一般对于Request Body不会通过get提交,对于get提交的参数一般称为是查询参数。所以,如果是通过POTS,PUT等方式提交的参数信息,我们一般是放到Request Body来提交到我们的后端。 对于如何接收和校验请求体,FastApi提供的形式是使用:from pydantic 阅读全文
posted @ 2023-09-12 09:35 蒲公英PGY 阅读(226) 评论(0) 推荐(0)
摘要:cat python_oss.py #!/usr/bin/python # -*- coding: utf-8 -*- # @time : 2023/2/23 14:29 # @author : pugongying # @description : from __future__ import p 阅读全文
posted @ 2023-03-08 17:19 蒲公英PGY 阅读(643) 评论(0) 推荐(0)
摘要:wwechat.py ```python #!/usr/bin/python # coding:utf-8 # 2016-01-18 import urllib, urllib2 import json import sys import logging import subprocess relo 阅读全文
posted @ 2022-06-07 14:46 蒲公英PGY 阅读(157) 评论(1) 推荐(0)
摘要:```python # -*- coding: utf-8 -*- # @Time : 2020-07-14 # @Author : pugongying import smtplib from email.mime.text import MIMEText from email.utils imp 阅读全文
posted @ 2022-06-07 14:00 蒲公英PGY 阅读(55) 评论(0) 推荐(0)
摘要:# python使用AliyunOpenApi获取MongoDB监控数据 Mongo_cpu.py ```python import sys import json import datetime,time from json import loads, dumps from typing impo 阅读全文
posted @ 2022-06-07 13:58 蒲公英PGY 阅读(120) 评论(0) 推荐(0)
摘要:# python使用AliyunOpenApi获取ecs监控数据 ecs.py ```python #!/usr/bin/env python #coding=utf-8 import json import datetime,time from aliyunsdkcore.client impor 阅读全文
posted @ 2022-06-07 13:51 蒲公英PGY 阅读(131) 评论(0) 推荐(0)
摘要:# python使用AliyunOpenApi获取arms数据 arms_class.py ```python from aliyunsdkcore.client import AcsClient from aliyunsdkcore.acs_exception.exceptions import 阅读全文
posted @ 2022-06-07 13:49 蒲公英PGY 阅读(213) 评论(0) 推荐(0)
摘要:# python操作pgsql备份还原 common.py ```python #!/usr/bin/env python # encoding: utf-8 import argparse dbs = [ "test1", "test2" ] # ct: pgsql容器的名称 ct = "pg" 阅读全文
posted @ 2022-06-07 11:29 蒲公英PGY 阅读(305) 评论(0) 推荐(0)
摘要:# python使用FastAPI返回简单html页面 ```python # pip install uvicorn prometheus_client # pip install fastapi yaml # uvicorn main:app --reload from fastapi impo 阅读全文
posted @ 2022-06-07 11:16 蒲公英PGY 阅读(1422) 评论(0) 推荐(0)
摘要:# python 调用dingding的API进行消息发送 使用python的fastapi快速构建后端api接口 ```python # pip install fastapi requests uvicorn from typing import Set from fastapi import 阅读全文
posted @ 2022-06-07 11:11 蒲公英PGY 阅读(359) 评论(0) 推荐(0)
摘要:python 调用Jenkins的API进行发布 # pip install pyyaml==5.4.1 import json import requests,sys,os,time import requests,sys from requests.auth import HTTPBasicAu 阅读全文
posted @ 2022-06-07 11:05 蒲公英PGY 阅读(302) 评论(0) 推荐(0)
摘要:```python # pip3 install requests import requests,sys,os,time from requests.packages import urllib3 urllib3.disable_warnings() def get_tags (base_url, 阅读全文
posted @ 2022-06-07 10:18 蒲公英PGY 阅读(443) 评论(0) 推荐(0)
摘要:```python # pip install uvicorn # pip install fastapi # uvicorn main:app --reload # pip install ruamel.yaml from fastapi import FastAPI from fastapi.r 阅读全文
posted @ 2022-06-06 17:49 蒲公英PGY 阅读(397) 评论(0) 推荐(0)
摘要:python3 -m pip install --upgrade pip 阅读全文
posted @ 2022-05-12 10:23 蒲公英PGY 阅读(150) 评论(0) 推荐(0)