Dell RPA团队的Python软件包
dell-python-rpa的Python项目详细描述
Dell Python RPA软件包
用法
这是什么?
这个python包是一个工具包,它具有定制的功能,这些功能对戴尔内部的不同团队都很有用。
开始
在离开公司网络时使用以下命令安装软件包:
pip install dell_python_rpa -U
在python项目目录中创建一个文件,您将在其中导入名为“configuration.yml”的包,该包以以下格式保存您的网络凭据
不要将此文件存储在共享目录中
credentials: user_name: 'example_username' password: 'example_password'
Examples using these functions
midas api模块
此模块是用于Dell内部API的包装器,用于从OFS和BOSS获取实时订单信息。 要利用它,请将订单号的python列表以及参数传递到每个函数中,以获取以pandas数据帧的形式返回的订单数据。这包括midas当前公开的所有5个web服务api,旨在返回有关订单状态、属性或历史记录的所有信息。
# Importing Order Status Module
from dell_python_rpa.order_status import *
orders=['208432234','208435401','208457058']
general_order_info=get_order_info(orders)
ofs=get_ofs_status(orders)
boss_status=get_boss_status(orders)
properties=get_ofs_properties(orders)
boss_status_history=get_boss_status_history(orders)
gpp函数
该模块包括对全球生产计划组织有用的功能,包括查询michael bishop的数据库和获取最新的csr数据。
# Importing GPP Module
from dell_python_rpa.gpp import *
# Query Michael Bishops Database, results are a Pandas Dataframe
# By default, the function will query the "BACKLOG" database
# Use the db_name parameter if to specify a different db if necessary
directory_of_sql_file='Queries\gpp_bishop_example.sql'
result=bishops_query(directory_of_sql_file)
# Get current CSR data in Pandas Dataframe
csr=get_csr()
udm
此模块包括在UDM/FDL Oracle数据库上执行查询的功能。 返回的数据将是pandas数据帧的数据类型。为了使用这个模块,您需要访问数据库和上面讨论的“configuration.yml”文件,该文件与调用udm函数的python文件位于同一目录中。 udm_query_2函数是最新一代的版本,它以sql文件的目录为参数,还允许使用第二个参数在运行时使用可作为程序一部分计算的参数修改查询。它通过替换sql查询中的文本--insertvaluehere来实现这一点,因此如果要使用此功能,请在文件中包含该字符串。
# Importing UDM Module
from dell_python_rpa.udm import *
# Execute a query without modifying it
directory_of_sql_file='Queries\example_sql_file.sql'
result=udm_query_2(directory_of_sql_file)
# Modify a query before executing it
directory_of_sql_file='Queries\example_sql_file.sql'
query_modifier='AND SO.SYSTEM_QTY > 10'
result=udm_query_2(directory_of_sql_file, query_modifier)