Metadata-Version: 2.4
Name: pykabu
Version: 0.1.2
Summary: Python library and CLI for Japanese stock market data
Author-email: Your Name <your@email.com>
License: MIT
Project-URL: Homepage, https://github.com/obichan117/pykabu
Project-URL: Repository, https://github.com/obichan117/pykabu
Project-URL: Documentation, https://obichan117.github.io/pykabu
Keywords: kabu,nikkei,stock,cli,japan,finance,scraping
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: click>=8.1.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: rich>=13.0.0
Requires-Dist: playwright>=1.40.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: pytest-playwright>=0.4.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Provides-Extra: docs
Requires-Dist: mkdocs>=1.5.0; extra == "docs"
Requires-Dist: mkdocs-material>=9.0.0; extra == "docs"
Requires-Dist: mkdocstrings[python]>=0.24.0; extra == "docs"

# pykabu

Python library and CLI for Japanese stock market data.

## Requirements

- Python 3.10+

## Installation

### Quick Install (Global)

```bash
# 1. Install pykabu
pip install pykabu

# 2. Install browser for market index feature
playwright install chromium
```

### Recommended: Virtual Environment with uv

[uv](https://docs.astral.sh/uv/) is a fast Python package manager written in Rust.

**Step 1: Install uv** (one-time setup)

```bash
# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

# Windows (PowerShell)
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
```

**Step 2: Create virtual environment and install**

```bash
# Create virtual environment
uv venv

# Activate it
source .venv/bin/activate   # macOS / Linux
.venv\Scripts\activate      # Windows (PowerShell)

# Install pykabu
uv pip install pykabu

# Install browser for market index feature
playwright install chromium
```

### Alternative: pip + venv

```bash
# Create virtual environment
python -m venv .venv

# Activate it
source .venv/bin/activate   # macOS / Linux
.venv\Scripts\activate      # Windows (PowerShell)

# Install pykabu
pip install pykabu

# Install browser for market index feature
playwright install chromium
```

### Platform Notes

- **macOS**: Works out of the box
- **Windows**: Use PowerShell (not CMD)
- **Linux**: If playwright fails, run: `playwright install-deps chromium`

## CLI Usage

```bash
kabu sche              # Today's schedule
kabu sche -t           # Tomorrow's schedule
kabu sche -w           # This week's schedule
kabu sche -i 3         # Filter by importance (>= 3 stars)

# Market indices
kabu index             # Default 8 indices
kabu index --all       # All known indices (~25)
kabu index --custom    # Custom configured indices
kabu index --merged    # Default + custom indices

# Nikkei 225 contribution ranking
kabu rank225           # Show top & bottom contributors
kabu rank225 --top     # Top contributors only
kabu rank225 --bottom  # Bottom contributors only

# Configuration
kabu config show                      # Show current config
kabu config set default_importance 3  # Set default star filter

# Custom indices
kabu config index list                # List all available codes
kabu config index add 212             # Add NASDAQ
kabu config index add 1001            # Add Bitcoin
kabu config index remove 212          # Remove an index
```

## Library Usage

```python
from pykabu.sources import nikkei225

# Schedule data
schedule = nikkei225.get_schedule()
today = nikkei225.get_today_schedule()
tomorrow = nikkei225.get_tomorrow_schedule()
week = nikkei225.get_week_schedule()

# Market indices (requires playwright)
indices = nikkei225.get_indices()
```

## Data Sources

- [nikkei225jp.com](https://nikkei225jp.com) - Economic calendar and market indices
