🔘 [English](README.md) | 🔘 [中文](README.zh-CN.md)

# Background
In daily work, we often need to convert data exported from databases into business-friendly data for business teams.
Backend data usually only contains country codes, while business users prefer to see country names.

# Introduction
A Python library for ISO 3166 country code lookup with Chinese names, supporting CRUD operations.

## Features
- ISO 3166-1 standard country codes
- Chinese country names
- Full CRUD support
- Lookup by alpha2, alpha3, numeric code, or Chinese name
- Lightweight, no external dependencies

## Installation
```bash
pip install countryiso
```

## Usage
### Look up
```py
import countryiso

 Look up country
country = countryiso.countries.get(alpha2="CN")
print(country.chinese_name)    # 中国
print(country.alpha3)          # CHN
print(country.numeric)         # 156
print(country.name)            # China
print(country.official_name)   # People's Republic of China
print(country.flag)            # 🇨🇳
```

## CRUD Example
```py

from countryiso import Country

# Add
new_country = Country(
    alpha_2="XX",
    alpha_3="XXX",
    name="Test Country",
    chinese_name="测试国家",
    numeric="999",
    flag="🇽🇽"
)
countryiso.countries.add(new_country)

# Update
updated = countryiso.countries.update(new_country, chinese_name="测试国")

# Remove
countryiso.countries.remove(updated)

```
