# aws_org_client
[![push](https://github.com/alphagov/aws_org_client/actions/workflows/push.yml/badge.svg?branch=main)](https://github.com/alphagov/aws_org_client/actions/workflows/push.yml) [![release](https://github.com/alphagov/aws_org_client/actions/workflows/release.yml/badge.svg)](https://github.com/alphagov/aws_org_client/actions/workflows/release.yml) [![documentation](https://github.com/alphagov/aws_org_client/actions/workflows/documentation.yml/badge.svg?branch=main)](https://github.com/alphagov/aws_org_client/actions/workflows/documentation.yml)
[![pypi](https://img.shields.io/pypi/v/aws_org_client?color=blue&label=pypi)](https://pypi.org/project/aws-org-client) [![github pages](https://img.shields.io/badge/GitHub%20Pages-222222?style=flat&logo=GitHub%20Pages&logoColor=white)](https://ideal-broccoli-37v9kn4.pages.github.io/index.html)
## Contents
* [Overview](#overview)
* [Example Usage](#example-usage)
* [Development](#development)
## Overview
This project is a python package, aimed at providing a simple interface with AWS
organisation & identity services.
Using boto3 clients:
* identitystore
* organizations
* sso-admin
## Example Usage
Setup boto session & initialise organisations client to list accounts.
```python
import boto3
from aws_org_client.organizations import Organizations
session = boto3.Session(profile_name='my_profile', region_name='my_region')
client = Organizations()
client.list_accounts()
```
Example response:
```json
[
{
"Id": "string",
"Arn": "string",
"Email": "string",
"Name": "string",
"Status": "ACTIVE",
"JoinedMethod": "CREATED",
"JoinedTimestamp": datetime.datetime(1970, 1, 1, 00, 00, 00, 000000, tzinfo=tzlocal())
}
]
```
## Development
### Requirements
* Install [python poetry](https://python-poetry.org/docs/#installation).
* You will need a working aws profile configured in your filesystem.
### Setup
Initialise a poetry environment:
```bash
poetry shell
```
Install dependencies:
```bash
poetry install
```
### Project processes
#### Coverage report
run coverage report:
```bash
poetry run coverage run -m --source=aws_org_client pytest tests
poetry run coverage report
```
#### Linting
run pylint with:
```bash
poetry run pylint aws_org_client
poetry run pylint tests
```
#### Formatting
run black formatter with:
```bash
poetry run black .
```
#### SAST
run bandit scanner:
```bash
poetry run bandit .
```
#### Documentation
this project uses sphinx to produce a static html site; published to
github pages.
[github actions takes care of building the site & publishing it.](.github/workflows/documentation.yml)
to update the files used to build documentation use:
```bash
poetry run sphinx-apidoc --ext-autodoc -f -o docs .
```
include any changes to the docs directory
##### Build Documentation locally
you may wish to build documentation locally before publishing it.
form the project root run:
```bash
poetry run sphinx-build docs _build
```
this will create directory ```_build``` in the project root where you can load
html in your browser.
Raw data
{
"_id": null,
"home_page": "https://github.com/hackersandslackers/python-poetry-tutorial/",
"name": "aws-org-client",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.11",
"maintainer_email": null,
"keywords": "AWS, Identity Store, Organizations, SSO",
"author": "Sam Holden",
"author_email": "sam.holden@digital.cabinet-office.gov.uk",
"download_url": "https://files.pythonhosted.org/packages/80/13/ffe3d5577d4d3e06fb3f5871459471ee32064be82acdbb63e4868abf4ac1/aws_org_client-0.0.17.tar.gz",
"platform": null,
"description": "# aws_org_client\n\n[![push](https://github.com/alphagov/aws_org_client/actions/workflows/push.yml/badge.svg?branch=main)](https://github.com/alphagov/aws_org_client/actions/workflows/push.yml) [![release](https://github.com/alphagov/aws_org_client/actions/workflows/release.yml/badge.svg)](https://github.com/alphagov/aws_org_client/actions/workflows/release.yml) [![documentation](https://github.com/alphagov/aws_org_client/actions/workflows/documentation.yml/badge.svg?branch=main)](https://github.com/alphagov/aws_org_client/actions/workflows/documentation.yml) \n\n[![pypi](https://img.shields.io/pypi/v/aws_org_client?color=blue&label=pypi)](https://pypi.org/project/aws-org-client) [![github pages](https://img.shields.io/badge/GitHub%20Pages-222222?style=flat&logo=GitHub%20Pages&logoColor=white)](https://ideal-broccoli-37v9kn4.pages.github.io/index.html)\n\n\n## Contents\n* [Overview](#overview)\n* [Example Usage](#example-usage)\n* [Development](#development)\n\n\n## Overview\nThis project is a python package, aimed at providing a simple interface with AWS\norganisation & identity services.\n\nUsing boto3 clients:\n * identitystore\n * organizations\n * sso-admin\n\n\n## Example Usage\nSetup boto session & initialise organisations client to list accounts.\n```python\n import boto3\n from aws_org_client.organizations import Organizations\n session = boto3.Session(profile_name='my_profile', region_name='my_region')\n client = Organizations()\n client.list_accounts()\n```\n\nExample response:\n```json\n [\n {\n \"Id\": \"string\", \n \"Arn\": \"string\", \n \"Email\": \"string\", \n \"Name\": \"string\", \n \"Status\": \"ACTIVE\", \n \"JoinedMethod\": \"CREATED\", \n \"JoinedTimestamp\": datetime.datetime(1970, 1, 1, 00, 00, 00, 000000, tzinfo=tzlocal()) \n }\n ]\n```\n\n\n## Development\n### Requirements\n* Install [python poetry](https://python-poetry.org/docs/#installation).\n* You will need a working aws profile configured in your filesystem. \n\n### Setup\nInitialise a poetry environment:\n```bash\n poetry shell\n```\n\nInstall dependencies:\n```bash\n poetry install\n```\n\n### Project processes\n#### Coverage report\nrun coverage report:\n```bash\n poetry run coverage run -m --source=aws_org_client pytest tests\n poetry run coverage report\n```\n\n#### Linting\nrun pylint with:\n```bash\n poetry run pylint aws_org_client\n poetry run pylint tests\n```\n\n#### Formatting\nrun black formatter with:\n```bash\n poetry run black .\n```\n\n#### SAST\nrun bandit scanner:\n```bash\n poetry run bandit .\n```\n\n#### Documentation\nthis project uses sphinx to produce a static html site; published to \ngithub pages.\n\n[github actions takes care of building the site & publishing it.](.github/workflows/documentation.yml)\n\nto update the files used to build documentation use:\n\n```bash\n poetry run sphinx-apidoc --ext-autodoc -f -o docs .\n```\n\ninclude any changes to the docs directory \n\n##### Build Documentation locally\nyou may wish to build documentation locally before publishing it.\n\nform the project root run: \n```bash\n poetry run sphinx-build docs _build\n```\n\nthis will create directory ```_build``` in the project root where you can load\nhtml in your browser.",
"bugtrack_url": null,
"license": null,
"summary": "Browse and manage AWS identity and organization resources.",
"version": "0.0.17",
"project_urls": {
"Documentation": "https://hackersandslackers.com/python-poetry/",
"Homepage": "https://github.com/hackersandslackers/python-poetry-tutorial/",
"Repository": "https://github.com/hackersandslackers/python-poetry-tutorial/"
},
"split_keywords": [
"aws",
" identity store",
" organizations",
" sso"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b1d0e618b6dbe7e02b0be8c7ffe0f2d21b3f900c9471d81152e0135774e17dbb",
"md5": "371d35545f41300e8f24a1508e8622ef",
"sha256": "50f32884380dc1404c476d8419a92463bde9f331299907278fe8007c3ef54dc5"
},
"downloads": -1,
"filename": "aws_org_client-0.0.17-py3-none-any.whl",
"has_sig": false,
"md5_digest": "371d35545f41300e8f24a1508e8622ef",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.11",
"size": 10686,
"upload_time": "2025-01-02T13:41:58",
"upload_time_iso_8601": "2025-01-02T13:41:58.999015Z",
"url": "https://files.pythonhosted.org/packages/b1/d0/e618b6dbe7e02b0be8c7ffe0f2d21b3f900c9471d81152e0135774e17dbb/aws_org_client-0.0.17-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8013ffe3d5577d4d3e06fb3f5871459471ee32064be82acdbb63e4868abf4ac1",
"md5": "44205dc666b63084f15b862521339291",
"sha256": "e24cfdca0ba732564c77a3dfcc751adc2c12247042fe06a84a09bbc8e997d013"
},
"downloads": -1,
"filename": "aws_org_client-0.0.17.tar.gz",
"has_sig": false,
"md5_digest": "44205dc666b63084f15b862521339291",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.11",
"size": 8939,
"upload_time": "2025-01-02T13:42:00",
"upload_time_iso_8601": "2025-01-02T13:42:00.773514Z",
"url": "https://files.pythonhosted.org/packages/80/13/ffe3d5577d4d3e06fb3f5871459471ee32064be82acdbb63e4868abf4ac1/aws_org_client-0.0.17.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-02 13:42:00",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "hackersandslackers",
"github_project": "python-poetry-tutorial",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "attrs",
"specs": [
[
"==",
"20.1.0"
]
]
},
{
"name": "loguru",
"specs": [
[
"==",
"0.5.3"
]
]
},
{
"name": "more-itertools",
"specs": [
[
"==",
"8.5.0"
]
]
},
{
"name": "packaging",
"specs": [
[
"==",
"20.4"
]
]
},
{
"name": "pluggy",
"specs": [
[
"==",
"0.13.1"
]
]
},
{
"name": "psutil",
"specs": [
[
"==",
"5.7.2"
]
]
},
{
"name": "py",
"specs": [
[
"==",
"1.9.0"
]
]
},
{
"name": "pyparsing",
"specs": [
[
"==",
"2.4.7"
]
]
},
{
"name": "pytest",
"specs": [
[
"==",
"6.0.1"
]
]
},
{
"name": "six",
"specs": [
[
"==",
"1.15.0"
]
]
},
{
"name": "wcwidth",
"specs": [
[
"==",
"0.2.5"
]
]
}
],
"lcname": "aws-org-client"
}