ds-stoa


Nameds-stoa JSON
Version 0.1.1 PyPI version JSON
download
home_pageNone
SummaryA python package for GraspDP Stoa. Simple and easy way to interact with GraspDP datalake.
upload_time2024-06-18 13:51:13
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT License Copyright (c) 2024 Grasp labs Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords grasp-labs python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Grasp Labs AS - Stoa Package

## Overview

The `Stoa` package, developed by Grasp Labs AS, is a core component of our communication and data exchange system. The `Stoa` class offers essential functionalities for fetching, signing, authenticating, and ordering messages. These operations are fundamental for ensuring the integrity, authenticity, and proper sequencing of messages within our system.

## Installation

You can install the `Stoa` package via pip:

```bash
pip install stoa
```

## Usage

Below are examples demonstrating how to utilize the `Stoa` class to handle message operations:

### Initialization

Initialize the `Stoa` class with required parameters:


```python
from stoa import Stoa

stoa = Stoa(
    authentication="oauth2",
    product_group_name="group1",
    product_name="product1",
    workspace="apps",
    owner_id="owner123",
    client_id="your_client_id",
    client_secret="your_client_secret",
)
```

### Authentication

Authenticate using the specified method:

```python
stoa.authenticate()

assert stoa.is_authenticated():
```

### Ordering

Create simple orders to be pre-signed.

```python
order_ids = stoa.order()
print(f"Ordered IDs: {order_ids}")
```


### Signing

Sign order to ensure their integrity and authenticity:

```python
signatures = stoa.sign()
print(f"Signatures: {signatures}")
```

### Fetch

Fetch method automatically handles the order and sign.

    - Authenticate
    - Order
    - Sign
    - Fetch

One can decide output format (default pd.Dataframe).
```python
# Fetch as JSON
fetched_data_json = stoa.fetch(format="json")
print(f"Fetched Data (JSON): {fetched_data_json}")

# Fetch as DataFrame
fetched_data_df = stoa.fetch(format="dataframe")
print(f"Fetched Data (DataFrame):\n{fetched_data_df}")
```


## Class Details

### Stoa Class

The `Stoa` class provides methods for handling messages within our system, including operations for fetching, signing, authenticating, and ordering messages.

#### Constructor

```python
def __init__(
    self,
    authentication: Literal["rest", "oauth2"],
    product_group_name: str,
    product_name: str,
    workspace: Literal["apps", "cart"],
    owner_id: str,
    version: str = "1.0",
    offset: int = 0,
    limit: int = 20,
    ascending: bool = False,
    email: Optional[str] = None,
    password: Optional[str] = None,
    client_id: Optional[str] = None,
    client_secret: Optional[str] = None,
) -> None
```

#### Parameters:

* authentication (str): The authentication method to use ("rest" or "oauth2").
* product_group_name (str): The name of the product group.
* product_name (str): The name of the product.
* workspace (str): The workspace where the product is located ("apps" or "cart").
* owner_id (str): The ID of the product owner.
* version (str): The version of the product (default: "1.0").
* offset (int): The offset for pagination (default: 0).
* limit (int): The limit for pagination (default: 20).
* ascending (bool): Whether to sort in ascending order (default: False).
* email (Optional[str]): The email for REST authentication (default: None).
* password (Optional[str]): The password for REST authentication (default: None).
* client_id (Optional[str]): The client ID for OAuth2 authentication (default: None).
* client_secret (Optional[str]): The client secret for OAuth2 authentication (default: None).

#### Methods

* authenticate() -> None: Authenticates a message to verify its origin.
* is_authenticated() -> bool: Checks if a message is authenticated.
* order() -> List[str]: Orders messages based on predefined rules.
* sign() -> Dict: Signs messages to ensure their integrity and authenticity.
* fetch(format: Literal["json", "dataframe"]) -> Union[List[Dict], pd.DataFrame]: Fetches messages in the specified form


## License

This package is licensed under the MIT License.


## Contact
For further information or assistance, please contact `Grasp Labs AS` support at hello@grasplabs.com.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "ds-stoa",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "Kristoffer Varslott <kristoffer@grasplabs.no>",
    "keywords": "grasp-labs, python",
    "author": null,
    "author_email": "Kristoffer Varslott <kristoffer@grasplabs.no>",
    "download_url": "https://files.pythonhosted.org/packages/36/c9/5fbb99129fd421c86e1953222ecd074f0b46b819d3dc646f803eb5b3613e/ds_stoa-0.1.1.tar.gz",
    "platform": null,
    "description": "# Grasp Labs AS - Stoa Package\n\n## Overview\n\nThe `Stoa` package, developed by Grasp Labs AS, is a core component of our communication and data exchange system. The `Stoa` class offers essential functionalities for fetching, signing, authenticating, and ordering messages. These operations are fundamental for ensuring the integrity, authenticity, and proper sequencing of messages within our system.\n\n## Installation\n\nYou can install the `Stoa` package via pip:\n\n```bash\npip install stoa\n```\n\n## Usage\n\nBelow are examples demonstrating how to utilize the `Stoa` class to handle message operations:\n\n### Initialization\n\nInitialize the `Stoa` class with required parameters:\n\n\n```python\nfrom stoa import Stoa\n\nstoa = Stoa(\n    authentication=\"oauth2\",\n    product_group_name=\"group1\",\n    product_name=\"product1\",\n    workspace=\"apps\",\n    owner_id=\"owner123\",\n    client_id=\"your_client_id\",\n    client_secret=\"your_client_secret\",\n)\n```\n\n### Authentication\n\nAuthenticate using the specified method:\n\n```python\nstoa.authenticate()\n\nassert stoa.is_authenticated():\n```\n\n### Ordering\n\nCreate simple orders to be pre-signed.\n\n```python\norder_ids = stoa.order()\nprint(f\"Ordered IDs: {order_ids}\")\n```\n\n\n### Signing\n\nSign order to ensure their integrity and authenticity:\n\n```python\nsignatures = stoa.sign()\nprint(f\"Signatures: {signatures}\")\n```\n\n### Fetch\n\nFetch method automatically handles the order and sign.\n\n    - Authenticate\n    - Order\n    - Sign\n    - Fetch\n\nOne can decide output format (default pd.Dataframe).\n```python\n# Fetch as JSON\nfetched_data_json = stoa.fetch(format=\"json\")\nprint(f\"Fetched Data (JSON): {fetched_data_json}\")\n\n# Fetch as DataFrame\nfetched_data_df = stoa.fetch(format=\"dataframe\")\nprint(f\"Fetched Data (DataFrame):\\n{fetched_data_df}\")\n```\n\n\n## Class Details\n\n### Stoa Class\n\nThe `Stoa` class provides methods for handling messages within our system, including operations for fetching, signing, authenticating, and ordering messages.\n\n#### Constructor\n\n```python\ndef __init__(\n    self,\n    authentication: Literal[\"rest\", \"oauth2\"],\n    product_group_name: str,\n    product_name: str,\n    workspace: Literal[\"apps\", \"cart\"],\n    owner_id: str,\n    version: str = \"1.0\",\n    offset: int = 0,\n    limit: int = 20,\n    ascending: bool = False,\n    email: Optional[str] = None,\n    password: Optional[str] = None,\n    client_id: Optional[str] = None,\n    client_secret: Optional[str] = None,\n) -> None\n```\n\n#### Parameters:\n\n* authentication (str): The authentication method to use (\"rest\" or \"oauth2\").\n* product_group_name (str): The name of the product group.\n* product_name (str): The name of the product.\n* workspace (str): The workspace where the product is located (\"apps\" or \"cart\").\n* owner_id (str): The ID of the product owner.\n* version (str): The version of the product (default: \"1.0\").\n* offset (int): The offset for pagination (default: 0).\n* limit (int): The limit for pagination (default: 20).\n* ascending (bool): Whether to sort in ascending order (default: False).\n* email (Optional[str]): The email for REST authentication (default: None).\n* password (Optional[str]): The password for REST authentication (default: None).\n* client_id (Optional[str]): The client ID for OAuth2 authentication (default: None).\n* client_secret (Optional[str]): The client secret for OAuth2 authentication (default: None).\n\n#### Methods\n\n* authenticate() -> None: Authenticates a message to verify its origin.\n* is_authenticated() -> bool: Checks if a message is authenticated.\n* order() -> List[str]: Orders messages based on predefined rules.\n* sign() -> Dict: Signs messages to ensure their integrity and authenticity.\n* fetch(format: Literal[\"json\", \"dataframe\"]) -> Union[List[Dict], pd.DataFrame]: Fetches messages in the specified form\n\n\n## License\n\nThis package is licensed under the MIT License.\n\n\n## Contact\nFor further information or assistance, please contact `Grasp Labs AS` support at hello@grasplabs.com.\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Grasp labs  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "A python package for GraspDP Stoa. Simple and easy way to interact with GraspDP datalake.",
    "version": "0.1.1",
    "project_urls": {
        "Changelog": "https://github.com/grasp-labs/ds-stoa/blob/main/CHANGELOG.md",
        "Documentation": "https://grasp-labs.github.io/ds-stoa/",
        "Homepage": "https://graspdp.com/",
        "Issues": "https://github.com/grasp-labs/ds-stoa/issues/",
        "Repository": "https://github.com/grasp-labs/ds-stoa/"
    },
    "split_keywords": [
        "grasp-labs",
        " python"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "17b66fbd407f4256388a1811bcda38fd05cda51237d8233679ec0025b8ba4798",
                "md5": "09a03cacf193f6ade05439f60053573c",
                "sha256": "8860175761d0d84418878a717ae4a1ad2e4b896af0d0b08bd9b5ba679f3ba18f"
            },
            "downloads": -1,
            "filename": "ds_stoa-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "09a03cacf193f6ade05439f60053573c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 22567,
            "upload_time": "2024-06-18T13:51:10",
            "upload_time_iso_8601": "2024-06-18T13:51:10.261029Z",
            "url": "https://files.pythonhosted.org/packages/17/b6/6fbd407f4256388a1811bcda38fd05cda51237d8233679ec0025b8ba4798/ds_stoa-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "36c95fbb99129fd421c86e1953222ecd074f0b46b819d3dc646f803eb5b3613e",
                "md5": "846c80bc0a4805a1087229d95c9ccbc1",
                "sha256": "5e17594f2ff6750c39abe4fd2a1ffdcb93b9d76b0a856372a528f0011f25d480"
            },
            "downloads": -1,
            "filename": "ds_stoa-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "846c80bc0a4805a1087229d95c9ccbc1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 18371,
            "upload_time": "2024-06-18T13:51:13",
            "upload_time_iso_8601": "2024-06-18T13:51:13.700452Z",
            "url": "https://files.pythonhosted.org/packages/36/c9/5fbb99129fd421c86e1953222ecd074f0b46b819d3dc646f803eb5b3613e/ds_stoa-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-18 13:51:13",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "grasp-labs",
    "github_project": "ds-stoa",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "ds-stoa"
}
        
Elapsed time: 0.28233s