Realtime Register Python SDK
The Realtime Register Python SDK provides a convenient way to interact with the Realtime Register REST API from your Python applications.
Requirements
- Python 3.7 or later
requestslibrarypython-dateutillibrary
Installation
You can install the SDK via pip:
pip install realtimeregister
Usage
from realtimeregister import Client
# Initialize the client
client = Client(
customer="your_customer_id",
api_key="your_api_key",
test_mode=True # Set to False for production
)
# List domains
domains = client.domains.list()
# Get domain details
domain = client.domains.get("example.com")
# Register a new domain
new_domain = client.domains.register(
domain="example.com",
period=1,
registrant={
"name": "John Doe",
"email": "john@example.com",
"phone": "+1.1234567890",
"address": {
"street": "123 Main St",
"city": "Anytown",
"state": "ST",
"zipcode": "12345",
"country": "US"
}
}
)
Available API Endpoints
Domains
# List domains
client.domains.list()
# Get domain details
client.domains.get("example.com")
# Register domain
client.domains.register("example.com", registrant, period=1)
# Update domain
client.domains.update("example.com", nameservers=[...])
# Delete domain
client.domains.delete("example.com")
# Renew domain
client.domains.renew("example.com", period=1)
# Restore domain
client.domains.restore("example.com")
Contacts
# List contacts
client.contacts.list()
# Get contact details
client.contacts.get("contact123")
# Create contact
client.contacts.create("contact123", contact_data)
# Update contact
client.contacts.update("contact123", contact_data)
# Delete contact
client.contacts.delete("contact123")
DNS
# List DNS records
client.dns.list_records("example.com")
# Get DNS record
client.dns.get_record("example.com", "www", "A")
# Create DNS record
client.dns.create_record("example.com", "www", "A", ttl=3600, content={"ip": "1.2.3.4"})
# Update DNS record
client.dns.update_record("example.com", "www", "A", ttl=7200)
# Delete DNS record
client.dns.delete_record("example.com", "www", "A")
SSL Certificates
# List certificates
client.certificates.list()
# Get certificate details
client.certificates.get("cert123")
# Order certificate
client.certificates.order("example.com", "DV", "dns")
# Reissue certificate
client.certificates.reissue("cert123")
Billing
# List invoices
client.billing.list_invoices()
# Get invoice details
client.billing.get_invoice("inv123")
# Download invoice
client.billing.download_invoice("inv123")
# List transactions
client.billing.list_transactions()
Templates
# List templates
client.templates.list()
# Get template details
client.templates.get("welcome-email")
# Create template
client.templates.create("welcome-email", "email", "Welcome {{name}}!")
# Update template
client.templates.update("welcome-email", content="Updated welcome {{name}}!")
# Preview template
client.templates.preview("welcome-email", {"name": "John"})
Notifications
# List notifications
client.notifications.list()
# Get notification details
client.notifications.get("notif123")
# Create notification
client.notifications.create("webhook", "https://example.com/webhook", ["domain.expire"])
# Update notification
client.notifications.update("notif123", enabled=False)
# Test notification
client.notifications.test("notif123")
Abuse
# List abuse reports
client.abuse.list()
# Get abuse report details
client.abuse.get("abuse123")
# Create abuse report
client.abuse.create("example.com", "John Doe", "john@example.com", "Spam content")
# Update abuse report
client.abuse.update("abuse123", status="resolved")
Processes
# List processes
client.processes.list()
# Get process details
client.processes.get("proc123")
Statistics
# Get domain statistics
client.statistics.get_domain_statistics()
# Get billing statistics
client.statistics.get_billing_statistics()
# Get customer statistics
client.statistics.get_customer_statistics()
TLDs
# List TLDs
client.tlds.list()
# Get TLD details
client.tlds.get("com")
Reseller
# Get balance
client.reseller.get_balance()
# List transactions
client.reseller.list_transactions()
# Get transaction details
client.reseller.get_transaction("trans123")
Transfers
# List transfers
client.transfers.list()
# Get transfer details
client.transfers.get("example.com")
# Request transfer
client.transfers.request("example.com", "auth-code")
# Approve transfer
client.transfers.approve("example.com")
# Reject transfer
client.transfers.reject("example.com", "Invalid auth code")
Error Handling
The SDK provides detailed error handling through specific exception classes:
from realtimeregister.exceptions import (
RealtimeRegisterException,
ValidationException,
AuthenticationException,
NotFoundException
)
try:
domain = client.domains.get("nonexistent.com")
except NotFoundException:
print("Domain not found")
except AuthenticationException:
print("Invalid credentials")
except ValidationException as e:
print(f"Validation error: {str(e)}")
except RealtimeRegisterException as e:
print(f"API error: {str(e)}")
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Metadata
Release files for realtimeregister 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| realtimeregister-1.0.1.tar.gz | 23.7 kB | Without provenance | Details for realtimeregister-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| realtimeregister-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for realtimeregister-1.0.1-py3-none-any.whl |
Total release size: 61.3 kB
Release files / realtimeregister-1.0.1.tar.gz
| Download URL | realtimeregister-1.0.1.tar.gz |
|---|---|
| Size | 23.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ff75478877e9e914b89641ae2b35254dfed6d475de7ee0212ba03956dd424f79
|
|
BLAKE2b-256 checksum How to use checksums |
73fb4535091b12c5a400b9c7932d5a1dce930e5d18499f2afaac4da2e389a533
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.20
|
Release files / realtimeregister-1.0.1-py3-none-any.whl
| Download URL | realtimeregister-1.0.1-py3-none-any.whl |
|---|---|
| Size | 37.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5b679182e0585a89576a323f0b44a70f50fafafa5b8c27ab85d89898882e1680
|
|
BLAKE2b-256 checksum How to use checksums |
de5531fb007ad15a99365a3433caba8e692a3cf73239486f13bc168e22c57d2e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.20
|
Security for realtimeregister 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.