Registry / gcp / ncloud-sdk-python

ncloud-sdk-python

JSON →
library2.8.1 (ncloud meta-package)pypypiunverified

Official Python SDK for Naver Cloud Platform (NCP) — South Korea's primary cloud provider, equivalent to AWS in the Korean market. Provides programmatic access to NCP infrastructure services: servers, VPC, CDN, DNS, Object Storage, and more. The SDK is split into service-specific packages (ncloud-server, ncloud-vserver, ncloud-vpc, ncloud-cdn, etc.) — install only the services you need. IMPORTANT: NCP has two distinct environments — Classic and VPC — with separate SDK modules, different API endpoints, and incompatible APIs. ncloud-server targets Classic, ncloud-vserver targets VPC. New accounts should use VPC.

gcpaws
pip install ncloud
Install & Compatibility
Where this runs
tested against v? · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
11/20 runs
11/20 runs
py 3.11
11/20 runs
11/20 runs
py 3.12
11/20 runs
11/20 runs
py 3.13
11/20 runs
11/20 runs
py 3.9
11/20 runs
11/20 runs
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ncloud_vserver (VPC servers)
import ncloud_vserver from ncloud_vserver.api.v2_api import V2Api
import ncloud_server # This is Classic environment, not VPC
VPC and Classic environments use completely different modules. ncloud_server = Classic. ncloud_vserver = VPC. Mixing them results in wrong API endpoints being called.

Always use ncloud-vserver (VPC) for new projects. ncloud-server (Classic) is legacy. Product codes for server images and instance types must be retrieved via API (getServerImageProductList, getServerProductList) — they are not human-readable strings and differ between Classic and VPC environments.

# Step 1: Set up credentials # Option A: Config file at ~/.ncloud/configure # [DEFAULT] # ncloud_access_key_id = YOUR_ACCESS_KEY # ncloud_secret_access_key = YOUR_SECRET_KEY # Option B: Environment variables # export NCLOUD_ACCESS_KEY_ID=YOUR_ACCESS_KEY # export NCLOUD_SECRET_KEY=YOUR_SECRET_KEY # Step 2: VPC Server operations (recommended for new accounts) import ncloud_vserver from ncloud_vserver.api.v2_api import V2Api from ncloud_vserver.rest import ApiException import ncloud_apikey # Load credentials from config file or env vars apikeys = ncloud_apikey.ncloud_key.NcloudKey().keys() configuration = ncloud_vserver.Configuration() configuration.access_key = apikeys['access_key'] configuration.secret_key = apikeys['secret_key'] api = V2Api(ncloud_vserver.ApiClient(configuration)) # List server instances try: response = api.get_server_instance_list( ncloud_vserver.GetServerInstanceListRequest() ) for server in response.get_server_instance_list_response.server_instance_list: print(server.server_name, server.server_instance_status.code_name) except ApiException as e: print(f'API error: {e}') # Create a server instance (VPC) try: request = ncloud_vserver.CreateServerInstancesRequest( vpc_no='YOUR_VPC_NO', subnet_no='YOUR_SUBNET_NO', server_image_product_code='SW.VSVR.OS.LNX64.CNTOS.0703.B050', # CentOS 7 server_product_code='SVR.VSVR.STAND.C002.M008.NET.SSD050.B050.G002', ) response = api.create_server_instances(request) print(response) except ApiException as e: print(f'Create error: {e}') # Classic environment (legacy — use only if on Classic account) import ncloud_server from ncloud_server.api.v2_api import V2Api as ClassicV2Api classic_config = ncloud_server.Configuration() classic_config.access_key = apikeys['access_key'] classic_config.secret_key = apikeys['secret_key'] classic_api = ClassicV2Api(ncloud_server.ApiClient(classic_config)) try: response = classic_api.get_server_instance_list( ncloud_server.GetServerInstanceListRequest() ) except ApiException as e: print(f'Classic API error: {e}') # CDN (works for both Classic and VPC) import ncloud_cdn from ncloud_cdn.api.v2_api import V2Api as CdnV2Api cdn_config = ncloud_cdn.Configuration() cdn_config.access_key = apikeys['access_key'] cdn_config.secret_key = apikeys['secret_key'] cdn_api = CdnV2Api(ncloud_cdn.ApiClient(cdn_config)) try: response = cdn_api.get_cdn_plus_instance_list( ncloud_cdn.GetCdnPlusInstanceListRequest() ) print(response) except ApiException as e: print(f'CDN error: {e}')
Debug
Known issues
breakingClassic and VPC environments are completely separate API surfaces with different modules, endpoints, and product codes. ncloud-server (Classic) and ncloud-vserver (VPC) are NOT interchangeable. Classic uses 'https://ncloud.apigw.ntruss.com/server/v2', VPC uses 'https://ncloud.apigw.ntruss.com/vserver/v2'. Calling Classic APIs on a VPC account or vice versa returns auth or resource-not-found errors.
fix
New accounts: always use ncloud-vserver (VPC). Check your account type in the NCP console. If you created your account after 2020, it is almost certainly VPC.
affects: all
gotchaServer image product codes and server product codes are not human-readable strings — they are opaque codes like 'SW.VSVR.OS.LNX64.CNTOS.0703.B050'. These codes differ between Classic and VPC environments and can change over time as Naver deprecates older images. Hardcoding them will break when Naver retires the image.
fix
Always fetch current product codes dynamically via getServerImageProductList() and getServerProductList() before creating instances. Cache the results but don't hardcode them.
affects: all
gotchaThe README installation instruction says 'pip install Setuptools' which is misleading — this is a general Python build tool, not the NCP SDK. Each NCP service is a separate PyPI package (ncloud-server, ncloud-vserver, ncloud-vpc, ncloud-cdn, etc.). There is no single 'pip install ncloud-sdk' that installs everything.
fix
Install only the service-specific packages you need: pip install ncloud-vserver ncloud-apikey for VPC servers, plus additional packages per service.
affects: all
gotchaCredential loading order via ncloud_apikey.NcloudKey() is: (1) environment variables NCLOUD_ACCESS_KEY_ID / NCLOUD_SECRET_KEY, (2) config file at ~/.ncloud/configure, (3) Server Role metadata (VPC only). If none are present, the SDK raises a generic exception with no clear message about missing credentials.
fix
Set credentials via environment variables in CI/CD. Use ~/.ncloud/configure for local dev. The config file can be generated via the Ncloud CLI: ncloud configure.
affects: all
gotchaNCP console, documentation, and support are primarily in Korean. English documentation at api.ncloud-docs.com exists but is less comprehensive and may lag behind Korean docs for newer services.
fix
Use English docs at api.ncloud-docs.com for API reference. For service-specific guides and troubleshooting, the Korean docs at guide.ncloud-docs.com are more complete.
affects: all
gotchaNCP regions are Korea-centric. Primary region is KR (Korea). Additional regions include SGN (Singapore), JPN (Japan), USWN (US West), and DE (Germany). Not all services are available in all regions. Region availability must be checked per service.
fix
Specify the region explicitly when creating resources. Default region is KR if not specified.
affects: all
Upgrade
Version history
2.8.1 (ncloud meta-package)latest on PyPI
Audit
Dependencies
ncloud-apikeyrequiredRequired. Handles credential loading from config file, environment variables, or Server Role metadata.
urllib3requiredRequired. HTTP transport for all API calls.
python-dateutilrequiredRequired. Date/time parsing in API responses.
Agent activity
19 hits · last 30 days
node
8
seranking-bot
3
ahrefsbot
2
bytedance
2
Amazon
1
Resources