pyepp


Namepyepp JSON
Version 0.0.15 PyPI version JSON
download
home_pageNone
SummaryA Python API on top of the EPP protocol.
upload_time2024-04-19 03:53:35
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseGNU GPLv3
keywords epp registry
VCS
bugtrack_url
requirements jinja2 lxml bs4 click
Travis-CI No Travis.
coveralls test coverage
            # PyEPP
> A Python API on top of EPP protocol to work with registry systems.

This a Python API on [EPP](https://en.wikipedia.org/wiki/Extensible_Provisioning_Protocol) protocol to connect to
any registry systems that support EPP and work with it. It supports bellow RFCs:
- [RFC 5730 - Extensible Provisioning Protocol](https://datatracker.ietf.org/doc/html/rfc5730)
- [RFC 5731 - Domain Name Mapping](https://datatracker.ietf.org/doc/html/rfc5731)
- [RFC 5732 - Host Mapping](https://datatracker.ietf.org/doc/html/rfc5732)
- [RFC 5733 - Contact Mapping](https://datatracker.ietf.org/doc/html/rfc5733)
- [RFC 5734 - Transport over TCP](https://datatracker.ietf.org/doc/html/rfc5734)

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

## Installation

```sh
pip install pyepp
```

## Usage example

```python
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 = {
    "server": "epp.test.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)
```

## PyEPP CLI
PyEPP also has a command line interface that allows the user to interact with the registry system.

```text
Usage: pyepp [OPTIONS] COMMAND [ARGS]...

  A command line interface to work with PyEpp library.

Options:
  --server TEXT                   [required]
  --port TEXT                     [required]
  --client-cert TEXT              [required]
  --client-key TEXT               [required]
  --user TEXT                     [required]
  --password TEXT                 [required]
  -o, --output-format [XML|OBJECT|MIN]
                                  [default: XML]
  --no-pretty
  --dry-run
  -f, --file FILENAME             If provided, the output will be written in
                                  the file.
  -v, --verbose
  -d, --debug
  --version                       Show the version and exit.
  -h, --help                      Show this message and exit.

Commands:
  contact  To work with Contact objects in the registry.
  domain   To work with Domain name objects in the registry.
  host     To work with Host objects in the registry.
  poll     To manage registry service messages.
  run      Receive an XML file containing an EPP XML command and execute it.
```

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

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

Before creating any pull requests please make sure your code lints and there is no security issues in your code 
by running below scripts:

```shell
./scripts/linter.sh
./scripts/code-security-check.sh
```

Happy developing!
## Contributing
Please refer to [CONTRIBUTING.md](CONTRIBUTING.md)

<!-- Markdown link & img dfn's -->
[wiki]: https://github.com/internetnz/pyepp/wiki

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pyepp",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "epp, registry",
    "author": null,
    "author_email": "InternetNZ <ehsan@internetnz.net.nz>",
    "download_url": "https://files.pythonhosted.org/packages/cc/51/eefb1bbf3a781a81b9ee296642a0f2145fca10074086c0fc9ec341b8dfd4/pyepp-0.0.15.tar.gz",
    "platform": null,
    "description": "# PyEPP\n> A Python API on top of EPP protocol to work with registry systems.\n\nThis a Python API on [EPP](https://en.wikipedia.org/wiki/Extensible_Provisioning_Protocol) protocol to connect to\nany registry systems that support EPP and work with it. It supports bellow RFCs:\n- [RFC 5730 - Extensible Provisioning Protocol](https://datatracker.ietf.org/doc/html/rfc5730)\n- [RFC 5731 - Domain Name Mapping](https://datatracker.ietf.org/doc/html/rfc5731)\n- [RFC 5732 - Host Mapping](https://datatracker.ietf.org/doc/html/rfc5732)\n- [RFC 5733 - Contact Mapping](https://datatracker.ietf.org/doc/html/rfc5733)\n- [RFC 5734 - Transport over TCP](https://datatracker.ietf.org/doc/html/rfc5734)\n\n>This is an early version and not stable yet. Please use with care.\n\n## Installation\n\n```sh\npip install pyepp\n```\n\n## Usage example\n\n```python\nfrom datetime import date\n\nfrom pyepp import EppCommunicator\nfrom pyepp.domain import Domain, DomainData, DSRecordData, DNSSECAlgorithm, DigestTypeEnum\nfrom pyepp.contact import Contact, ContactData, PostalInfoData, AddressData\n\nconfig = {\n    \"server\": \"epp.test.net.nz\",\n    \"port\": \"700\",\n    \"client_cert\": \"/PATH/TO/YOUR/CLIENT_CERTIFICATE.crt\",\n    \"client_key\": \"/PATH/TO/YOUR/CLIENT_KEY.pem\"\n}\n\nepp = EppCommunicator(**config)\n\nconnect = epp.connect()\nlogin = epp.login(\"user_name\", \"password\")\n# Sends a hello request and receive greeting in respond\nhello = epp.hello()\n\ncontact = Contact(epp)\n\n# Check contacts availability\ncontact_check = contact.check(['contact-1', 'contact-2'])\n\n# Create a new contact\ncontact_create_params = ContactData(\n    id='contact-1',\n    email='epp@example.net.nz',\n    postal_info=PostalInfoData(\n        name='Registrar 1',\n        organization='Registrar 1',\n        address=AddressData(\n            street_1='18 Registrar Street',\n            street_2='Registrar CBD',\n            city='Registrar',\n            country_code='NZ',\n            province='Registrar',\n            postal_code='6011'\n        ),\n    ),\n    phone='+64.111111111'\n)\ncontact_create = contact.create(contact_create_params)\n\n# Get contact details\ncontact_info = contact.info('contact-1')\n\ndomain = Domain(epp)\n# Check domains availability\ndomain_check = domain.check(['domain1.nz', 'domain2.nz'])\n\n# Create a new domain name\ndomain_create_params = DomainData(\n    domain_name='example.nz',\n    registrant='contact-1',\n    admin='contact-1',\n    tech='contact-1',\n    billing='contact-3',\n    period=3,\n    host=['01y.test-indwrx2vkicn2otgm3otav5wpnzvjd.co.nz', '0d9x6239.example.co.nz'],\n    dns_sec=DSRecordData(\n        key_tag=1235,\n        algorithm=DNSSECAlgorithm.DSA_SHA_1.value,\n        digest_type=DigestTypeEnum.SHA_1.value,\n        digest='8cdb09364147aed879d12c68d615f98af5900b73'\n    ),\n)\ndomain_create = domain.create(domain_create_params)\n\n# Renew a domain name\nrenew_domain = domain.renew(domain_name='example-1.nz', expiry_date=date(2024, 2, 23), period=2)\n```\n\n## PyEPP CLI\nPyEPP also has a command line interface that allows the user to interact with the registry system.\n\n```text\nUsage: pyepp [OPTIONS] COMMAND [ARGS]...\n\n  A command line interface to work with PyEpp library.\n\nOptions:\n  --server TEXT                   [required]\n  --port TEXT                     [required]\n  --client-cert TEXT              [required]\n  --client-key TEXT               [required]\n  --user TEXT                     [required]\n  --password TEXT                 [required]\n  -o, --output-format [XML|OBJECT|MIN]\n                                  [default: XML]\n  --no-pretty\n  --dry-run\n  -f, --file FILENAME             If provided, the output will be written in\n                                  the file.\n  -v, --verbose\n  -d, --debug\n  --version                       Show the version and exit.\n  -h, --help                      Show this message and exit.\n\nCommands:\n  contact  To work with Contact objects in the registry.\n  domain   To work with Domain name objects in the registry.\n  host     To work with Host objects in the registry.\n  poll     To manage registry service messages.\n  run      Receive an XML file containing an EPP XML command and execute it.\n```\n\n## Development setup\nClone this project. It's recommended to create virtual environment. Then install the dependencies and \ndevelopment dependencies:\n\n```shell\npip install -r requirements.txt\npip install -r requirements.dev.txt\n```\n\nBefore creating any pull requests please make sure your code lints and there is no security issues in your code \nby running below scripts:\n\n```shell\n./scripts/linter.sh\n./scripts/code-security-check.sh\n```\n\nHappy developing!\n## Contributing\nPlease refer to [CONTRIBUTING.md](CONTRIBUTING.md)\n\n<!-- Markdown link & img dfn's -->\n[wiki]: https://github.com/internetnz/pyepp/wiki\n",
    "bugtrack_url": null,
    "license": "GNU GPLv3",
    "summary": "A Python API on top of the EPP protocol.",
    "version": "0.0.15",
    "project_urls": {
        "Homepage": "https://pyepp.readthedocs.io/en/latest/index.html",
        "Repository": "https://github.com/InternetNZ/pyepp"
    },
    "split_keywords": [
        "epp",
        " registry"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "73ef68a21320bd537cfdc8a02aa5487e6342a0a275b89005b38af181d42b1882",
                "md5": "265b28d45711df17c5aa0e23e91a9fab",
                "sha256": "41c62d4eb1404e615c9cbc8289f696e46613ab334a5d677aaa661d932624b5c1"
            },
            "downloads": -1,
            "filename": "pyepp-0.0.15-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "265b28d45711df17c5aa0e23e91a9fab",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 39790,
            "upload_time": "2024-04-19T03:53:33",
            "upload_time_iso_8601": "2024-04-19T03:53:33.730016Z",
            "url": "https://files.pythonhosted.org/packages/73/ef/68a21320bd537cfdc8a02aa5487e6342a0a275b89005b38af181d42b1882/pyepp-0.0.15-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cc51eefb1bbf3a781a81b9ee296642a0f2145fca10074086c0fc9ec341b8dfd4",
                "md5": "b9da567cc62ad6fcf9d91004be455068",
                "sha256": "ed12968969c8d092a770ea0594bb2683ce7ce9e0d7bce023c902d98a8123d6cb"
            },
            "downloads": -1,
            "filename": "pyepp-0.0.15.tar.gz",
            "has_sig": false,
            "md5_digest": "b9da567cc62ad6fcf9d91004be455068",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 44055,
            "upload_time": "2024-04-19T03:53:35",
            "upload_time_iso_8601": "2024-04-19T03:53:35.480081Z",
            "url": "https://files.pythonhosted.org/packages/cc/51/eefb1bbf3a781a81b9ee296642a0f2145fca10074086c0fc9ec341b8dfd4/pyepp-0.0.15.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-19 03:53:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "InternetNZ",
    "github_project": "pyepp",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [
        {
            "name": "jinja2",
            "specs": [
                [
                    "==",
                    "3.1.3"
                ]
            ]
        },
        {
            "name": "lxml",
            "specs": [
                [
                    "==",
                    "5.2.1"
                ]
            ]
        },
        {
            "name": "bs4",
            "specs": [
                [
                    "==",
                    "0.0.2"
                ]
            ]
        },
        {
            "name": "click",
            "specs": [
                [
                    "==",
                    "8.1.7"
                ]
            ]
        }
    ],
    "lcname": "pyepp"
}
        
Elapsed time: 0.23588s