跳转到主要内容

为ArcGIS Python工具箱提供打包和发布工具

项目描述

概述

此工具提供了一个命令行界面,用于将Python工具箱打包和发布到ArcGIS Server(10.2.x)。

安装

要安装最新稳定版本

pip install python-ags

最新更改

pip install https://bitbucket.org/databasin/ags_tool_deploy/get/develop.zip#egg=ags_tool_deploy

手动安装

develop分支下载最新更改,解压并执行

python setup.py install

这将把脚本安装到您的本地Python包文件夹中

ags_tool_deploy/deploy.py

考虑将此文件夹添加到您的PATH中。

使用方法

此工具旨在在控制台中运行。

有关使用信息,只需运行

python deploy.py --help

以下命令允许您包含Mercurial仓库信息。这不会捆绑完整的仓库,而是包括源仓库的链接和当前分支,以便您可以在服务器上运行

hg pull --update

以拉取完整仓库。

打包

使用package命令将您的Python工具箱打包成服务定义(*.sd)文件。

Usage: deploy.py package [OPTIONS] <toolbox_path> <service_name> <outfile_name>

Package a python toolbox into a service definition file (*.sd). Local
python modules this toolbox references are included automatically.
Requires 7Zip to be installed and on the system PATH.

WARNING: this will overwrite the file <outfile_name> if it already exists.

  Aguments:
  <toolbox_path>:         Filename of python toolbox (*.pyt) to deploy
  <service_name>:         Name of service, including folder(s).  Example: SomeFolder/MyTool
  <outfile>:              Name of the service definition file to create

Options:
  --files <files>                 Wildcard patterns of additional files to
                                  include (relative to toolbox).  Example:
                                  *.csv,some_data.*
  --hg                            Include Mercurial (hg) repository
                                  information?
  --sync                          Execute tool synchronously instead of
                                  asynchronously (default)
  --messages [None|Info|Error|Warning]
                                  Level of messaging for service
  --help                          Show this message and exit.

发布

使用publish命令将您的Python工具箱部署到ArcGIS服务器。

Usage: deploy.py publish [OPTIONS] <toolbox_path> <service_name> <server:port> <user>

Publish a python toolbox to an ArcGIS server. Local python modules this
toolbox references are included automatically. Requires 7Zip to be
installed and on the system PATH.

  Aguments:
  <toolbox_path>:         Filename of python toolbox (*.pyt) to deploy
  <service_name>:         Name of service, including folder(s).  Example: SomeFolder/MyTool
  <server:port>:               Hostname and port number of ArcGIS server
  <user>:                 ArcGIS server administrator user name

Options:
  --password <password>           ArcGIS administrator password.  You will be
                                  prompted for this if you do not provide it
  --files <files>                 Wildcard patterns of additional files to
                                  include (relative to toolbox).  Example:
                                  *.csv,some_data.*
  --hg                            Include Mercurial (hg) repository
                                  information?
  --sync                          Execute tool synchronously instead of
                                  asynchronously (default)
  --messages [None|Info|Error|Warning]
                                  Level of messaging for service
  --overwrite                     Delete and replace the service, if it
                                  already exists?
  --help                          Show this message and exit.

要求

假设

  • 仅支持Python 2.7

  • 仅在Windows上进行了测试

  • 仅支持ArcGIS 10.2.x

许可证

请参阅LICENSE文件。

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。

源代码发行版

ags_tool_deploy-0.1.1.zip (8.9 kB 查看散列值)

上传时间 源代码

由以下机构支持