namecheap-python


Namenamecheap-python JSON
Version 1.0.1 PyPI version JSON
download
home_pageNone
SummaryA friendly Python SDK for Namecheap API
upload_time2025-07-11 10:27:03
maintainerNone
docs_urlNone
authorNone
requires_python>=3.12
licenseMIT
keywords api dns domains namecheap sdk
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Namecheap Python SDK

A modern, friendly Python SDK for the Namecheap API with comprehensive CLI and TUI tools.

## ๐Ÿš€ Features

- **Modern Python SDK** with full type hints and Pydantic models
- **CLI Tool** for managing domains and DNS from the terminal
- **TUI Application** for visual DNS record management
- **Smart DNS Builder** with fluent interface for record management
- **Auto-configuration** from environment variables
- **Helpful error messages** with troubleshooting guidance
- **Comprehensive logging** with beautiful colored output
- **Sandbox support** for safe testing

## ๐ŸŽฏ Quick Start

**Requires Python 3.12 or higher**

### `namecheap-python`: Core Python SDK Library

```bash
# Add as a dependency to your project
uv add namecheap-python
```

```python
from namecheap import Namecheap

# Initialize (auto-loads from environment)
nc = Namecheap()

# Check domain availability
domains = nc.domains.check("example.com", "coolstartup.io")
for domain in domains:
    if domain.available:
        print(f"โœ… {domain.domain} is available!")

# List your domains
my_domains = nc.domains.list()
for domain in my_domains:
    print(f"{domain.name} expires on {domain.expires}")

# Manage DNS with the builder
nc.dns.set("example.com",
    nc.dns.builder()
    .a("@", "192.0.2.1")
    .a("www", "192.0.2.1")  
    .mx("@", "mail.example.com", priority=10)
    .txt("@", "v=spf1 include:_spf.google.com ~all")
)
```

### `namecheap-cli`: CLI tool

It was meant as a proof of concept to showcase `namecheap-python`, but it is a tool that I use

```bash
# List domains with beautiful table output

# Run it without install with:
uvx --from 'namecheap-python[cli]' namecheap-cli domain list

# Or install it permanently with:
uv tool install --python 3.12 'namecheap-python[cli]'

# Then run
namecheap-cli domain list

                    Domains (4 total)
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ Domain            โ”ƒ Status โ”ƒ Expires    โ”ƒ Auto-Renew โ”ƒ Locked โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚ example.com       โ”‚ Active โ”‚ 2025-10-21 โ”‚ โœ“          โ”‚        โ”‚
โ”‚ coolsite.io       โ”‚ Active โ”‚ 2026-05-25 โ”‚ โœ“          โ”‚        โ”‚
โ”‚ myproject.dev     โ”‚ Active โ”‚ 2026-05-30 โ”‚ โœ“          โ”‚        โ”‚
โ”‚ awesome.site      โ”‚ Active โ”‚ 2026-03-20 โ”‚ โœ“          โ”‚        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```

Configure it before first use:

```bash
# Interactive setup
namecheap-cli config init

# Creates config file at:
# - Linux/macOS: $XDG_CONFIG_HOME/namecheap/config.yaml (or ~/.config/namecheap/config.yaml)
# - Windows: %APPDATA%\namecheap\config.yaml
```
Check domain availability and pricing:

```bash
# Check domain availability
โฏ namecheap-cli domain check myawesome.com coolstartup.io
                Domain Availability
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ Domain         โ”ƒ Available    โ”ƒ Price (USD/year) โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚ myawesome.com  โ”‚ โŒ Taken     โ”‚ -                โ”‚
โ”‚ coolstartup.io โ”‚ โœ… Available โ”‚ $34.98           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ’ก Suggestions for taken domains:
  โ€ข myawesome.com โ†’ myawesome.net, myawesome.io, getmyawesome.com
```

Manage DNS records:

In this example I'll set up GitHub Pages for my domain `tdo.garden`

```bash
# First, check current DNS records (before setup)
namecheap-cli dns list tdo.garden

# Initial state (Namecheap default parking page):
                         DNS Records for tdo.garden (2 total)
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ Type     โ”ƒ Name                 โ”ƒ Value                      โ”ƒ TTL      โ”ƒ Priority โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚ CNAME    โ”‚ www                  โ”‚ parkingpage.namecheap.com. โ”‚ 1800     โ”‚ 10       โ”‚
โ”‚ URL      โ”‚ @                    โ”‚ http://www.tdo.garden/     โ”‚ 1800     โ”‚ 10       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

# Add GitHub Pages A records for apex domain
โฏ namecheap-cli dns add tdo.garden A @ 185.199.108.153
Adding A record to tdo.garden...
โœ… Added A record successfully!

โฏ namecheap-cli dns add tdo.garden A @ 185.199.109.153
Adding A record to tdo.garden...
โœ… Added A record successfully!

โฏ namecheap-cli dns add tdo.garden A @ 185.199.110.153
Adding A record to tdo.garden...
โœ… Added A record successfully!

โฏ namecheap-cli dns add tdo.garden A @ 185.199.111.153
Adding A record to tdo.garden...
โœ… Added A record successfully!

# Add CNAME for www subdomain
โฏ namecheap-cli dns add tdo.garden CNAME www adriangalilea.github.io
Adding CNAME record to tdo.garden...
โœ… Added CNAME record successfully!

# Verify the setup
โฏ namecheap-cli dns list tdo.garden

# Final state with GitHub Pages + old records still present that you may want to remove:
```bash
                         DNS Records for tdo.garden (7 total)
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ Type     โ”ƒ Name                 โ”ƒ Value                      โ”ƒ TTL      โ”ƒ Priority โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚ A        โ”‚ @                    โ”‚ 185.199.108.153            โ”‚ 1800     โ”‚ 10       โ”‚
โ”‚ A        โ”‚ @                    โ”‚ 185.199.109.153            โ”‚ 1800     โ”‚ 10       โ”‚
โ”‚ A        โ”‚ @                    โ”‚ 185.199.110.153            โ”‚ 1800     โ”‚ 10       โ”‚
โ”‚ A        โ”‚ @                    โ”‚ 185.199.111.153            โ”‚ 1800     โ”‚ 10       โ”‚
โ”‚ CNAME    โ”‚ www                  โ”‚ parkingpage.namecheap.com. โ”‚ 1800     โ”‚ 10       โ”‚
โ”‚ CNAME    โ”‚ www                  โ”‚ adriangalilea.github.io.   โ”‚ 1800     โ”‚ 10       โ”‚
โ”‚ URL      โ”‚ @                    โ”‚ http://www.tdo.garden/     โ”‚ 1800     โ”‚ 10       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```


You can also export DNS records:

```bash
namecheap-cli dns export example.com --format yaml
```
### `namecheap-dns-tui`: TUI for DNS management

```bash
# Launch interactive DNS manager
namecheap-dns-tui
```

![DNS Manager TUI](src/namecheap_dns_tui/assets/screenshot2.png)

## Install both the CLI and TUI

```bash
uv tool install --python 3.12 'namecheap-python[all]'
```

## ๐Ÿ“– Documentation

- **[Examples Overview](examples/README.md)** - Quick examples for all tools
- **[CLI Documentation](src/namecheap_cli/README.md)** - Complete CLI reference
- **[TUI Documentation](src/namecheap_dns_tui/README.md)** - TUI features and usage
- **[SDK Quickstart](examples/quickstart.py)** - Python code examples

## โš™๏ธ Configuration

### Environment Variables

Create a `.env` file or set environment variables:

```bash
# Required
NAMECHEAP_API_KEY=your-api-key
NAMECHEAP_USERNAME=your-username

# Optional
NAMECHEAP_API_USER=api-username  # defaults to USERNAME
NAMECHEAP_CLIENT_IP=auto         # auto-detected if not set
NAMECHEAP_SANDBOX=false          # use production API
```

### Python Configuration

```python
from namecheap import Namecheap

nc = Namecheap(
    api_key="your-api-key",
    username="your-username", 
    api_user="api-username",    # Optional
    client_ip="1.2.3.4",       # Optional, auto-detected
    sandbox=False              # Production mode
)
```

## ๐Ÿ”ง Advanced SDK Usage

### DNS Builder Pattern

The DNS builder provides a fluent interface for managing records:

```python
# Build complex DNS configurations
nc.dns.set("example.com",
    nc.dns.builder()
    # A records
    .a("@", "192.0.2.1")
    .a("www", "192.0.2.1")
    .a("blog", "192.0.2.2")
    
    # AAAA records  
    .aaaa("@", "2001:db8::1")
    .aaaa("www", "2001:db8::1")
    
    # MX records
    .mx("@", "mail.example.com", priority=10)
    .mx("@", "mail2.example.com", priority=20)
    
    # TXT records
    .txt("@", "v=spf1 include:_spf.google.com ~all")
    .txt("_dmarc", "v=DMARC1; p=none;")
    
    # CNAME records
    .cname("blog", "myblog.wordpress.com")
    .cname("shop", "myshop.shopify.com")
    
    # URL redirects
    .url("old", "https://new-site.com", redirect_type="301")
)
```

### Domain Management

```python
# Check multiple domains with pricing
results = nc.domains.check(
    "example.com", 
    "coolstartup.io",
    "myproject.dev",
    include_pricing=True
)

for domain in results:
    if domain.available:
        print(f"โœ… {domain.domain} - ${domain.price}/year")
    else:
        print(f"โŒ {domain.domain} is taken")

# List domains with filters
domains = nc.domains.list()
expiring_soon = [d for d in domains if (d.expires - datetime.now()).days < 30]

# Register a domain
from namecheap import Contact

contact = Contact(
    first_name="John",
    last_name="Doe", 
    address1="123 Main St",
    city="New York",
    state_province="NY",
    postal_code="10001", 
    country="US",
    phone="+1.2125551234",
    email="john@example.com"
)

result = nc.domains.register(
    "mynewdomain.com",
    years=2,
    contact=contact,
    whois_protection=True
)
```

### Error Handling

```python
from namecheap import NamecheapError

try:
    nc.domains.check("example.com")
except NamecheapError as e:
    print(f"Error: {e.message}")
    if e.help:
        print(f"๐Ÿ’ก Tip: {e.help}")
```

## ๐Ÿšง Pending Features

The following Namecheap API features are planned for future releases:

- **SSL API** - Certificate management
- **Domain Transfer API** - Transfer domains between registrars  
- **Domain NS API** - Custom nameserver management
- **Users API** - Account management and balance checking
- **Whois API** - WHOIS information lookups
- **Email Forwarding** - Email forwarding configuration

See [pending.md](pending.md) for full details.

## ๐Ÿ› ๏ธ Development

See [Development Guide](docs/dev/README.md) for detailed development instructions.

## ๐Ÿ“ License

MIT License - see [LICENSE](LICENSE) file for details.

## ๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request. See the [Development Guide](docs/dev/README.md) for setup instructions and guidelines.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "namecheap-python",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.12",
    "maintainer_email": null,
    "keywords": "api, dns, domains, namecheap, sdk",
    "author": null,
    "author_email": "Adrian Galilea Delgado <adriangalilea@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/a0/d0/379d8cde3ed0e34f28e373114ccc7bb9713b81b30a79425c9637913aef7f/namecheap_python-1.0.1.tar.gz",
    "platform": null,
    "description": "# Namecheap Python SDK\n\nA modern, friendly Python SDK for the Namecheap API with comprehensive CLI and TUI tools.\n\n## \ud83d\ude80 Features\n\n- **Modern Python SDK** with full type hints and Pydantic models\n- **CLI Tool** for managing domains and DNS from the terminal\n- **TUI Application** for visual DNS record management\n- **Smart DNS Builder** with fluent interface for record management\n- **Auto-configuration** from environment variables\n- **Helpful error messages** with troubleshooting guidance\n- **Comprehensive logging** with beautiful colored output\n- **Sandbox support** for safe testing\n\n## \ud83c\udfaf Quick Start\n\n**Requires Python 3.12 or higher**\n\n### `namecheap-python`: Core Python SDK Library\n\n```bash\n# Add as a dependency to your project\nuv add namecheap-python\n```\n\n```python\nfrom namecheap import Namecheap\n\n# Initialize (auto-loads from environment)\nnc = Namecheap()\n\n# Check domain availability\ndomains = nc.domains.check(\"example.com\", \"coolstartup.io\")\nfor domain in domains:\n    if domain.available:\n        print(f\"\u2705 {domain.domain} is available!\")\n\n# List your domains\nmy_domains = nc.domains.list()\nfor domain in my_domains:\n    print(f\"{domain.name} expires on {domain.expires}\")\n\n# Manage DNS with the builder\nnc.dns.set(\"example.com\",\n    nc.dns.builder()\n    .a(\"@\", \"192.0.2.1\")\n    .a(\"www\", \"192.0.2.1\")  \n    .mx(\"@\", \"mail.example.com\", priority=10)\n    .txt(\"@\", \"v=spf1 include:_spf.google.com ~all\")\n)\n```\n\n### `namecheap-cli`: CLI tool\n\nIt was meant as a proof of concept to showcase `namecheap-python`, but it is a tool that I use\n\n```bash\n# List domains with beautiful table output\n\n# Run it without install with:\nuvx --from 'namecheap-python[cli]' namecheap-cli domain list\n\n# Or install it permanently with:\nuv tool install --python 3.12 'namecheap-python[cli]'\n\n# Then run\nnamecheap-cli domain list\n\n                    Domains (4 total)\n\u250f\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2513\n\u2503 Domain            \u2503 Status \u2503 Expires    \u2503 Auto-Renew \u2503 Locked \u2503\n\u2521\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2529\n\u2502 example.com       \u2502 Active \u2502 2025-10-21 \u2502 \u2713          \u2502        \u2502\n\u2502 coolsite.io       \u2502 Active \u2502 2026-05-25 \u2502 \u2713          \u2502        \u2502\n\u2502 myproject.dev     \u2502 Active \u2502 2026-05-30 \u2502 \u2713          \u2502        \u2502\n\u2502 awesome.site      \u2502 Active \u2502 2026-03-20 \u2502 \u2713          \u2502        \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\nConfigure it before first use:\n\n```bash\n# Interactive setup\nnamecheap-cli config init\n\n# Creates config file at:\n# - Linux/macOS: $XDG_CONFIG_HOME/namecheap/config.yaml (or ~/.config/namecheap/config.yaml)\n# - Windows: %APPDATA%\\namecheap\\config.yaml\n```\nCheck domain availability and pricing:\n\n```bash\n# Check domain availability\n\u276f namecheap-cli domain check myawesome.com coolstartup.io\n                Domain Availability\n\u250f\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2513\n\u2503 Domain         \u2503 Available    \u2503 Price (USD/year) \u2503\n\u2521\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2529\n\u2502 myawesome.com  \u2502 \u274c Taken     \u2502 -                \u2502\n\u2502 coolstartup.io \u2502 \u2705 Available \u2502 $34.98           \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\n\ud83d\udca1 Suggestions for taken domains:\n  \u2022 myawesome.com \u2192 myawesome.net, myawesome.io, getmyawesome.com\n```\n\nManage DNS records:\n\nIn this example I'll set up GitHub Pages for my domain `tdo.garden`\n\n```bash\n# First, check current DNS records (before setup)\nnamecheap-cli dns list tdo.garden\n\n# Initial state (Namecheap default parking page):\n                         DNS Records for tdo.garden (2 total)\n\u250f\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2513\n\u2503 Type     \u2503 Name                 \u2503 Value                      \u2503 TTL      \u2503 Priority \u2503\n\u2521\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2529\n\u2502 CNAME    \u2502 www                  \u2502 parkingpage.namecheap.com. \u2502 1800     \u2502 10       \u2502\n\u2502 URL      \u2502 @                    \u2502 http://www.tdo.garden/     \u2502 1800     \u2502 10       \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\n# Add GitHub Pages A records for apex domain\n\u276f namecheap-cli dns add tdo.garden A @ 185.199.108.153\nAdding A record to tdo.garden...\n\u2705 Added A record successfully!\n\n\u276f namecheap-cli dns add tdo.garden A @ 185.199.109.153\nAdding A record to tdo.garden...\n\u2705 Added A record successfully!\n\n\u276f namecheap-cli dns add tdo.garden A @ 185.199.110.153\nAdding A record to tdo.garden...\n\u2705 Added A record successfully!\n\n\u276f namecheap-cli dns add tdo.garden A @ 185.199.111.153\nAdding A record to tdo.garden...\n\u2705 Added A record successfully!\n\n# Add CNAME for www subdomain\n\u276f namecheap-cli dns add tdo.garden CNAME www adriangalilea.github.io\nAdding CNAME record to tdo.garden...\n\u2705 Added CNAME record successfully!\n\n# Verify the setup\n\u276f namecheap-cli dns list tdo.garden\n\n# Final state with GitHub Pages + old records still present that you may want to remove:\n```bash\n                         DNS Records for tdo.garden (7 total)\n\u250f\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2513\n\u2503 Type     \u2503 Name                 \u2503 Value                      \u2503 TTL      \u2503 Priority \u2503\n\u2521\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2529\n\u2502 A        \u2502 @                    \u2502 185.199.108.153            \u2502 1800     \u2502 10       \u2502\n\u2502 A        \u2502 @                    \u2502 185.199.109.153            \u2502 1800     \u2502 10       \u2502\n\u2502 A        \u2502 @                    \u2502 185.199.110.153            \u2502 1800     \u2502 10       \u2502\n\u2502 A        \u2502 @                    \u2502 185.199.111.153            \u2502 1800     \u2502 10       \u2502\n\u2502 CNAME    \u2502 www                  \u2502 parkingpage.namecheap.com. \u2502 1800     \u2502 10       \u2502\n\u2502 CNAME    \u2502 www                  \u2502 adriangalilea.github.io.   \u2502 1800     \u2502 10       \u2502\n\u2502 URL      \u2502 @                    \u2502 http://www.tdo.garden/     \u2502 1800     \u2502 10       \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n\nYou can also export DNS records:\n\n```bash\nnamecheap-cli dns export example.com --format yaml\n```\n### `namecheap-dns-tui`: TUI for DNS management\n\n```bash\n# Launch interactive DNS manager\nnamecheap-dns-tui\n```\n\n![DNS Manager TUI](src/namecheap_dns_tui/assets/screenshot2.png)\n\n## Install both the CLI and TUI\n\n```bash\nuv tool install --python 3.12 'namecheap-python[all]'\n```\n\n## \ud83d\udcd6 Documentation\n\n- **[Examples Overview](examples/README.md)** - Quick examples for all tools\n- **[CLI Documentation](src/namecheap_cli/README.md)** - Complete CLI reference\n- **[TUI Documentation](src/namecheap_dns_tui/README.md)** - TUI features and usage\n- **[SDK Quickstart](examples/quickstart.py)** - Python code examples\n\n## \u2699\ufe0f Configuration\n\n### Environment Variables\n\nCreate a `.env` file or set environment variables:\n\n```bash\n# Required\nNAMECHEAP_API_KEY=your-api-key\nNAMECHEAP_USERNAME=your-username\n\n# Optional\nNAMECHEAP_API_USER=api-username  # defaults to USERNAME\nNAMECHEAP_CLIENT_IP=auto         # auto-detected if not set\nNAMECHEAP_SANDBOX=false          # use production API\n```\n\n### Python Configuration\n\n```python\nfrom namecheap import Namecheap\n\nnc = Namecheap(\n    api_key=\"your-api-key\",\n    username=\"your-username\", \n    api_user=\"api-username\",    # Optional\n    client_ip=\"1.2.3.4\",       # Optional, auto-detected\n    sandbox=False              # Production mode\n)\n```\n\n## \ud83d\udd27 Advanced SDK Usage\n\n### DNS Builder Pattern\n\nThe DNS builder provides a fluent interface for managing records:\n\n```python\n# Build complex DNS configurations\nnc.dns.set(\"example.com\",\n    nc.dns.builder()\n    # A records\n    .a(\"@\", \"192.0.2.1\")\n    .a(\"www\", \"192.0.2.1\")\n    .a(\"blog\", \"192.0.2.2\")\n    \n    # AAAA records  \n    .aaaa(\"@\", \"2001:db8::1\")\n    .aaaa(\"www\", \"2001:db8::1\")\n    \n    # MX records\n    .mx(\"@\", \"mail.example.com\", priority=10)\n    .mx(\"@\", \"mail2.example.com\", priority=20)\n    \n    # TXT records\n    .txt(\"@\", \"v=spf1 include:_spf.google.com ~all\")\n    .txt(\"_dmarc\", \"v=DMARC1; p=none;\")\n    \n    # CNAME records\n    .cname(\"blog\", \"myblog.wordpress.com\")\n    .cname(\"shop\", \"myshop.shopify.com\")\n    \n    # URL redirects\n    .url(\"old\", \"https://new-site.com\", redirect_type=\"301\")\n)\n```\n\n### Domain Management\n\n```python\n# Check multiple domains with pricing\nresults = nc.domains.check(\n    \"example.com\", \n    \"coolstartup.io\",\n    \"myproject.dev\",\n    include_pricing=True\n)\n\nfor domain in results:\n    if domain.available:\n        print(f\"\u2705 {domain.domain} - ${domain.price}/year\")\n    else:\n        print(f\"\u274c {domain.domain} is taken\")\n\n# List domains with filters\ndomains = nc.domains.list()\nexpiring_soon = [d for d in domains if (d.expires - datetime.now()).days < 30]\n\n# Register a domain\nfrom namecheap import Contact\n\ncontact = Contact(\n    first_name=\"John\",\n    last_name=\"Doe\", \n    address1=\"123 Main St\",\n    city=\"New York\",\n    state_province=\"NY\",\n    postal_code=\"10001\", \n    country=\"US\",\n    phone=\"+1.2125551234\",\n    email=\"john@example.com\"\n)\n\nresult = nc.domains.register(\n    \"mynewdomain.com\",\n    years=2,\n    contact=contact,\n    whois_protection=True\n)\n```\n\n### Error Handling\n\n```python\nfrom namecheap import NamecheapError\n\ntry:\n    nc.domains.check(\"example.com\")\nexcept NamecheapError as e:\n    print(f\"Error: {e.message}\")\n    if e.help:\n        print(f\"\ud83d\udca1 Tip: {e.help}\")\n```\n\n## \ud83d\udea7 Pending Features\n\nThe following Namecheap API features are planned for future releases:\n\n- **SSL API** - Certificate management\n- **Domain Transfer API** - Transfer domains between registrars  \n- **Domain NS API** - Custom nameserver management\n- **Users API** - Account management and balance checking\n- **Whois API** - WHOIS information lookups\n- **Email Forwarding** - Email forwarding configuration\n\nSee [pending.md](pending.md) for full details.\n\n## \ud83d\udee0\ufe0f Development\n\nSee [Development Guide](docs/dev/README.md) for detailed development instructions.\n\n## \ud83d\udcdd License\n\nMIT License - see [LICENSE](LICENSE) file for details.\n\n## \ud83e\udd1d Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request. See the [Development Guide](docs/dev/README.md) for setup instructions and guidelines.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A friendly Python SDK for Namecheap API",
    "version": "1.0.1",
    "project_urls": {
        "Homepage": "https://github.com/adriangalilea/namecheap-python",
        "Issues": "https://github.com/adriangalilea/namecheap-python/issues",
        "Repository": "https://github.com/adriangalilea/namecheap-python"
    },
    "split_keywords": [
        "api",
        " dns",
        " domains",
        " namecheap",
        " sdk"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "5e34d2082164dc2d7488b3d949dde356f17a44b4489fdb2d68328b1d99ef5fe1",
                "md5": "09522601c50da5dfa380a41776530c7e",
                "sha256": "0d676b191f8d8b5fb68a6a60e5a33ea049aab0cbf92f2b4ad219508fc6c61878"
            },
            "downloads": -1,
            "filename": "namecheap_python-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "09522601c50da5dfa380a41776530c7e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.12",
            "size": 751305,
            "upload_time": "2025-07-11T10:27:01",
            "upload_time_iso_8601": "2025-07-11T10:27:01.403695Z",
            "url": "https://files.pythonhosted.org/packages/5e/34/d2082164dc2d7488b3d949dde356f17a44b4489fdb2d68328b1d99ef5fe1/namecheap_python-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "a0d0379d8cde3ed0e34f28e373114ccc7bb9713b81b30a79425c9637913aef7f",
                "md5": "4f49e6494491dbfe449ce60d5ebf10f2",
                "sha256": "87f9bb488476f7f53d7b8715b6b1df267654d8519ad541da9eee15fa3bffd74b"
            },
            "downloads": -1,
            "filename": "namecheap_python-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "4f49e6494491dbfe449ce60d5ebf10f2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.12",
            "size": 780381,
            "upload_time": "2025-07-11T10:27:03",
            "upload_time_iso_8601": "2025-07-11T10:27:03.365033Z",
            "url": "https://files.pythonhosted.org/packages/a0/d0/379d8cde3ed0e34f28e373114ccc7bb9713b81b30a79425c9637913aef7f/namecheap_python-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-11 10:27:03",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "adriangalilea",
    "github_project": "namecheap-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "namecheap-python"
}
        
Elapsed time: 1.20615s