Skip to content

DigitalTolk/loopiase-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Loopia Python Library

Documentation Status Coverage Status

Python client library for the Loopia domain registrar API.

Installation

pip install loopiase

Usage

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:

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

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-or-later

Contributors