Skip to main content

A Python API on top of the EPP protocol.

Project description

PyEPP

A Python API on top of EPP protocol to work with registry systems.

This a Python API on EPP protocol to connect to any registry systems that support EPP and work with it. It supports bellow RFCs:

This is an early version and not stable yet. Please use with care.

Installation

pip install pyepp

Usage example

from datetime import date

from pyepp import EppCommunicator
from pyepp.domain import Domain, DomainData, DSRecordData, DNSSECAlgorithm, DigestTypeEnum
from pyepp.contact import Contact, ContactData, PostalInfoData, AddressData

config = {
    "host": "epp.ote.irs.net.nz",
    "port": "700",
    "client_cert": "/PATH/TO/YOUR/CLIENT_CERTIFICATE.crt",
    "client_key": "/PATH/TO/YOUR/CLIENT_KEY.pem"
}

epp = EppCommunicator(**config)

connect = epp.connect()
login = epp.login("user_name", "password")
# Sends a hello request and receive greeting in respond
hello = epp.hello()

contact = Contact(epp)

# Check contacts availability
contact_check = contact.check(['contact-1', 'contact-2'])

# Create a new contact
contact_create_params = ContactData(
    id='contact-1',
    email='epp@example.net.nz',
    postal_info=PostalInfoData(
        name='Registrar 1',
        organization='Registrar 1',
        address=AddressData(
            street_1='18 Registrar Street',
            street_2='Registrar CBD',
            city='Registrar',
            country_code='NZ',
            province='Registrar',
            postal_code='6011'
        ),
    ),
    phone='+64.111111111'
)
contact_create = contact.create(contact_create_params)

# Get contact details
contact_info = contact.info('contact-1')

domain = Domain(epp)
# Check domains availability
domain_check = domain.check(['domain1.nz', 'domain2.nz'])

# Create a new domain name
domain_create_params = DomainData(
    domain_name='example.nz',
    registrant='contact-1',
    admin='contact-1',
    tech='contact-1',
    billing='contact-3',
    period=3,
    host=['01y.test-indwrx2vkicn2otgm3otav5wpnzvjd.co.nz', '0d9x6239.example.co.nz'],
    dns_sec=DSRecordData(
        key_tag=1235,
        algorithm=DNSSECAlgorithm.DSA_SHA_1.value,
        digest_type=DigestTypeEnum.SHA_1.value,
        digest='8cdb09364147aed879d12c68d615f98af5900b73'
    ),
)
domain_create = domain.create(domain_create_params)

# Renew a domain name
renew_domain = domain.renew(domain_name='example-1.nz', expiry_date=date(2024, 2, 23), period=2)

Development setup

Clone this project. It's recommended to create virtual environment. Then install the dependencies and development dependencies:

pip install -r requirements.txt
pip install -r requirements.dev.txt

Happy developing!

Contributing

Please refer to CONTRIBUTING.md

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyepp-0.0.1a1.tar.gz (33.8 kB view details)

Uploaded Source

Built Distribution

pyepp-0.0.1a1-py3-none-any.whl (27.8 kB view details)

Uploaded Python 3

File details

Details for the file pyepp-0.0.1a1.tar.gz.

File metadata

  • Download URL: pyepp-0.0.1a1.tar.gz
  • Upload date:
  • Size: 33.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.4

File hashes

Hashes for pyepp-0.0.1a1.tar.gz
Algorithm Hash digest
SHA256 7ab0e590ae2b58313fb83a877b64f193e2621bdcf0f4c7706a506cf32fb708b7
MD5 9854b92434f8bee4b892bb3583d95947
BLAKE2b-256 7af2507950c1456a9d31ac5e2e2a457874fc98fc1378957b5e50a90d7c04d9dc

See more details on using hashes here.

Provenance

File details

Details for the file pyepp-0.0.1a1-py3-none-any.whl.

File metadata

  • Download URL: pyepp-0.0.1a1-py3-none-any.whl
  • Upload date:
  • Size: 27.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.4

File hashes

Hashes for pyepp-0.0.1a1-py3-none-any.whl
Algorithm Hash digest
SHA256 eb4fce7fb4b57792d3bdcfb2469c700b603f6d32fb00d9001cf91f1fca78316e
MD5 2d86d134002ce649f499e82c19b4f1f6
BLAKE2b-256 3fc79af5f320f96d60ee9734e5450db1f7cf3ff276f4c3e98ea7c132a4f87d0c

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page