# 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": "",
"docs_url": null,
"requires_python": ">=3.11,<4.0",
"maintainer_email": "",
"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/d7/4e/59b8bfff8f44d4e48542b1628e1f6a3aaef627388808af572b2d2067a231/aws_org_client-0.0.15.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": "",
"summary": "Browse and manage AWS identity and organization resources.",
"version": "0.0.15",
"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": "518b3ef49bc4e15687fc302e271ad287dc6befdd0b1f97894005cdc4f6db25b7",
"md5": "a55feefc24a35df371d8e3f8b1a83e03",
"sha256": "f614a8cb97c8b1553541138a07a573bd77ebd742e124bef7e8271c416e213336"
},
"downloads": -1,
"filename": "aws_org_client-0.0.15-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a55feefc24a35df371d8e3f8b1a83e03",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11,<4.0",
"size": 10677,
"upload_time": "2024-02-28T15:18:42",
"upload_time_iso_8601": "2024-02-28T15:18:42.960030Z",
"url": "https://files.pythonhosted.org/packages/51/8b/3ef49bc4e15687fc302e271ad287dc6befdd0b1f97894005cdc4f6db25b7/aws_org_client-0.0.15-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d74e59b8bfff8f44d4e48542b1628e1f6a3aaef627388808af572b2d2067a231",
"md5": "1def7cce51bf1b1576e1085760fc563e",
"sha256": "5c2fcc711c8602446c064cbbf24c7ae3bca8b97dc4d7693a3f619b07f7d6c6a0"
},
"downloads": -1,
"filename": "aws_org_client-0.0.15.tar.gz",
"has_sig": false,
"md5_digest": "1def7cce51bf1b1576e1085760fc563e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11,<4.0",
"size": 8724,
"upload_time": "2024-02-28T15:18:44",
"upload_time_iso_8601": "2024-02-28T15:18:44.687928Z",
"url": "https://files.pythonhosted.org/packages/d7/4e/59b8bfff8f44d4e48542b1628e1f6a3aaef627388808af572b2d2067a231/aws_org_client-0.0.15.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-28 15:18:44",
"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": [],
"lcname": "aws-org-client"
}