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.py
as 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.py
file 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
, andNameservers
toApi.domains_create
, which allow registering domains with a company, and allow setting nameservers immediately while purchasing a domain.Added
**user_payload
toApi.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
,RegistrantEmailAddress
etc.)Added helper methods
get_element
andget_element_dict
for 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_delHost
IsSuccess
/Updated
etc., some commands such asdomains_create
return 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
Api
methods. Used the Python 2.x / early 3.x compatible# type: () -> xxx
format, as I'm unsure what versions of Python that PyNamecheap is aiming to support.Updated
namecheap_tests.py
to validate the newdict
return values from methods such asdomain_create
Added
requests
andnose
torequirements.txt
to simplify dependency installation in a dev environment