semvec/pypi-packages huggingface dataset:
carboncue-sdk 1.1.0
Core SDK for carbon-aware computing
License: MIT
Requires Python: >=3.11

# CarbonCue SDK

Core Python SDK for carbon-aware computing based on Green Software Foundation (GSF) principles.

## Features

- 🌍 Real-time carbon intensity data from Electricity Maps
- 📊 SCI (Software Carbon Intensity) score calculation per GSF specification
- ⚡ Async/await support for high-performance applications
- 🔌 Extensible API client architecture
- 💾 Built-in caching to reduce API calls
- 🎯 Type-safe with Pydantic models

## Installation

```bash
pip install carboncue-sdk
```

## Quick Start

```python
import asyncio
from carboncue_sdk import CarbonClient

async def main():
    async with CarbonClient() as client:
        # Get current carbon intensity
        intensity = await client.get_current_intensity(
            region="us-west-2",
            provider="aws"
        )
        print(f"Current intensity: {intensity.carbon_intensity} gCO2eq/kWh")

        # Calculate SCI score
        sci = client.calculate_sci(
            operational_emissions=100.0,  # gCO2eq from energy usage
            embodied_emissions=50.0,      # gCO2eq from hardware
            functional_unit=1000,         # Number of requests
            functional_unit_type="requests",
            region="us-west-2"
        )
        print(f"SCI Score: {sci.score} gCO2eq/request")

asyncio.run(main())
```

## Configuration

Set environment variables with `CARBONCUE_` prefix:

```bash
export CARBONCUE_ELECTRICITY_MAPS_API_KEY=your_api_key
export CARBONCUE_DEFAULT_REGION=us-west-2
export CARBONCUE_CACHE_TTL_SECONDS=300
```

Or use a `.env` file:

```env
CARBONCUE_ELECTRICITY_MAPS_API_KEY=your_api_key
CARBONCUE_DEFAULT_REGION=us-west-2
```

## SCI Calculation

Implements the GSF Software Carbon Intensity specification:

```
SCI = (O + M) / R

Where:
  O = Operational emissions (energy consumption × carbon intensity)
  M = Embodied emissions (hardware manufacturing & infrastructure)
  R = Functional unit (requests, users, transactions, etc.)
```

## API Reference

### CarbonClient

Main client for carbon-awareness operations.

**Methods:**
- `get_current_intensity(region, provider)` - Get real-time carbon intensity
- `calculate_sci(...)` - Calculate SCI score per GSF spec
- `close()` - Cleanup resources

### Models

- `CarbonIntensity` - Carbon intensity data with timestamp
- `SCIScore` - Complete SCI calculation result
- `Region` - Cloud region information
- `EmissionsBreakdown` - Detailed emissions breakdown

## Development

```bash
# Install in development mode
cd packages/sdk
pip install -e ".[dev]"

# Run tests
pytest

# Type checking
mypy src/
```

## License

MIT License - see LICENSE file for details.
carboncue-cli 1.1.0
Terminal interface for carbon-aware development
License: MIT
Requires Python: >=3.11

# CarbonCue CLI

Terminal interface for carbon-aware development.

## Installation

```bash
pip install carboncue-cli
```

## Commands

### Check Carbon Intensity

Get current carbon intensity for a cloud region:

```bash
# AWS US West 2
carboncue check --region us-west-2 --provider aws

# Azure West Europe
carboncue check --region westeurope --provider azure

# Short form
carboncue check -r us-east-1 -p aws
```

### Calculate SCI Score

Calculate Software Carbon Intensity (SCI) score:

```bash
carboncue sci \
  --operations 100 \
  --materials 50 \
  --functional-unit 1000 \
  --unit-type requests \
  --region us-west-2

# Short form
carboncue sci -o 100 -m 50 -r 1000 -t requests
```

**Parameters:**
- `--operations, -o`: Operational emissions in gCO2eq (energy usage)
- `--materials, -m`: Embodied emissions in gCO2eq (hardware)
- `--functional-unit, -r`: Number of functional units
- `--unit-type, -t`: Type of functional unit (requests, users, transactions, etc.)
- `--region`: Cloud region (default: us-west-2)
- `--provider, -p`: Cloud provider (aws, azure, gcp, etc.)

### View Configuration

```bash
carboncue config
```

## Configuration

Set environment variables:

```bash
export CARBONCUE_ELECTRICITY_MAPS_API_KEY=your_api_key
export CARBONCUE_DEFAULT_REGION=us-west-2
export CARBONCUE_DEFAULT_CLOUD_PROVIDER=aws
```

Or create a `.env` file in your project:

```env
CARBONCUE_ELECTRICITY_MAPS_API_KEY=your_api_key
CARBONCUE_DEFAULT_REGION=us-west-2
```

## Examples

### CI/CD Integration

```bash
# Check if carbon intensity is low before running expensive tests
INTENSITY=$(carboncue check -r us-west-2 -p aws --json | jq '.carbon_intensity')
if [ $INTENSITY -lt 200 ]; then
  echo "Low carbon intensity - running full test suite"
  pytest
else
  echo "High carbon intensity - deferring non-critical tests"
  pytest -m critical
fi
```

### Monitoring Scripts

```bash
#!/bin/bash
# monitor-carbon.sh - Check carbon intensity every hour

while true; do
  carboncue check -r us-west-2 -p aws
  sleep 3600
done
```

## Output Formats

All commands support rich terminal output with colors and tables for better readability.

## License

MIT License - see LICENSE file for details.
echopykits12 0.1.0
My short description for my project.
License: MIT
Requires Python: >=3.6.0


📦 setup.py (for humans)
=======================

This repo exists to provide [an example setup.py] file, that can be used
to bootstrap your next Python project. It includes some advanced
patterns and best practices for `setup.py`, as well as some
commented–out nice–to–haves.

For example, this `setup.py` provides a `$ python setup.py upload`
command, which creates a *universal wheel* (and *sdist*) and uploads
your package to [PyPi] using [Twine], without the need for an annoying
`setup.cfg` file. It also creates/uploads a new git tag, automatically.

In short, `setup.py` files can be daunting to approach, when first
starting out — even Guido has been heard saying, "everyone cargo cults
thems". It's true — so, I want this repo to be the best place to
copy–paste from :)

[Check out the example!][an example setup.py]

Installation
-----

```bash
cd your_project

# Download the setup.py file:
#  download with wget
wget https://raw.githubusercontent.com/navdeep-G/setup.py/master/setup.py -O setup.py

#  download with curl
curl -O https://raw.githubusercontent.com/navdeep-G/setup.py/master/setup.py
```

To Do
-----

-   Tests via `$ setup.py test` (if it's concise).

Pull requests are encouraged!

More Resources
--------------

-   [What is setup.py?] on Stack Overflow
-   [Official Python Packaging User Guide](https://packaging.python.org)
-   [The Hitchhiker's Guide to Packaging]
-   [Cookiecutter template for a Python package]

License
-------

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any means.

  [an example setup.py]: https://github.com/navdeep-G/setup.py/blob/master/setup.py
  [PyPi]: https://docs.python.org/3/distutils/packageindex.html
  [Twine]: https://pypi.python.org/pypi/twine
  [image]: https://farm1.staticflickr.com/628/33173824932_58add34581_k_d.jpg
  [What is setup.py?]: https://stackoverflow.com/questions/1471994/what-is-setup-py
  [The Hitchhiker's Guide to Packaging]: https://the-hitchhikers-guide-to-packaging.readthedocs.io/en/latest/creation.html
  [Cookiecutter template for a Python package]: https://github.com/audreyr/cookiecutter-pypackage