# Python ONAP SDK
an SDK to use ONAP programmatically with Python code
[](https://codeclimate.com/github/Orange-OpenSource/python-onapsdk/maintainability)
[](https://gitlab.com/Orange-OpenSource/lfn/onap/python-onapsdk/)
[](https://python-onapsdk.readthedocs.io/en/latest/?badge=latest)
## Description
ONAP SDK is a client library written in Python for building applications to work with ONAP. The project aims to provide a consistent and complete set of interactions with ONAP’s many services, along with complete documentation, examples, and tools.
Using few python commands, you should be able to onboard, distribute models, instantiate xNFs and many others. Check [doc](https://python-onapsdk.readthedocs.io/en/latest/index.html) site to find out all the features.
## Installation
You can install it using `pip` tool
```
$ pip install onapsdk
```
## Development
Before you start, ensure you have Python installation in version 3.8 or higher.
Please see [the official Python documentation](https://docs.python.org/3/using/index.html)
in case you have to upgrade or install certain Python version.
### Setting up development environment
Clone the project. Inside the project folder create a new virtual environment and activate
it:
```
$ python -m venv env
$ source env/bin/activate
```
On Windows, activate by executing the following:
```
$ .\env\Scripts\activate
```
When your virtual environment is ready, install required dependencies:
```
$ pip install -r requirements.txt
```
### Developing
To use library functions directly from the source code, execute the following
to point to the source folder in *PYTHONPATH* variable and run the interpreter:
```
$ PYTHONPATH=$PYTHONPATH:src/ python
```
On Windows:
```
$ $env:PYTHONPATH='src\';python
```
Verify that packages are accessible:
```
>>> import onapsdk
```
You can then start working with library functions as needed.
### Testing
Install [tox](https://tox.readthedocs.io/en/latest/index.html):
```
$ pip install tox
```
To run all unit test, lint and docstyle checks, inside the project folder simply
execute *tox*:
```
$ tox
```
Please note that the above runs unit tests on all major versions of Python available on your
OS (3.7, 3.8, 3.9). To limit execution to only specific version of Python interpreter,
use the following example:
```
$ tox -e py38
```
### Integration testing
It is possible to run integration tests using [mock-servers](https://gitlab.com/Orange-OpenSource/lfn/onap/mock_servers)
project.
Make sure Docker Compose is available on your system. Install required dependencies:
```
$ pip install pytest mock
```
Go to *integration_tests/* directory and execute:
```
$ docker-compose up
```
Please note that *docker-compose* attempts to create subnet 172.20.0.0/24, so it can not be run if the scope is already allocated.
Also, containers are not reachable by their IP addresses on Windows host since
Docker for Windows [does not support](https://docs.docker.com/desktop/networking/#known-limitations-for-all-platforms)
bridged network interface for Linux containers.
Once containers are running, execute the following in the project's directory:
```
$ PYTHONPATH=$PYTHONPATH:integration_tests/:src/ ONAP_PYTHON_SDK_SETTINGS="local_urls" pytest -c /dev/null --verbose --junitxml=pytest-integration.xml integration_tests
```
Please make sure all the test are passing before creating merge request.
# Python ONAP SDK Changelog
## v1.0
[Documentation](https://readthedocs.org/dashboard/python-onapsdk/version/v1.0)
Main new features:
- Onboard a simple service via SDC
- Instantiate a simple service via SO using GR API
- Instantiate a simple service via NBI
- create business objects in AAI
Raw data
{
"_id": null,
"home_page": "https://gitlab.com/Orange-OpenSource/lfn/onap/python-onapsdk",
"name": "onapsdk",
"maintainer": null,
"docs_url": null,
"requires_python": "<4,>=3.8",
"maintainer_email": null,
"keywords": null,
"author": "Orange OpenSource",
"author_email": null,
"download_url": null,
"platform": null,
"description": "# Python ONAP SDK\n\nan SDK to use ONAP programmatically with Python code\n\n[](https://codeclimate.com/github/Orange-OpenSource/python-onapsdk/maintainability)\n[](https://gitlab.com/Orange-OpenSource/lfn/onap/python-onapsdk/)\n[](https://python-onapsdk.readthedocs.io/en/latest/?badge=latest)\n\n## Description\n\nONAP SDK is a client library written in Python for building applications to work with ONAP. The project aims to provide a consistent and complete set of interactions with ONAP\u2019s many services, along with complete documentation, examples, and tools.\n\nUsing few python commands, you should be able to onboard, distribute models, instantiate xNFs and many others. Check [doc](https://python-onapsdk.readthedocs.io/en/latest/index.html) site to find out all the features.\n\n## Installation\n\nYou can install it using `pip` tool\n\n```\n$ pip install onapsdk\n```\n\n## Development\n\nBefore you start, ensure you have Python installation in version 3.8 or higher.\nPlease see [the official Python documentation](https://docs.python.org/3/using/index.html)\nin case you have to upgrade or install certain Python version.\n\n### Setting up development environment\n\nClone the project. Inside the project folder create a new virtual environment and activate\nit:\n\n```\n$ python -m venv env\n$ source env/bin/activate\n```\nOn Windows, activate by executing the following:\n\n```\n$ .\\env\\Scripts\\activate\n```\n\nWhen your virtual environment is ready, install required dependencies:\n\n```\n$ pip install -r requirements.txt\n```\n\n### Developing\n\nTo use library functions directly from the source code, execute the following\nto point to the source folder in *PYTHONPATH* variable and run the interpreter:\n\n\n```\n$ PYTHONPATH=$PYTHONPATH:src/ python\n```\n\nOn Windows:\n\n```\n$ $env:PYTHONPATH='src\\';python\n```\n\nVerify that packages are accessible:\n\n```\n>>> import onapsdk\n```\nYou can then start working with library functions as needed.\n\n### Testing\n\nInstall [tox](https://tox.readthedocs.io/en/latest/index.html):\n\n```\n$ pip install tox\n```\n\nTo run all unit test, lint and docstyle checks, inside the project folder simply\nexecute *tox*:\n\n```\n$ tox\n```\n\nPlease note that the above runs unit tests on all major versions of Python available on your\nOS (3.7, 3.8, 3.9). To limit execution to only specific version of Python interpreter,\nuse the following example:\n\n```\n$ tox -e py38\n```\n\n### Integration testing\n\nIt is possible to run integration tests using [mock-servers](https://gitlab.com/Orange-OpenSource/lfn/onap/mock_servers)\nproject.\nMake sure Docker Compose is available on your system. Install required dependencies:\n```\n$ pip install pytest mock\n```\n\nGo to *integration_tests/* directory and execute:\n```\n$ docker-compose up\n```\nPlease note that *docker-compose* attempts to create subnet 172.20.0.0/24, so it can not be run if the scope is already allocated.\nAlso, containers are not reachable by their IP addresses on Windows host since\nDocker for Windows [does not support](https://docs.docker.com/desktop/networking/#known-limitations-for-all-platforms)\nbridged network interface for Linux containers.\n\nOnce containers are running, execute the following in the project's directory:\n```\n$ PYTHONPATH=$PYTHONPATH:integration_tests/:src/ ONAP_PYTHON_SDK_SETTINGS=\"local_urls\" pytest -c /dev/null --verbose --junitxml=pytest-integration.xml integration_tests\n```\n\nPlease make sure all the test are passing before creating merge request.\n# Python ONAP SDK Changelog\n\n## v1.0\n\n[Documentation](https://readthedocs.org/dashboard/python-onapsdk/version/v1.0)\n\nMain new features:\n\n- Onboard a simple service via SDC\n- Instantiate a simple service via SO using GR API\n- Instantiate a simple service via NBI\n- create business objects in AAI\n",
"bugtrack_url": null,
"license": "Apache 2.0",
"summary": "SDK to use ONAP Programatically",
"version": "13.3.0",
"project_urls": {
"Homepage": "https://gitlab.com/Orange-OpenSource/lfn/onap/python-onapsdk"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2dc9e423d53ed791268f1e19b1fbf4cdab475fee3e91e1c17c5c16472d0583fb",
"md5": "3665f42386e99604f4ada631ec16485a",
"sha256": "11a7b1837fb882636c4f076ad06b787b6dd5ed6729c2813f7d77d3969da33b0c"
},
"downloads": -1,
"filename": "onapsdk-13.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3665f42386e99604f4ada631ec16485a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4,>=3.8",
"size": 281407,
"upload_time": "2024-11-27T09:16:51",
"upload_time_iso_8601": "2024-11-27T09:16:51.574949Z",
"url": "https://files.pythonhosted.org/packages/2d/c9/e423d53ed791268f1e19b1fbf4cdab475fee3e91e1c17c5c16472d0583fb/onapsdk-13.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-27 09:16:51",
"github": false,
"gitlab": true,
"bitbucket": false,
"codeberg": false,
"gitlab_user": "Orange-OpenSource",
"gitlab_project": "lfn",
"lcname": "onapsdk"
}