Skip to main content

Nacos sdk for python

Project description

pynacos-sdk

pypi Codacy Badge

Install

pip install pynacos-sdk

Tutorial

from nacos import Nacos
from nacos.errors import RequestError, ParamError
from nacos.params import ServiceRegisterParam, ServiceListParam


NACOS_HOST = "127.0.0.1"
NACOS_PORT = 8848
NAMESPACE_ID = "e26e7439-e161-4709-8778-ab5ecef5fec5"

nacos = Nacos(NACOS_HOST, NACOS_PORT, NAMESPACE_ID)

try:
    param = ServiceRegisterParam("hello")
    status = nacos.service_register(param)
    print("register status = ", status)
except ParamError as e:
    print("param error")
    print(e)
except RequestError as e:
    print("nacos error")
    print(e)

try:
    param = ServiceListParam()
    services = nacos.service_list(param)
    print(services.json())
except ParamError as e:
    print("param error")
    print(e)
except RequestError as e:
    print("nacos error")
    print(e)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pynacos-sdk-0.4.1.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

pynacos_sdk-0.4.1-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file pynacos-sdk-0.4.1.tar.gz.

File metadata

  • Download URL: pynacos-sdk-0.4.1.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for pynacos-sdk-0.4.1.tar.gz
Algorithm Hash digest
SHA256 531ff8989986615c53819734e6eb7609651c0068f287f51457566e6d62d84e41
MD5 f9536c02104950462c27ca99f4d91842
BLAKE2b-256 83cfa3661466ce77dc398f52b04a984867c334f179b779ca24103163dfca749d

See more details on using hashes here.

File details

Details for the file pynacos_sdk-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: pynacos_sdk-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for pynacos_sdk-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d47f87f24e5bed9e5215cf202e335e6add333af96a4e6b91547fe737908ac5ee
MD5 0c73e7ecf88a9d39c130873dec82e39f
BLAKE2b-256 73d7261c8ca498295b6c6d90125bd648db6975e6874a95c8e25388bcea495c80

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page