OpenCAPIF SDK
This repository develops a Python Software Development Kit (SDK) which facilitates integration with OpenCAPIF (Common API Framework for 3GPP Northbound APIs), significantly reducing integration complexity and enabling developers to focus on building Network Applications (Network Apps).
The SDK supports both CAPIF roles: Invoker and Provider, and provides simplified methods for interacting with OpenCAPIF. It is compatible with the following public releases:
Network App Developers
A Network App refers to an external application or service that interacts with the 3GPP network using standardized APIs. These apps can be created by network operators, third-party providers, or other entities to access advanced network services like QoS, network slicing, or location services via CAPIF.
Network Apps take on one of two roles:
- Invoker: Consumes APIs exposed by providers to access network capabilities.
- Provider: Exposes APIs/services to be consumed by invokers. A Provider includes:
- AMF (API Management Function): Manages onboarding/offboarding, monitoring, and auditing.
- APF (API Publishing Function): Publishes APIs to the CCF.
- AEF (API Exposing Function): Exposes APIs, validates authorizations, and logs usage.
The SDK maps Python functions to CAPIF OpenAPI endpoints as defined in 3GPP TS 29.222 v18.5.0. A detailed mapping of supported endpoints is available in the full documentation.
Requirements
To use the OpenCAPIF SDK, a registered account on the CAPIF instance is needed. Contact the system administrator to obtain a CAPIF username and password.
Installation
Install the SDK using pip:
pip install opencapif_sdk
Configuration Overview
Configuration is done through a JSON file (capif_sdk_config.json) with common and role-specific fields.
Common Fields (Invoker & Provider)
capif_host,register_hostcapif_https_port,capif_register_portcapif_username,capif_passworddebug_mode
Invoker-specific Fields
invoker_folder,capif_callback_urlsupported_features,cert_generation- Optional:
discover_filter,check_authentication_data
Provider-specific Fields
provider_folder,supported_features,cert_generationAPFs,AEFs,publish_req,api_description_path
Using discover_filter
The discover_filter must comply with the Discover Service API. It allows filtering by specific fields (e.g., api-name) during discovery.
Using publish_req
This section enables API publishing using the CAPIF Publish Service API. Required fields include:
service_api_idpublisher_apf_idpublisher_aefs_idsapi_description_path
A helper is available to translate OpenAPI to ServiceAPIDescription format:
from opencapif_sdk import api_schema_translator
translator = api_schema_translator("./path/to/openapi.yaml")
translator.build("https://192.168.1.10:8080/exampleAPI/v1", "0", "0")
Configuration Field Descriptions
Key parameters include:
capif_username,capif_password: Credentialssupported_features: Hex bitmask (e.g., "4")debug_mode: Enables debug loggingapi_description_path: Path to the ServiceAPIDescription JSON
Provider Artifacts
In provider_folder/<capif_username>/, the SDK stores:
provider_capif_ids.jsoncapif_<api_name>_<api_id>.jsonservice_received.jsonprovider_service_ids.json
Invoker Artifacts
In invoker_folder/<capif_username>/, the SDK stores:
capif_api_security_context_details.json, which includes:api_invoker_id- Available API metadata (after discovery)
- JWT token (after
get_tokens())
Known Issues
The following APIs are not yet supported:
- CAPIF Access Control Policy
- CAPIF Auditing API
- CAPIF Routing Info
- Security API operations:
/trustedInvokers/{apiInvokerId}(GET, DELETE)/trustedInvokers/{apiInvokerId}/delete(POST)
Some publishing operations fail if the number of AEFs/APFs is increased after initial onboarding.
Metadata
Release files for opencapif-sdk 0.1.24
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| opencapif_sdk-0.1.24.tar.gz | 44.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| opencapif_sdk-0.1.24-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 84.0 kB
Release files / opencapif_sdk-0.1.24.tar.gz
| Download URL | opencapif_sdk-0.1.24.tar.gz |
|---|---|
| Size | 44.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
95e0e9f774495bd4c03dcd150c2203a3bdeb2d33026c86c96f585c39225d3b58
|
|
BLAKE2b-256 checksum How to use checksums |
0e8271a021e959684a4204f4750bb857f6e1733d5495370235f346beee54615f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Release files / opencapif_sdk-0.1.24-py3-none-any.whl
| Download URL | opencapif_sdk-0.1.24-py3-none-any.whl |
|---|---|
| Size | 39.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cb535a7f299749fabacc9083d5475c138fc9a49b22c54420498a3bec2a11e009
|
|
BLAKE2b-256 checksum How to use checksums |
c439aa71abf02ef880b53d180d3eb85c33b71f1ee0f511c2132f73c4ef135b96
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|