ResourceSync库和客户端
resync的Python项目详细描述
resync是python中的一个ResourceSync客户端和库。ResourceSync是的同步框架 由允许第三方使用的各种功能组成的网络 系统与服务器不断变化的资源保持同步。 这些功能可以以模块化的方式组合起来,以满足本地 或社区要求。在
客户端使用
从源同步的典型客户端用法 http://source.example.com/到一组本地文件将是:
resync http://source.example.com/
它将创建或更新本地目录./source.example.com。 或者,可以显式指定目标目录:
^{pr2}$选项详细信息和多种不同模式的描述如下:
resync -h
库的使用
源中的典型库使用(创建并输出资源列表):
from resync import Resource,ResourceList rl = ResourceList() rl.add( Resource('http://example.com/res1', lastmod='2013-01-01') ) rl.add( Resource('http://example.com/res2', lastmod='2013-01-02') ) print rl.as_xml()
目标中的典型库使用(获取并检查功能列表):
from resync import CapabilityList # Read Capability List and show supported capabilities cl = CapabilityList() cl.read("https://raw.github.com/resync/resync/1.0/resync/test/testdata/examples_from_spec/resourcesync_ex_2_6.xml") for resource in cl: print "supports %s (at %s)" % (resource.capability,resource.uri)
安装
客户机和库设计为与Python2.7、3.3、3.4、3.5和3.6一起使用。在
自动安装:
pip install resync
rsync列在PyPI中,可以与一起安装 pip或easy_install。在
从github手动安装:
cd /tmp git clone git://github.com/resync/resync.git cd resync/ python setup.py build sudo python setup.py install
这将在中的适当位置安装库代码 您的python设置,以及适当系统中的客户端resync 路径(可能是/usr/local/bin或/usr/bin,具体取决于您的系统)。在
源代码保存在Github 也可能有没有可用的分支/版本 为PyPI打包。在
版权和许可
版权所有2012–2018 Simeon Warner and contributors
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
看到了吗许可证.txt在
- 项目
标签: