Metadata-Version: 2.4
Name: cz-common-tools
Version: 1.2.7
Summary: Shared code for CloudZero Tools.
Home-page: https://github.com/Cloudzero/cz-common-tools
Author: CloudZero
Author-email: support@cloudzero.com
License: UNLICENSED
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: boto3
Requires-Dist: boto3-stubs[cloudformation,essential,iam,secretsmanager,sts]
Requires-Dist: cz-common-python>=6.4.0
Requires-Dist: GitPython
Requires-Dist: pydantic>=2.0.0
Requires-Dist: PyGithub
Requires-Dist: pygments
Requires-Dist: requests
Requires-Dist: ruamel.yaml
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: license-file
Dynamic: requires-dist
Dynamic: summary


# cz-common-tools

Shared Python library for CloudZero's internal tooling ecosystem. Provides reusable utilities for AWS, GitHub, Cortex, Sumo Logic, and Rootly integrations, plus a job orchestration framework and organizational structure definitions.

## Features

- **AWS Integration** — Session management, account registry, CloudFormation stack operations (list, filter, delete)
- **GitHub Operations** — Repository search, file management, pull requests, GitHub Actions workflow dispatch
- **HTTP Client** — Configurable `RequestsClient` with retry, pagination, and pre-configured API clients
- **Job Framework** — YAML-configured job orchestration with dimension validation and dry-run support
- **Team Structure** — 15+ team definitions with Slack, GitHub, Cortex, and Sumo Logic mappings

## Installation

```bash
pip install cz-common-tools --extra-index-url <S3_PYPI_URL>
```

## Quick Start

```python
from cztools.aws import get_aws_session, get_current_account_id
from cztools.git import search_code, find_all_feature_repositories
from cztools.cloudformation import get_cfn_stacks, delete_stacks
from cztools.requests_client import RequestsClient, CortexRequestsConfig

# AWS operations
session = get_aws_session()
account_id = get_current_account_id()

# Search GitHub
results = search_code("MakefileConstants.mk org:Cloudzero")

# CloudFormation
stacks = get_cfn_stacks()

# HTTP client with pre-configured API
with RequestsClient(CortexRequestsConfig()) as client:
    teams = client.get_all_pages('/catalog/team')
```

## Development

```bash
git clone --recurse-submodules git@github.com:Cloudzero/cz-common-tools.git
cd cz-common-tools
make init
make test
```

## Documentation

- [Architecture](docs/project/ARCHITECTURE.md) — System design and component overview
- [Usage](docs/project/USAGE.md) — Development setup, workflows, and troubleshooting
- [Testing](docs/project/TESTING.md) — Testing strategy and conventions
- [Changelog](docs/project/CHANGELOG.md) — Version history
- [Capabilities](docs/project/CAPABILITIES.md) — Feature inventory

## Ownership

Maintained by `@cloudzero/nimbus`. See [CODEOWNERS](.github/CODEOWNERS).
