xboto


Namexboto JSON
Version 1.1.1 PyPI version JSON
download
home_pagehttps://github.com/xyngular/py-xboto
SummaryEasy lazy dependency injection for boto3 clients/resources.
upload_time2023-07-03 21:58:09
maintainer
docs_urlNone
authorJosh Orr
requires_python>=3.8,<4.0
license
keywords boto boto client boto resource inject lazy dependency dependency injection aws
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![PythonSupport](https://img.shields.io/static/v1?label=python&message=%203.8|%203.9|%203.10|%203.11&color=blue?style=flat-square&logo=python)
![PyPI version](https://badge.fury.io/py/xboto.svg?)

## Documentation

**[📄 Detailed Documentation](https://xyngular.github.io/py-xboto/latest/)** | **[🐍 PyPi](https://pypi.org/project/xboto/)**

## Install

```bash
# via pip
pip install xboto

# via poetry
poetry add xboto
```

## Quick Start

### Import Boto Client/Resource

```python

# Use imported `dynamodb` just like dynamodb boto resource
from xboto.resource import dynamodb

# Use imported `ssm` just like ssm boto client
from xboto.client import ssm

# These are for overriding/injecting settings.
from xboto import BotoResources, BotoClients, BotoSession

# Can use them like normal:
dynamodb.table(...)
ssm.get_object(...)


# Or you can override settings if you wish:
with BotoResources.DynamoDB(region_name='us-west-2'):
    # Use us-west-2 when using dynamodb boto resource:
    dynamodb.table(...)

with BotoClients.Ssm(region_name='us-west-2'):
    # Use us-west-2 when using ssm boto client:
    ssm.get_object(...)

with BotoSession(region_name='us-west-3'):
    # Use us-west-3 when using any client/resource
    # we are setting it at the boto-session level;
    # the session is used by all boto client/resources.
    ssm.get_object(...)

    
# Can use them like decorators as well:
@BotoClients.Ssm(region_name='us-west-2')
def some_method():
    ssm.get_object(...)

```

### Grab Any Client/Resource

```python

# Can easily ask these for any client/resource
from xboto import boto_clients, boto_resources

# These are for overriding/injecting settings.
from xboto import BotoResources, BotoClients, BotoSession

# Can use them like normal:
boto_clients.dynamodb.table(...)
boto_resources.ssm.get_object(...)


# Or you can override settings if you wish:
with BotoResources.DynamoDB(region_name='us-west-2'):
    # Use us-west-2 when using dynamodb boto resource:
    boto_resources.dynamodb.table(...)

with BotoClients.Ssm(region_name='us-west-2'):
    # Use us-west-2 when using ssm boto client:
    boto_clients.ssm.get_object(...)

with BotoSession(region_name='us-west-3'):
    # Use us-west-3 when using any client/resource
    # we are setting it at the boto-session level;
    # the session is used by all boto client/resources.
    boto_clients.ssm.get_object(...)

    
# Can use them like decorators as well:
@BotoClients.Ssm(region_name='us-west-2')
def some_method():
    boto_clients.ssm.get_object(...)

```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/xyngular/py-xboto",
    "name": "xboto",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "boto,boto client,boto resource,inject,lazy,dependency,dependency injection,aws",
    "author": "Josh Orr",
    "author_email": "josh@orr.blue",
    "download_url": "https://files.pythonhosted.org/packages/e3/67/56eb7999dc35b388bba47931b6e07b0e48cbf27beed340c9d930825c7a71/xboto-1.1.1.tar.gz",
    "platform": null,
    "description": "![PythonSupport](https://img.shields.io/static/v1?label=python&message=%203.8|%203.9|%203.10|%203.11&color=blue?style=flat-square&logo=python)\n![PyPI version](https://badge.fury.io/py/xboto.svg?)\n\n## Documentation\n\n**[\ud83d\udcc4 Detailed Documentation](https://xyngular.github.io/py-xboto/latest/)** | **[\ud83d\udc0d PyPi](https://pypi.org/project/xboto/)**\n\n## Install\n\n```bash\n# via pip\npip install xboto\n\n# via poetry\npoetry add xboto\n```\n\n## Quick Start\n\n### Import Boto Client/Resource\n\n```python\n\n# Use imported `dynamodb` just like dynamodb boto resource\nfrom xboto.resource import dynamodb\n\n# Use imported `ssm` just like ssm boto client\nfrom xboto.client import ssm\n\n# These are for overriding/injecting settings.\nfrom xboto import BotoResources, BotoClients, BotoSession\n\n# Can use them like normal:\ndynamodb.table(...)\nssm.get_object(...)\n\n\n# Or you can override settings if you wish:\nwith BotoResources.DynamoDB(region_name='us-west-2'):\n    # Use us-west-2 when using dynamodb boto resource:\n    dynamodb.table(...)\n\nwith BotoClients.Ssm(region_name='us-west-2'):\n    # Use us-west-2 when using ssm boto client:\n    ssm.get_object(...)\n\nwith BotoSession(region_name='us-west-3'):\n    # Use us-west-3 when using any client/resource\n    # we are setting it at the boto-session level;\n    # the session is used by all boto client/resources.\n    ssm.get_object(...)\n\n    \n# Can use them like decorators as well:\n@BotoClients.Ssm(region_name='us-west-2')\ndef some_method():\n    ssm.get_object(...)\n\n```\n\n### Grab Any Client/Resource\n\n```python\n\n# Can easily ask these for any client/resource\nfrom xboto import boto_clients, boto_resources\n\n# These are for overriding/injecting settings.\nfrom xboto import BotoResources, BotoClients, BotoSession\n\n# Can use them like normal:\nboto_clients.dynamodb.table(...)\nboto_resources.ssm.get_object(...)\n\n\n# Or you can override settings if you wish:\nwith BotoResources.DynamoDB(region_name='us-west-2'):\n    # Use us-west-2 when using dynamodb boto resource:\n    boto_resources.dynamodb.table(...)\n\nwith BotoClients.Ssm(region_name='us-west-2'):\n    # Use us-west-2 when using ssm boto client:\n    boto_clients.ssm.get_object(...)\n\nwith BotoSession(region_name='us-west-3'):\n    # Use us-west-3 when using any client/resource\n    # we are setting it at the boto-session level;\n    # the session is used by all boto client/resources.\n    boto_clients.ssm.get_object(...)\n\n    \n# Can use them like decorators as well:\n@BotoClients.Ssm(region_name='us-west-2')\ndef some_method():\n    boto_clients.ssm.get_object(...)\n\n```\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Easy lazy dependency injection for boto3 clients/resources.",
    "version": "1.1.1",
    "project_urls": {
        "Homepage": "https://github.com/xyngular/py-xboto",
        "Repository": "https://github.com/xyngular/py-xboto"
    },
    "split_keywords": [
        "boto",
        "boto client",
        "boto resource",
        "inject",
        "lazy",
        "dependency",
        "dependency injection",
        "aws"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7ef3571e34c8c6a0cb15062bf6427c8a12cf99021d297ee1a5ffb69806698049",
                "md5": "eaa8fd728359dd78ecce5eddaca30ab7",
                "sha256": "822f2d4f9c1a60e1679d53f0ae56ec96f2d08f48044f23f1e2d9435d6b75cf7e"
            },
            "downloads": -1,
            "filename": "xboto-1.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "eaa8fd728359dd78ecce5eddaca30ab7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 17188,
            "upload_time": "2023-07-03T21:58:07",
            "upload_time_iso_8601": "2023-07-03T21:58:07.808739Z",
            "url": "https://files.pythonhosted.org/packages/7e/f3/571e34c8c6a0cb15062bf6427c8a12cf99021d297ee1a5ffb69806698049/xboto-1.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e36756eb7999dc35b388bba47931b6e07b0e48cbf27beed340c9d930825c7a71",
                "md5": "3e0452b57749da882779cfd361ab39f3",
                "sha256": "203151c7e272c89e89d788ba4a955b7eb4158dbedd35e4a4a87df5be5cae3088"
            },
            "downloads": -1,
            "filename": "xboto-1.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "3e0452b57749da882779cfd361ab39f3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 16645,
            "upload_time": "2023-07-03T21:58:09",
            "upload_time_iso_8601": "2023-07-03T21:58:09.236316Z",
            "url": "https://files.pythonhosted.org/packages/e3/67/56eb7999dc35b388bba47931b6e07b0e48cbf27beed340c9d930825c7a71/xboto-1.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-03 21:58:09",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "xyngular",
    "github_project": "py-xboto",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "xboto"
}
        
Elapsed time: 0.11170s