More params + user_payload for domains_create, add returns to method calls, add type annotations + more #32
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes a wide variety of improvements and additions to PyNamecheap, which makes the library more IDE friendly (type annotations), and more flexible (user specifiable extra payload kwargs + return response data everywhere)
I have not touched the version in
setup.pyas I'm not a maintainer for PyNamecheap, and you may want to merge in multiple PRs to make up the 0.0.4 release.I've noticed the main
namecheap.pyfile hasn't been updated in several years, so just in-case this project is abandoned, we'll be maintaining and publishing our fork of this library here: https://github.com/Privex/PyNamecheapNotable changes in this pull request
Added
OrganizationName,JobTitle,PromotionCode, andNameserverstoApi.domains_create, which allow registering domains with a company, and allow setting nameservers immediately while purchasing a domain.Added
**user_payloadtoApi.domains_create, which allows users to specify custom payload keys that aren't yet implemented, or override payload keys which were auto-generated by the function (e.g.WGEnabled,RegistrantEmailAddressetc.)Added helper methods
get_elementandget_element_dictfor working with XML objectsAdded
self.get_element_dict()return values todomain_create,domains_dns_setDefault,domains_dns_setHosts,domains_dns_setCustom,domains_dns_addHost, anddomains_dns_delHostIsSuccess/Updatedetc., some commands such asdomains_createreturn a lot of useful data, such as the amount that the domain costed, IDs for the domain / transaction / order, whether WhoisGuard was enabled, whether or not a free PostiveSSL certificate was claimed etc.Added type annotations to most
Apimethods. Used the Python 2.x / early 3.x compatible# type: () -> xxxformat, as I'm unsure what versions of Python that PyNamecheap is aiming to support.Updated
namecheap_tests.pyto validate the newdictreturn values from methods such asdomain_createAdded
requestsandnosetorequirements.txtto simplify dependency installation in a dev environment