Google-Group-Admin-API
A Python library for managing Google Cloud Platform (GCP) groups through the Google Workspace Directory API. This tool allows easy and efficient group management within Google Workspace, including adding members to groups, retrieving group information, listing all groups in a domain, and creating new groups.
Features
- Add Members to Groups: Easily add users to specific Google Workspace groups with designated roles.
- Get Group Information: Retrieve detailed information about specific groups.
- List Groups: List all groups within a specified Google Workspace domain.
- Create Groups: Facilitate the creation of new groups within the Google Workspace.
Prerequisites
- Python 3.6 or higher
- Google Workspace domain with admin access
- Google Cloud Platform project with the Admin SDK API enabled
- Service account with domain-wide delegation and the necessary permissions
Installation
Clone the repository to your local machine:
git clone https://github.com/martialo12/Google-Group-Admin-API
cd Google-Group-Admin-API
Install the require dependencies
pip install -r requirements.txt
Usage
First, set up your Google Workspace configuration:
from google_workspace_group_manager import GoogleWorkspaceConfig, GoogleWorkspaceGroupManager
scopes = ['https://www.googleapis.com/auth/admin.directory.group']
config = GoogleWorkspaceConfig('path_to_service_account.json', scopes)
group_manager = GoogleWorkspaceGroupManager(config)
Examples
Adding a member to a group:
group_manager.add_member_to_group('group@example.com', 'member@example.com', 'MEMBER')
Retrieving information about a group:
group_info = group_manager.get_group_info('group@example.com')
Listing all groups in a domain:
groups = group_manager.list_google_workspace_groups('example.com')
Creating a new group:
new_group = group_manager.create_group('newgroup@example.com', 'New Group', 'Description')
Contributing
Contributions are welcome! Please read our Contributing Guide for more information.
## License This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgements
Metadata
Release files for Google-Group-Admin-API 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| Google-Group-Admin-API-1.0.0.tar.gz | 4.9 kB | Without provenance | Details for Google-Group-Admin-API-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| Google_Group_Admin_API-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for Google_Group_Admin_API-1.0.0-py3-none-any.whl |
Total release size: 11.2 kB
Release files / Google-Group-Admin-API-1.0.0.tar.gz
| Download URL | Google-Group-Admin-API-1.0.0.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e33efa2c18bbdf9da169898557c2978e85b4db120e0d2bd4fb828b515d64200d
|
|
BLAKE2b-256 checksum How to use checksums |
a7416dcb424652abe477980ba7a2db71f5af98a504e2118a0fb16ae8def11db8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.13
|
Release files / Google_Group_Admin_API-1.0.0-py3-none-any.whl
| Download URL | Google_Group_Admin_API-1.0.0-py3-none-any.whl |
|---|---|
| Size | 6.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
992d036ff879dc9a59c47db7b375c503a87c7ed3ddbac5f2bbf6c78c4eafa4b5
|
|
BLAKE2b-256 checksum How to use checksums |
a43580aea4692a822b4cb9e55a0df8fe0f62faf371ab11c84ee01d49bb0492ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.13
|
Security for Google-Group-Admin-API 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.