harbor/contrib/sdk/harbor-py
Casey Peel b7a2982d7d Fix harborclient module logging
python modules shouldn't set the global logging level and should log
with a named logger matching the module. This allows the application
to control the logging.
2017-08-03 14:46:15 -07:00
..
examples Move harbor-py to contrib/sdk/ 2016-07-26 00:19:30 +08:00
harborclient Fix harborclient module logging 2017-08-03 14:46:15 -07:00
.gitignore Move harbor-py to contrib/sdk/ 2016-07-26 00:19:30 +08:00
format_code.sh Move harbor-py to contrib/sdk/ 2016-07-26 00:19:30 +08:00
README.md Move harbor-py to contrib/sdk/ 2016-07-26 00:19:30 +08:00
requirements.txt Move harbor-py to contrib/sdk/ 2016-07-26 00:19:30 +08:00
setup.py Move harbor-py to contrib/sdk/ 2016-07-26 00:19:30 +08:00
uninstall.sh Move harbor-py to contrib/sdk/ 2016-07-26 00:19:30 +08:00

Introduction

harbor is the enterprise-class registry server for docker distribution.

harbor-py is the native and compatible python SDK for harbor. The supported APIs are list below.

Installation

pip install harbor-py

Usage

from harborclient import harborclient

host = "127.0.0.1"
user = "admin"
password = "Harbor12345"

client = harborclient.HarborClient(host, user, password)

client.get_projects()
client.get_users()
client.get_statistics()
client.get_top_accessed_repositories()
client.search("library")

For more usage, please refer to the examples.

Contribution

If you have any suggestion, feel free to submit issues or send pull-requests for harbor-py.

Publish harbor-py package to pypi server with the following commands.

python setup.py register -r pypi
python setup.py sdist upload  -r pypi