Metadata-Version: 2.4
Name: tokenpal
Version: 0.1.0
Summary: Your friendly token counting pal for OpenAI, Anthropic, and Google LLM models. Simple, accurate, fast.
Author-email: TokenPal Team <contact@tokenpal.dev>
License-Expression: MIT
Project-URL: Homepage, https://github.com/tokenpal/tokenpal
Project-URL: Repository, https://github.com/tokenpal/tokenpal
Project-URL: Documentation, https://github.com/tokenpal/tokenpal#readme
Project-URL: Bug Reports, https://github.com/tokenpal/tokenpal/issues
Keywords: tokens,tokenizer,openai,anthropic,google,llm,chatgpt,gpt,claude,gemini,ai,machine-learning,nlp
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Text Processing :: Linguistic
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: tiktoken>=0.7.0
Provides-Extra: anthropic
Requires-Dist: anthropic>=0.34.0; extra == "anthropic"
Provides-Extra: google
Requires-Dist: google-genai>=0.4.0; extra == "google"

# token-count

A simple, practical Python package for counting tokens across OpenAI, Anthropic, and Google (Gemini) models using their official tokenizers and APIs.

## Features

- **OpenAI**: Local, offline token counting via `tiktoken` (official tokenizer)
- **Anthropic**: Official `messages.count_tokens` API
- **Google (Gemini)**: Official `models.countTokens` via `google-genai` SDK
- Provider-agnostic message format
- Robust model name handling with fallbacks
- Optional dependencies for each provider

## Installation

```bash
# Basic installation (OpenAI support only)
pip install token-count

# With Anthropic support
pip install 'token-count[anthropic]'

# With Google support  
pip install 'token-count[google]'

# With all providers
pip install 'token-count[anthropic,google]'
