{ "info": { "author": "", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", "Operating System :: OS Independent", "Programming Language :: Python :: 3 :: Only", "Topic :: Internet :: Name Service (DNS)", "Topic :: Software Development :: Libraries", "Topic :: Utilities" ], "description": "# PyNonameDomain\n\n## Unofficial NonameDomain.hu API module and CLI tool\n\n### Installation\n```bash\npip install pynonamedomain // Use pip3 if Python2 is the default on your system\n```\n\n---\n---\n\n## nnd-cli\n\n```\n$ nnd-cli \nUsage: nnd-cli [OPTIONS] COMMAND [ARGS]...\n\n Unofficial CLI tool for NonameDomain.hu\n\nOptions:\n --help Show this message and exit.\n\nCommands:\n create Create new entry in the zone.\n login Aquire API token.\n read Read/find DNS entries in the zone.\n remove Remove DNS entry from the zone.\n update Update DNS entry in the zone.\n version Version info.\n```\n\n### Autocomplete\n```bash\neval \"$(_NND_CLI_COMPLETE=source nnd-cli)\" # for BASH\neval \"$(_NND_CLI_COMPLETE=source_zsh nnd-cli)\" # for ZSH\n```\n\n### Basic usage\n\n```bash\nexport NND_DOMAIN=\"example.com\" # optional\nexport NND_USERNAME=\"api_user\" # optional\nexport NND_PASSWORD=\"api_pw\" # optional\nexport NND_TOKEN=$(nnd-cli login -q) # optional\nnnd-cli read | jq\nnnd-cli create -r '{\"type\":\"A\",\"host\":\"test\",\"ip\":\"192.168.0.1\",\"ttl\":\"60\"}'\nnnd-cli read -r '{\"type\":\"A\"}' -o csv\nnnd-cli update --hash d67053c0cc0a544e074696a63723b296feeec564d -r '{\"host\":\"test2\"}'\nnnd-cli remove --hash d67053c0cc0a544e074696a63723b296feeec564d\n```\n\nSee per command `--help` for more info.\n\n### Using with [`certbot`](https://certbot.eff.org)\n\n```bash\nexport NND_DOMAIN=\"example.com\" # recommended\nexport NND_USERNAME=\"api_user\" # mandatory\nexport NND_PASSWORD=\"api_pw\" # mandatory\nexport NND_TOKEN=$(nnd-cli login -q) # mandatory\ncertbot certonly --manual --preferred-challenges=dns --manual-auth-hook \"nnd-cli create -c\" --manual-cleanup-hook \"nnd-cli remove -q\" -d example.com --manual-public-ip-logging-ok --agree-tos -m \"your@email.address\"\n```\n\n### Using with [`lego`](https://go-acme.github.io/lego)\n\n```bash\ncp /usr/lib/python3.7/site-packages/pynonamedomain/lego-helper.sh .\n# edit ./lego-helper.sh with your credentials\nexport EXEC_PATH=$(pwd)/lego-helper.sh\nlego --dns exec --domains example.com --email \"your@email.address\" --accept-tos run\n```\n\n### Using with [Traefik](https://traefik.io)\n\nSince Traefik uses `lego` for ACME certs, the same helper script can be used. \n\n```bash\ncp /usr/lib/python3.7/site-packages/pynonamedomain/lego-helper.sh .\n# edit ./lego-helper.sh with your credentials\nexport EXEC_PATH=$(pwd)/lego-helper.sh\n# Traefik will handle the rest\n```\n\n---\n---\n\n## pynonamedomain\n\n\n### Usage\n\n> `class NonameDomain(domain, api_user=None, api_pw=None, token=None)`\n\nClass to implement CRUD operations to the Noname Domain API \n\nLog into the API.\n\n\n#### Args\n\n**`domain`**: the domain to manage\n\n**`api_user`**: API user\n\n**`api_pw`**: password of API user\n\n**`token`**: API token\n\n\n#### Raises\n\n**`ValueError`**: if neither user+password or token provided\n\n\n#### Examples\n\n`nnd = pynonamedomain.NonameDomain(\"example.com\", \"username\", \"password\")`\n\n`nnd = pynonamedomain.NonameDomain(\"example.org\", token = \"3e4n23y87tresnt32erstn48\")`\n\n---\n\n> `def create(self, **data)`\n\nCreate new DNS entry.\n\n\n###### Args\n\n**`**data`**: a dictionary with all the necessary data to create a new entry\n\n\n###### Raises\n\n**`SubdomainAlreadyExists`**: if entry already exists\n\n**`requests.HTTPError`**: if HTTP error occurs\n\n**`requests.SSLError`**: if SSL error occurs\n\n\n###### Returns\n\n'ok' if entry created successfully\n\n\n###### Examples\n\n`nnd.create(type = \"A\", host = \"test\", \"ip\" = \"192.168.0.1\", ttl = \"600\")`\n\n`nnd.create(type = \"TXT\", text = \"something\", host = \"sample\", ttl = \"60\")`\n\n---\n\n> `def read(self, cached=True, **search)`\n\nRead the current entries in the zone.\n\n\n###### Args\n\n**`cached`**: returns cached list if True, otherwise query the API\n\n\n**`**search`**: filter the entries based on their attributes\n\n\n###### Raises\n\n**`SubdomainNotFound`**: if entry not found\n\n\n###### Returns\n\nall subdomains if **search** is omitted, otherwise the matching subdomains\n\n\n###### Examples\n\n`nnd.read()`\n\n`nnd.read(cached = False)`\n\n`nnd.read(type = \"A\")`\n\n---\n\n> `def remove(self, record_hash)`\n\nRemove entry from the zone.\n\n\n###### Args\n\n**`record_hash`**: hash of the entry to be deleted\n\n\n###### Raises\n\n`requests.HTTPError`: if HTTP error occurs\n\n`requests.SSLError`: if SSL error occurs\n\n\n###### Returns\n\n'ok' if entry removed successfully\n\n\n###### Examples\n\n`nnd.remove(\"ab83e38eaquf86ye28e35E8c6\")`\n\n---\n\n> `def update(self, record_hash, new_values)`\n\nUpdate entry in the zone.\n\n\n###### Args\n\n**`record hash`**: hash of the entry to be updated\n\n**`new_values`**: dictionary of the new attributes\n\n\n###### Raises\n\n**`ValueError`**: if `new_values` is not a dictionary\n\n\n###### Returns\n\n'ok' if entry updated successfully\n\n\n###### Examples\n\n`nnd.update(\"ab83e38eaquf86ye28e35E8c6\", text = \"newtext\", ttl = \"300\")`\n\n`nnd.update(\"ab83e38eaquf86ye28e35E8c6\", type = \"A\", ip = \"192.168.1.38\")`\n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://gitlab.com/slacker/pynonamedomain", "keywords": "nonamedomain nonamedomain.hu dns", "license": "GPLv3+", "maintainer": "", "maintainer_email": "", "name": "pynonamedomain", "package_url": "https://pypi.org/project/pynonamedomain/", "platform": "", "project_url": "https://pypi.org/project/pynonamedomain/", "project_urls": { "Homepage": "https://gitlab.com/slacker/pynonamedomain" }, "release_url": "https://pypi.org/project/pynonamedomain/1.0.2/", "requires_dist": [ "Click", "requests", "tldextract" ], "requires_python": "", "summary": "Unofficial NonameDomain API module/client", "version": "1.0.2" }, "last_serial": 5978848, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "a249cd8b0776c27822f28b05ee7a9361", "sha256": "8593b817ca53f9a38d52f2c358194d2fb25b1b4fdb14bcf9b85f87ea8cec0ee3" }, "downloads": -1, "filename": "pynonamedomain-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "a249cd8b0776c27822f28b05ee7a9361", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 20222, "upload_time": "2019-09-30T16:10:59", "url": "https://files.pythonhosted.org/packages/2d/c9/cb22ec73a27661e54cd1626895f685fcc15d2f301205cf478a669b4fc3c0/pynonamedomain-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b3f377e1afc1a04a963a024b231a0979", "sha256": "e74cba25a4cf3048b21a259c3e11e74fceb300ed07910f5c13cd440f4e05b8b7" }, "downloads": -1, "filename": "pynonamedomain-1.0.0.tar.gz", "has_sig": false, "md5_digest": "b3f377e1afc1a04a963a024b231a0979", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7918, "upload_time": "2019-09-30T16:11:02", "url": "https://files.pythonhosted.org/packages/aa/31/b59c5e311b43edac4a27a851b1897d9e69c017758a31e9590a0b8e76daf6/pynonamedomain-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "202528766a65538520052ff59bb009a4", "sha256": "b5ed314125a06e04d12f479db94b434fe231f4f9140951339b463bebd5cddfec" }, "downloads": -1, "filename": "pynonamedomain-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "202528766a65538520052ff59bb009a4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 20369, "upload_time": "2019-10-01T04:32:54", "url": "https://files.pythonhosted.org/packages/46/6d/9959ddf5d922ac7eb743d393f69fd498832658200b8e549b2346361b434e/pynonamedomain-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7a5624792539fe3da0c7d338e73b5d8a", "sha256": "2795991b33dbe4eeb087bf6b5bc3a6505651016e17ffdedd4ae8610db758a3be" }, "downloads": -1, "filename": "pynonamedomain-1.0.1.tar.gz", "has_sig": false, "md5_digest": "7a5624792539fe3da0c7d338e73b5d8a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7975, "upload_time": "2019-10-01T04:32:56", "url": "https://files.pythonhosted.org/packages/e1/46/26511743c5259e6be662b2c50cc163cb669f85b0f1ff1f38d91a85543f6a/pynonamedomain-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "27a1d32c9bc03a1a45ca2c9f963a1627", "sha256": "2bcbf258898ce291faf5d80c408a5bf69c03030d750dbccdaad71443b816abea" }, "downloads": -1, "filename": "pynonamedomain-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "27a1d32c9bc03a1a45ca2c9f963a1627", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 20454, "upload_time": "2019-10-15T18:46:53", "url": "https://files.pythonhosted.org/packages/60/c3/0669eaa27618bf7b24c00e68a9df0ee4cdf990062aa96002b33300f53576/pynonamedomain-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e99de34c3e8a0e84c2184421d828e617", "sha256": "3cc3219e7cfc4e9e608d2f84a4de81c667f612ccbb74919b76e951484088b180" }, "downloads": -1, "filename": "pynonamedomain-1.0.2.tar.gz", "has_sig": false, "md5_digest": "e99de34c3e8a0e84c2184421d828e617", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8043, "upload_time": "2019-10-15T18:46:56", "url": "https://files.pythonhosted.org/packages/c9/26/b952956879fa9dca5a985a37a5588fc24a74f0e1f82157a262b6a0541862/pynonamedomain-1.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "27a1d32c9bc03a1a45ca2c9f963a1627", "sha256": "2bcbf258898ce291faf5d80c408a5bf69c03030d750dbccdaad71443b816abea" }, "downloads": -1, "filename": "pynonamedomain-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "27a1d32c9bc03a1a45ca2c9f963a1627", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 20454, "upload_time": "2019-10-15T18:46:53", "url": "https://files.pythonhosted.org/packages/60/c3/0669eaa27618bf7b24c00e68a9df0ee4cdf990062aa96002b33300f53576/pynonamedomain-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e99de34c3e8a0e84c2184421d828e617", "sha256": "3cc3219e7cfc4e9e608d2f84a4de81c667f612ccbb74919b76e951484088b180" }, "downloads": -1, "filename": "pynonamedomain-1.0.2.tar.gz", "has_sig": false, "md5_digest": "e99de34c3e8a0e84c2184421d828e617", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8043, "upload_time": "2019-10-15T18:46:56", "url": "https://files.pythonhosted.org/packages/c9/26/b952956879fa9dca5a985a37a5588fc24a74f0e1f82157a262b6a0541862/pynonamedomain-1.0.2.tar.gz" } ] }