用于未在特定包中分组的常规函数的python实用程序
ctodd-python-lib-general的Python项目详细描述
Christopher H.Todd的通用任务Python库
ctodd python lib general项目负责尚未放入特定库中的常规任务。基本上将是一次性任务的转储地,这些任务是可重复的,但不会调用可扩展的特定库。
目录
依赖关系
python包
- 请求>;=2.21.0
库
downloader.py
允许从给定URL下载文件并保存到给定位置的库
功能:
def download_file(url, file_location=None, overwrite=False):
"""
Purpose:
Download file from specified URL and store in a specfied location.
If no location is provided, the file is downloaded in the current
directory. If overwrite is false, the file is not downloaded.
Args:
url (string): Full URL path to download file from.
file_location (string): Full path to where file will be stored.
overwrite (Boolean): Whether or not to overwrite file if it already
exists
Return
file_location (string): Full path to where file was be stored.
"""
脚本示例
用于测试和与库交互的示例可执行python脚本/模块。这些示例显示了库的用例,可以用作与库一起开发的模板,也可以用作一次性开发工作。
不适用
注释
- 依赖于f-string符号,它仅限于python3.6。通过重构删除这些内容,可以使用python3.0.x到3.5.x进行开发
待办事项
- UnitTest框架已就位,但缺少测试