senhasegura


Namesenhasegura JSON
Version 0.1.2 PyPI version JSON
download
home_pageNone
Summary An unofficial module for integrating with SenhaSegura APIs, supporting OAuth1 and OAuth2 authentication. It offers a simple interface for making HTTP requests while ensuring hostname and endpoint validation. Ideal for developers looking to implement password management functionalities securely.
upload_time2024-09-25 21:39:50
maintainerNone
docs_urlNone
authorRicardo Castro
requires_python<4.0,>=3.8
licenseMIT
keywords senhasegura api integration a2a
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # SenhaSegura
## Overview

The A2A module provides an unofficial interface for interacting with the SenhaSegura APIs. This module simplifies the integration of password management functionalities into your applications by offering support for both OAuth1 and OAuth2 authentication methods.
## Features
**Support for HTTP Methods**: Easily make GET, POST, PUT, DELETE, HEAD, OPTIONS, and PATCH requests.
**Hostname Validation**: Ensures that the provided hostname follows standard DNS rules.
**Endpoint Validation**: Validates endpoint strings to prevent malformed URLs.
Dynamic Method Binding: All HTTP methods are dynamically bound, allowing for intuitive usage.
**OAuth Authentication**: Supports **OAuth1** and **OAuth2** for secure API access.
**Error Handling**: Comprehensive error handling for authentication and request parameters.

## Installation

You can use the SenhaSegura using one of the following methods:

pip:
```pip install senhasegura```
Git:
```git clone https://github.com/SrRenks/senhasegura.git```

## Usage

**Initialize the A2A Class**: To create an instance of the A2A module, specify the hostname and authentication parameters:
```
from senhasegura import A2A
import json
with open("oauth1_params.json", "r") as file:
    oauth1_params = json.loads(file.read())
a2a = A2A("senhasegura.construtoratenda.com", "OAuth1", **oauth1_params)
```
**Make API Calls**: Use the instance to call API endpoints with the desired HTTP method:
```
response = a2a.get("/iso/coe/senha", params={"123": 123}, headers={"User-Agent": "example"})
```
**Handle the Response**: You can process the requests.Response as needed:
```
print(response.json())
```

## Example

Here's a complete example of using the A2A module:
```
from senhasegura import A2A
import json

# Load OAuth1 parameters from a JSON file
with open("oauth1_params.json", "r") as file:
    oauth1_params = json.loads(file.read())

# Initialize with your credentials
a2a = A2A("senhasegura.construtoratenda.com", "OAuth1", **oauth1_params)

# Make a GET request
response = a2a.get("/iso/coe/senha", params={"123": 123}, headers={"User-Agent": "example"})

# Print the response
print(response.json())
```
## Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or features you would like to see.

## License
This project is licensed under the MIT License. See the LICENSE file for details.
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "senhasegura",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": null,
    "keywords": "senhasegura, api, integration, a2a",
    "author": "Ricardo Castro",
    "author_email": "srrenks@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/b8/55/db483af4aadaae6dfd8a47beb60259f877054247d6a52dd57ba3ce5992e0/senhasegura-0.1.2.tar.gz",
    "platform": null,
    "description": "# SenhaSegura\n## Overview\n\nThe A2A module provides an unofficial interface for interacting with the SenhaSegura APIs. This module simplifies the integration of password management functionalities into your applications by offering support for both OAuth1 and OAuth2 authentication methods.\n## Features\n**Support for HTTP Methods**: Easily make GET, POST, PUT, DELETE, HEAD, OPTIONS, and PATCH requests.\n**Hostname Validation**: Ensures that the provided hostname follows standard DNS rules.\n**Endpoint Validation**: Validates endpoint strings to prevent malformed URLs.\nDynamic Method Binding: All HTTP methods are dynamically bound, allowing for intuitive usage.\n**OAuth Authentication**: Supports **OAuth1** and **OAuth2** for secure API access.\n**Error Handling**: Comprehensive error handling for authentication and request parameters.\n\n## Installation\n\nYou can use the SenhaSegura using one of the following methods:\n\npip:\n```pip install senhasegura```\nGit:\n```git clone https://github.com/SrRenks/senhasegura.git```\n\n## Usage\n\n**Initialize the A2A Class**: To create an instance of the A2A module, specify the hostname and authentication parameters:\n```\nfrom senhasegura import A2A\nimport json\nwith open(\"oauth1_params.json\", \"r\") as file:\n    oauth1_params = json.loads(file.read())\na2a = A2A(\"senhasegura.construtoratenda.com\", \"OAuth1\", **oauth1_params)\n```\n**Make API Calls**: Use the instance to call API endpoints with the desired HTTP method:\n```\nresponse = a2a.get(\"/iso/coe/senha\", params={\"123\": 123}, headers={\"User-Agent\": \"example\"})\n```\n**Handle the Response**: You can process the requests.Response as needed:\n```\nprint(response.json())\n```\n\n## Example\n\nHere's a complete example of using the A2A module:\n```\nfrom senhasegura import A2A\nimport json\n\n# Load OAuth1 parameters from a JSON file\nwith open(\"oauth1_params.json\", \"r\") as file:\n    oauth1_params = json.loads(file.read())\n\n# Initialize with your credentials\na2a = A2A(\"senhasegura.construtoratenda.com\", \"OAuth1\", **oauth1_params)\n\n# Make a GET request\nresponse = a2a.get(\"/iso/coe/senha\", params={\"123\": 123}, headers={\"User-Agent\": \"example\"})\n\n# Print the response\nprint(response.json())\n```\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request for any improvements or features you would like to see.\n\n## License\nThis project is licensed under the MIT License. See the LICENSE file for details.",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": " An unofficial module for integrating with SenhaSegura APIs, supporting OAuth1 and OAuth2 authentication. It offers a simple interface for making HTTP requests while ensuring hostname and endpoint validation. Ideal for developers looking to implement password management functionalities securely.",
    "version": "0.1.2",
    "project_urls": null,
    "split_keywords": [
        "senhasegura",
        " api",
        " integration",
        " a2a"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ddb69e60890119fd8e341c4ca222a9ae200fd7da3f11be4f39839aaa7df6e34c",
                "md5": "4ff009ff3e3c2705a6c871517a80f709",
                "sha256": "5e235ca0b60ddac058f2a4b3514238424d964cfa2a75a079ac1f33a3828af15f"
            },
            "downloads": -1,
            "filename": "senhasegura-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4ff009ff3e3c2705a6c871517a80f709",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 5226,
            "upload_time": "2024-09-25T21:39:49",
            "upload_time_iso_8601": "2024-09-25T21:39:49.262540Z",
            "url": "https://files.pythonhosted.org/packages/dd/b6/9e60890119fd8e341c4ca222a9ae200fd7da3f11be4f39839aaa7df6e34c/senhasegura-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b855db483af4aadaae6dfd8a47beb60259f877054247d6a52dd57ba3ce5992e0",
                "md5": "018b44ce76ade2ba7643126a1529e714",
                "sha256": "2a631bc5e9f1b69419edcd106e03aa39048d8b143c2687bea252eb667000c005"
            },
            "downloads": -1,
            "filename": "senhasegura-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "018b44ce76ade2ba7643126a1529e714",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 4031,
            "upload_time": "2024-09-25T21:39:50",
            "upload_time_iso_8601": "2024-09-25T21:39:50.448407Z",
            "url": "https://files.pythonhosted.org/packages/b8/55/db483af4aadaae6dfd8a47beb60259f877054247d6a52dd57ba3ce5992e0/senhasegura-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-25 21:39:50",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "senhasegura"
}
        
Elapsed time: 0.61270s