omni-api


Nameomni-api JSON
Version 0.5.3 PyPI version JSON
download
home_pagehttp://omni-api.hive.pt
SummaryOmni API Client
upload_time2024-04-20 08:15:30
maintainerNone
docs_urlNone
authorHive Solutions Lda.
requires_pythonNone
licenseApache License, Version 2.0
keywords omni api
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # [Omni API](http://omni-api.hive.pt)

Simple REST API wrapper for the Omni infra-structure.

## Configuration

| Name                  | Type  | Description                                                                                                              |
| --------------------- | ----- | ------------------------------------------------------------------------------------------------------------------------ |
| **OMNI_BASE_URL**     | `str` | The base URL that is going to be used for API connections (defaults to `http://localhost:8080/mvc/`).                    |
| **OMNI_OPEN_URL**     | `str` | The open URL for the Omni connection (defaults to `OMNI_BASE_URL`).                                                      |
| **OMNI_PREFIX**       | `str` | The default prefix to be used for API requests (defaults to `adm/`).                                                     |
| **OMNI_ID**           | `str` | The client id to be used for API connections (defaults to `None`).                                                       |
| **OMNI_SECRET**       | `str` | The secret key to be used for API connections (defaults to `None`).                                                      |
| **OMNI_REDIRECT_URL** | `str` | The URL to be used for redirection OAuth based workflow (defaults to `base,base.user,base.admin,foundation.store.list`). |
| **OMNI_USERNAME**     | `str` | The username to be used on direct workflow (defaults to `None`).                                                         |
| **OMNI_PASSWORD**     | `str` | The password to be used on direct workflow (defaults to `None`).                                                         |

## Usage

Typical usage of the Omni client implies the providing of the username and the
password inside the target omni instance (Direct Mode).

```python
api = omni.Api(
    base_url = "http://frontdoorhq.com",
    username = "YOUR_USERNAME",
    password = "YOUR_PASSWORD"
)
```

Alternatively it's possible to use the api throught an OAuth base approach using
the provided client id and secret values.

```python
api = omni.Api(
    base_url = "http://frontdoorhq.com",
    client_id = "YOUR_OAUTH_ID",
    client_secret = "YOUR_OAUTH_SECRET"
)
```

For these type of handling the `OAuthAccessError` exception must be handled and then
the user must be redirect to the url provided by `api.oauth_autorize` method call.

Running then the `api.oauth_access` call with the returned `code` from the server side
that should be used to redeem the `access_token` required for session authentication.

## Examples

Examples are located [here](src/examples).

## License

Omni API is currently licensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/).

## Build Automation

[![Build Status](https://app.travis-ci.com/hivesolutions/omni-api.svg?branch=master)](https://travis-ci.com/github/hivesolutions/omni-api)
[![Build Status GitHub](https://github.com/hivesolutions/omni-api/workflows/Main%20Workflow/badge.svg)](https://github.com/hivesolutions/omni-api/actions)
[![Coverage Status](https://coveralls.io/repos/hivesolutions/omni-api/badge.svg?branch=master)](https://coveralls.io/r/hivesolutions/omni-api?branch=master)
[![PyPi Status](https://img.shields.io/pypi/v/omni-api.svg)](https://pypi.python.org/pypi/omni-api)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://www.apache.org/licenses/)



            

Raw data

            {
    "_id": null,
    "home_page": "http://omni-api.hive.pt",
    "name": "omni-api",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "omni api",
    "author": "Hive Solutions Lda.",
    "author_email": "development@hive.pt",
    "download_url": "https://files.pythonhosted.org/packages/58/cb/233e78ed57fd443c0d95a8ad7e138694e10bd5f0b8abd7675209e54e3d11/omni-api-0.5.3.tar.gz",
    "platform": null,
    "description": "# [Omni API](http://omni-api.hive.pt)\n\nSimple REST API wrapper for the Omni infra-structure.\n\n## Configuration\n\n| Name                  | Type  | Description                                                                                                              |\n| --------------------- | ----- | ------------------------------------------------------------------------------------------------------------------------ |\n| **OMNI_BASE_URL**     | `str` | The base URL that is going to be used for API connections (defaults to `http://localhost:8080/mvc/`).                    |\n| **OMNI_OPEN_URL**     | `str` | The open URL for the Omni connection (defaults to `OMNI_BASE_URL`).                                                      |\n| **OMNI_PREFIX**       | `str` | The default prefix to be used for API requests (defaults to `adm/`).                                                     |\n| **OMNI_ID**           | `str` | The client id to be used for API connections (defaults to `None`).                                                       |\n| **OMNI_SECRET**       | `str` | The secret key to be used for API connections (defaults to `None`).                                                      |\n| **OMNI_REDIRECT_URL** | `str` | The URL to be used for redirection OAuth based workflow (defaults to `base,base.user,base.admin,foundation.store.list`). |\n| **OMNI_USERNAME**     | `str` | The username to be used on direct workflow (defaults to `None`).                                                         |\n| **OMNI_PASSWORD**     | `str` | The password to be used on direct workflow (defaults to `None`).                                                         |\n\n## Usage\n\nTypical usage of the Omni client implies the providing of the username and the\npassword inside the target omni instance (Direct Mode).\n\n```python\napi = omni.Api(\n    base_url = \"http://frontdoorhq.com\",\n    username = \"YOUR_USERNAME\",\n    password = \"YOUR_PASSWORD\"\n)\n```\n\nAlternatively it's possible to use the api throught an OAuth base approach using\nthe provided client id and secret values.\n\n```python\napi = omni.Api(\n    base_url = \"http://frontdoorhq.com\",\n    client_id = \"YOUR_OAUTH_ID\",\n    client_secret = \"YOUR_OAUTH_SECRET\"\n)\n```\n\nFor these type of handling the `OAuthAccessError` exception must be handled and then\nthe user must be redirect to the url provided by `api.oauth_autorize` method call.\n\nRunning then the `api.oauth_access` call with the returned `code` from the server side\nthat should be used to redeem the `access_token` required for session authentication.\n\n## Examples\n\nExamples are located [here](src/examples).\n\n## License\n\nOmni API is currently licensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/).\n\n## Build Automation\n\n[![Build Status](https://app.travis-ci.com/hivesolutions/omni-api.svg?branch=master)](https://travis-ci.com/github/hivesolutions/omni-api)\n[![Build Status GitHub](https://github.com/hivesolutions/omni-api/workflows/Main%20Workflow/badge.svg)](https://github.com/hivesolutions/omni-api/actions)\n[![Coverage Status](https://coveralls.io/repos/hivesolutions/omni-api/badge.svg?branch=master)](https://coveralls.io/r/hivesolutions/omni-api?branch=master)\n[![PyPi Status](https://img.shields.io/pypi/v/omni-api.svg)](https://pypi.python.org/pypi/omni-api)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://www.apache.org/licenses/)\n\n\n",
    "bugtrack_url": null,
    "license": "Apache License, Version 2.0",
    "summary": "Omni API Client",
    "version": "0.5.3",
    "project_urls": {
        "Homepage": "http://omni-api.hive.pt"
    },
    "split_keywords": [
        "omni",
        "api"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cffdae13a3a79579b3076c332ec08a04091bebe8fa5a4d393c71218780faf6c6",
                "md5": "b1a9e3bbe515497a0961dfa82c66bdb1",
                "sha256": "8323e3abec9aedeb8cacc53386f71ab8871423da28556950dacee1b93ac0f3ad"
            },
            "downloads": -1,
            "filename": "omni_api-0.5.3-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b1a9e3bbe515497a0961dfa82c66bdb1",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 45769,
            "upload_time": "2024-04-20T08:15:28",
            "upload_time_iso_8601": "2024-04-20T08:15:28.413568Z",
            "url": "https://files.pythonhosted.org/packages/cf/fd/ae13a3a79579b3076c332ec08a04091bebe8fa5a4d393c71218780faf6c6/omni_api-0.5.3-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "58cb233e78ed57fd443c0d95a8ad7e138694e10bd5f0b8abd7675209e54e3d11",
                "md5": "0a5ed69e54cf6d7e09f55fed12777781",
                "sha256": "6e45f8693ff58eeaa1c5892cb31e7d753eee93a70d740b49757418209f9fde6d"
            },
            "downloads": -1,
            "filename": "omni-api-0.5.3.tar.gz",
            "has_sig": false,
            "md5_digest": "0a5ed69e54cf6d7e09f55fed12777781",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 14157,
            "upload_time": "2024-04-20T08:15:30",
            "upload_time_iso_8601": "2024-04-20T08:15:30.482273Z",
            "url": "https://files.pythonhosted.org/packages/58/cb/233e78ed57fd443c0d95a8ad7e138694e10bd5f0b8abd7675209e54e3d11/omni-api-0.5.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-20 08:15:30",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "omni-api"
}
        
Elapsed time: 0.24371s