Skip to content

Commit ad71881

Browse files
ehsan-fjdependabot[bot]levius0
authored
Version 0.1.5 (#207)
* Bump beautifulsoup4 from 4.12.3 to 4.13.3 Bumps [beautifulsoup4](https://www.crummy.com/software/BeautifulSoup/bs4/) from 4.12.3 to 4.13.3. --- updated-dependencies: - dependency-name: beautifulsoup4 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * Bump pip-audit from 2.7.3 to 2.8.0 Bumps [pip-audit](https://github.com/pypa/pip-audit) from 2.7.3 to 2.8.0. - [Release notes](https://github.com/pypa/pip-audit/releases) - [Changelog](https://github.com/pypa/pip-audit/blob/main/CHANGELOG.md) - [Commits](pypa/pip-audit@v2.7.3...v2.8.0) --- updated-dependencies: - dependency-name: pip-audit dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * Bump coverage from 7.6.9 to 7.6.11 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.6.9 to 7.6.11. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](nedbat/coveragepy@7.6.9...7.6.11) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * Bump myst-parser from 4.0.0 to 4.0.1 Bumps [myst-parser](https://github.com/executablebooks/MyST-Parser) from 4.0.0 to 4.0.1. - [Release notes](https://github.com/executablebooks/MyST-Parser/releases) - [Changelog](https://github.com/executablebooks/MyST-Parser/blob/master/CHANGELOG.md) - [Commits](executablebooks/MyST-Parser@v4.0.0...v4.0.1) --- updated-dependencies: - dependency-name: myst-parser dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * Bump lxml from 5.3.0 to 5.3.1 Bumps [lxml](https://github.com/lxml/lxml) from 5.3.0 to 5.3.1. - [Release notes](https://github.com/lxml/lxml/releases) - [Changelog](https://github.com/lxml/lxml/blob/master/CHANGES.txt) - [Commits](lxml/lxml@lxml-5.3.0...lxml-5.3.1) --- updated-dependencies: - dependency-name: lxml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * Bump bandit from 1.8.2 to 1.8.3 Bumps [bandit](https://github.com/PyCQA/bandit) from 1.8.2 to 1.8.3. - [Release notes](https://github.com/PyCQA/bandit/releases) - [Commits](PyCQA/bandit@1.8.2...1.8.3) --- updated-dependencies: - dependency-name: bandit dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * Bump coverage from 7.6.11 to 7.6.12 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.6.11 to 7.6.12. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](nedbat/coveragepy@7.6.11...7.6.12) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * Bump pytest from 8.3.4 to 8.3.5 Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.3.4 to 8.3.5. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](pytest-dev/pytest@8.3.4...8.3.5) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * Bump jinja2 from 3.1.5 to 3.1.6 Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.5 to 3.1.6. - [Release notes](https://github.com/pallets/jinja/releases) - [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst) - [Commits](pallets/jinja@3.1.5...3.1.6) --- updated-dependencies: - dependency-name: jinja2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * Bump coverage from 7.6.12 to 7.7.0 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.6.12 to 7.7.0. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](nedbat/coveragepy@7.6.12...7.7.0) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * Bump coverage from 7.7.0 to 7.7.1 Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.7.0 to 7.7.1. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](nedbat/coveragepy@7.7.0...7.7.1) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * Cli load extensions and hello command (#204) * Add hello command to cli and extension argument * Change LOGIN_XML to support loading extensions * Update the docs * set the version to 0.1.5 --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: levius0 <[email protected]>
2 parents a12341a + a65345e commit ad71881

10 files changed

+68
-23
lines changed

README.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
# PyEPP
2-
> A Python API on top of EPP protocol to work with registry systems.
2+
>
3+
> A Python API on top of the EPP protocol to work easier with registry systems.
34
45
This a Python API on [EPP](https://en.wikipedia.org/wiki/Extensible_Provisioning_Protocol) protocol to connect to
56
any registry systems that support EPP and work with it. It supports bellow RFCs:
7+
68
- [RFC 5730 - Extensible Provisioning Protocol](https://datatracker.ietf.org/doc/html/rfc5730)
79
- [RFC 5731 - Domain Name Mapping](https://datatracker.ietf.org/doc/html/rfc5731)
810
- [RFC 5732 - Host Mapping](https://datatracker.ietf.org/doc/html/rfc5732)
911
- [RFC 5733 - Contact Mapping](https://datatracker.ietf.org/doc/html/rfc5733)
1012
- [RFC 5734 - Transport over TCP](https://datatracker.ietf.org/doc/html/rfc5734)
1113

12-
1314
## Installation
1415

1516
```sh
@@ -96,6 +97,7 @@ renew_domain = domain.renew(domain_name='example-1.nz', expiry_date=date(2024, 2
9697
```
9798

9899
## PyEPP CLI
100+
99101
PyEPP also has a command line interface that allows the user to interact with the registry system.
100102

101103
```text
@@ -108,8 +110,10 @@ Options:
108110
--port TEXT [required]
109111
--user TEXT [required]
110112
--password TEXT [required]
111-
--client-cert TEXT [optional]
112-
--client-key TEXT [optional]
113+
--client-cert TEXT
114+
--client-key TEXT
115+
--extension TEXT The extension to be loaded for the EPP
116+
command.
113117
-o, --output-format [XML|OBJECT|MIN]
114118
[default: XML]
115119
--no-pretty
@@ -124,46 +128,53 @@ Options:
124128
Commands:
125129
contact To work with Contact objects in the registry.
126130
domain To work with Domain name objects in the registry.
131+
hello Sends a hello command to the server and receives the Greeting...
127132
host To work with Host objects in the registry.
128133
poll To manage registry service messages.
129134
run Receive an XML file containing an EPP XML command and execute it.
130135
```
131136

132137
### Enable shell autocomplete
138+
133139
To enable shell autocompletion for your shell follow the below commands:
134140

135141
#### Zsh
142+
136143
```sh
137144
mkdir -p ~/.pyepp
138145
_PYEPP_COMPLETE=zsh_source pyepp > ~/.pyepp/shell-complete.zsh
139146
```
140147

141148
Source the file in `~/.zshrc`.
149+
142150
```sh
143151
. ~/.pyepp/shell-complete.zsh
144152
```
145153

146154
#### Bash
155+
147156
```sh
148157
mkdir -p ~/.pyepp
149158
_PYEPP_COMPLETE=bash_source pyepp > ~/.pyepp/shell-complete.bash
150159
```
151160

152161
Source the file in `~/.bashrc`.
162+
153163
```sh
154164
. ~/.pyepp/shell-complete.bash
155165
```
156166

157167
## Development setup
158-
Clone this project. It's recommended to create virtual environment. Then install the dependencies and
168+
169+
Clone this project. It's recommended to create virtual environment. Then install the dependencies and
159170
development dependencies:
160171

161172
```shell
162173
pip install -r requirements.txt
163174
pip install -r requirements.dev.txt
164175
```
165176

166-
Before creating any pull requests please make sure your code lints and there is no security issues in your code
177+
Before creating any pull requests please make sure your code lints and there is no security issues in your code
167178
by running below scripts:
168179

169180
```shell
@@ -172,8 +183,9 @@ by running below scripts:
172183
```
173184

174185
Happy developing!
186+
175187
## Contributing
188+
176189
Please refer to [CONTRIBUTING.md](CONTRIBUTING.md)
177190

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

docs/cli.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,17 @@ To see the help page:
1717
sh> pyepp -h
1818
Usage: pyepp [OPTIONS] COMMAND [ARGS]...
1919
20-
A command line interface to work with PyEpp library.
20+
A command line interface to work with PyEpp library.
2121
2222
Options:
2323
--server TEXT [required]
2424
--port TEXT [required]
2525
--user TEXT [required]
2626
--password TEXT [required]
27-
--client-cert TEXT [optional]
28-
--client-key TEXT [optional]
27+
--client-cert TEXT
28+
--client-key TEXT
29+
--extension TEXT The extension to be loaded for the EPP
30+
command.
2931
-o, --output-format [XML|OBJECT|MIN]
3032
[default: XML]
3133
--no-pretty
@@ -40,6 +42,7 @@ To see the help page:
4042
Commands:
4143
contact To work with Contact objects in the registry.
4244
domain To work with Domain name objects in the registry.
45+
hello Sends a hello command to the server and receives the Greeting...
4346
host To work with Host objects in the registry.
4447
poll To manage registry service messages.
4548
run Receive an XML file containing an EPP XML command and execute it.

docs/index.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,12 @@ PyEPP also has a command line interface that allows the user to interact with th
110110
Options:
111111
--server TEXT [required]
112112
--port TEXT [required]
113-
--client-cert TEXT [required]
114-
--client-key TEXT [required]
115113
--user TEXT [required]
116114
--password TEXT [required]
115+
--client-cert TEXT
116+
--client-key TEXT
117+
--extension TEXT The extension to be loaded for the EPP
118+
command.
117119
-o, --output-format [XML|OBJECT|MIN]
118120
[default: XML]
119121
--no-pretty
@@ -128,6 +130,7 @@ PyEPP also has a command line interface that allows the user to interact with th
128130
Commands:
129131
contact To work with Contact objects in the registry.
130132
domain To work with Domain name objects in the registry.
133+
hello Sends a hello command to the server and receives the Greeting...
131134
host To work with Host objects in the registry.
132135
poll To manage registry service messages.
133136
run Receive an XML file containing an EPP XML command and execute it.

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
sphinx==8.1.3
2-
myst-parser==4.0.0
2+
myst-parser==4.0.1
33
sphinx-rtd-theme==3.0.2

pyepp/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
PyEPP Package
33
"""
44

5-
__version__ = "0.1.4"
5+
__version__ = "0.1.5"
66

77
from pyepp.epp import (
88
EppCommunicator,

pyepp/cli/__main__.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ def load_config():
6262
@click.option("--password", envvar="PYEPP_PASSWORD", required=True)
6363
@click.option("--client-cert", envvar="PYEPP_CLIENT_CERT", required=False)
6464
@click.option("--client-key", envvar="PYEPP_CLIENT_KEY", required=False)
65+
@click.option(
66+
"--extension",
67+
envvar="PYEPP_EXTESION",
68+
required=False,
69+
help="The extension to be loaded for the EPP command.",
70+
multiple=True,
71+
)
6572
@click.option(
6673
"-o",
6774
"--output-format",
@@ -91,6 +98,7 @@ def pyepp_cli(
9198
client_key,
9299
user,
93100
password,
101+
extension,
94102
output_format,
95103
no_pretty,
96104
dry_run,
@@ -106,6 +114,7 @@ def pyepp_cli(
106114
client_key,
107115
user,
108116
password,
117+
extension,
109118
output_format,
110119
no_pretty,
111120
dry_run,
@@ -132,8 +141,17 @@ def run_xml(ctx, xml):
132141
utils.echo(result)
133142

134143

144+
@click.command("hello")
145+
@click.pass_context
146+
def hello(ctx):
147+
"""Sends a hello command to the server and receives the Greeting response."""
148+
greeting = ctx.obj.hello()
149+
utils.echo(greeting)
150+
151+
135152
pyepp_cli.add_command(run_xml)
136153
pyepp_cli.add_command(contact_group)
137154
pyepp_cli.add_command(domain_group)
138155
pyepp_cli.add_command(host_group)
139156
pyepp_cli.add_command(poll_group)
157+
pyepp_cli.add_command(hello)

pyepp/cli/cli.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def __init__(
3838
client_key,
3939
user,
4040
password,
41+
extensions,
4142
output_format,
4243
no_pretty,
4344
dry_run=False,
@@ -47,6 +48,8 @@ def __init__(
4748
self.user = user
4849
self.password = password
4950

51+
self.extensions = extensions
52+
5053
self.output_format = output_format
5154
self.no_pretty = no_pretty
5255
self.dry_run = dry_run
@@ -57,11 +60,16 @@ def connect(self):
5760
self.epp.connect()
5861

5962
def login(self):
60-
self.epp.login(self.user, self.password)
63+
self.epp.login(self.user, self.password, extensions=self.extensions)
6164

6265
def logout(self):
6366
self.epp.logout()
6467

68+
def hello(self):
69+
self.connect()
70+
result = self.epp.hello()
71+
return result
72+
6573
def format_output(self, result: EppResultData):
6674
output = result
6775
if self.output_format == "XML":

pyepp/command_templates.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,14 @@
2424
<lang>en</lang>
2525
</options>
2626
<svcs>
27+
<objURI>urn:ietf:params:xml:ns:epp-1.0</objURI>
2728
<objURI>urn:ietf:params:xml:ns:domain-1.0</objURI>
2829
<objURI>urn:ietf:params:xml:ns:contact-1.0</objURI>
2930
<objURI>urn:ietf:params:xml:ns:host-1.0</objURI>
3031
<svcExtension>
3132
<extURI>urn:ietf:params:xml:ns:secDNS-1.1</extURI>
3233
{% for extension in extensions %}
33-
<extURI>{{ extension }}</extURI>
34+
<extURI>urn:ietf:params:xml:ns:{{ extension }}</extURI>
3435
{% endfor %}
3536
</svcExtension>
3637
</svcs>

requirements.dev.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
bandit==1.8.2
2-
coverage==7.6.9
1+
bandit==1.8.3
2+
coverage==7.7.1
33
pylint==3.2.7
4-
pytest==8.3.4
5-
pip-audit==2.7.3
4+
pytest==8.3.5
5+
pip-audit==2.8.0

requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
jinja2==3.1.5
2-
lxml==5.3.0
3-
beautifulsoup4==4.12.3
1+
jinja2==3.1.6
2+
lxml==5.3.1
3+
beautifulsoup4==4.13.3
44
click==8.1.8

0 commit comments

Comments
 (0)