Metadata-Version: 2.4
Name: loopiase
Version: 0.0.1
Summary: Python client library for the Loopia API
License-Expression: GPL-3.0-only
Project-URL: Homepage, https://github.com/lifeofguenter/loopia-python
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-cov>=6.0; extra == "dev"
Requires-Dist: pyright>=1.1; extra == "dev"
Requires-Dist: sphinx>=8.0; extra == "dev"
Requires-Dist: sphinx-rtd-theme>=3.0; extra == "dev"
Requires-Dist: myst-parser>=4.0; extra == "dev"
Dynamic: license-file

# Loopia Python Library

[![Documentation Status](https://app.readthedocs.org/projects/loopiase-python/badge/?version=latest)](https://loopiase-python.readthedocs.io/en/latest/)
[![Coverage Status](https://coveralls.io/repos/github/DigitalTolk/loopiase-python/badge.svg?branch=feature/add-github-actions)](https://coveralls.io/github/DigitalTolk/loopiase-python?branch=feature/add-github-actions)

Python client library for the [Loopia](https://www.loopia.se) domain registrar API.

## Installation

```bash
pip install loopiase
```

## Usage

```python
from loopiase import Loopia, Record

client = Loopia("user@loopiaapi", "my_password")

# Check domain availability
if client.domain_is_free("example.com"):
    client.order_domain("example.com", has_accepted_terms=True)

# List domains
for domain in client.get_domains():
    print(domain.domain, domain.expiration_date)

# Manage DNS records
client.add_subdomain("example.com", "www")
client.add_zone_record("example.com", "www", Record(type="A", ttl=300, rdata="1.2.3.4"))

for record in client.get_zone_records("example.com", "www"):
    print(record.type, record.rdata)

# Billing
balance = client.get_credits_amount()
for invoice in client.get_unpaid_invoices():
    print(invoice.reference_no, invoice.to_pay, invoice.currency)
```

### Reseller

Reseller-specific methods are available under `client.reseller`:

```python
for customer in client.reseller.get_customers():
    print(customer.customer_number, customer.name)

# Operate on a customer's account
domains = client.get_domains(customer_number="C12345")
```

## Development

```bash
make install   # install with dev dependencies
make test      # run tests with coverage
make lint      # type-check with pyright
make docs      # build Sphinx documentation
```

## License

GPL-3.0
