This repository develops a Python Software Development Kit(SDK) which focuses on connecting to OpenCAPIF (Common API Framework for 3GPP Northbound APIs) in a simple way, lowering integration complexity and allowing developers to focus on Network Applications (Network Apps) or services development.
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file opencapif_sdk-0.1.24.tar.gz.
File metadata
- Download URL: opencapif_sdk-0.1.24.tar.gz
- Upload date:
- Size: 44.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95e0e9f774495bd4c03dcd150c2203a3bdeb2d33026c86c96f585c39225d3b58
|
|
| MD5 |
3b7e0c66846f333ea375069156ad32b9
|
|
| BLAKE2b-256 |
0e8271a021e959684a4204f4750bb857f6e1733d5495370235f346beee54615f
|
File details
Details for the file opencapif_sdk-0.1.24-py3-none-any.whl.
File metadata
- Download URL: opencapif_sdk-0.1.24-py3-none-any.whl
- Upload date:
- Size: 39.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb535a7f299749fabacc9083d5475c138fc9a49b22c54420498a3bec2a11e009
|
|
| MD5 |
03a06ff1a254955c191b902c84df1fa3
|
|
| BLAKE2b-256 |
c439aa71abf02ef880b53d180d3eb85c33b71f1ee0f511c2132f73c4ef135b96
|