{"id":29826652,"url":"https://github.com/infinityofspace/pkb_client","last_synced_at":"2026-03-08T10:31:34.741Z","repository":{"id":38204528,"uuid":"352441932","full_name":"infinityofspace/pkb_client","owner":"infinityofspace","description":"Python client for the Porkbun API","archived":false,"fork":false,"pushed_at":"2025-06-29T21:42:29.000Z","size":328,"stargazers_count":17,"open_issues_count":4,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-29T22:31:05.561Z","etag":null,"topics":["api-client","dns-record","porkbun","python3"],"latest_commit_sha":null,"homepage":"https://infinityofspace.github.io/pkb_client","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/infinityofspace.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"License","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-03-28T21:24:48.000Z","updated_at":"2025-06-29T21:42:26.000Z","dependencies_parsed_at":"2023-11-24T20:26:05.262Z","dependency_job_id":"4f570c8f-87ec-4d1f-8fb1-1b9306dbbc5b","html_url":"https://github.com/infinityofspace/pkb_client","commit_stats":{"total_commits":24,"total_committers":2,"mean_commits":12.0,"dds":"0.16666666666666663","last_synced_commit":"b3543504d651c48036d355eaa7b6467a1ba92bc1"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/infinityofspace/pkb_client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinityofspace%2Fpkb_client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinityofspace%2Fpkb_client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinityofspace%2Fpkb_client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinityofspace%2Fpkb_client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/infinityofspace","download_url":"https://codeload.github.com/infinityofspace/pkb_client/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinityofspace%2Fpkb_client/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267633332,"owners_count":24118756,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-client","dns-record","porkbun","python3"],"created_at":"2025-07-29T05:11:26.176Z","updated_at":"2026-03-08T10:31:34.735Z","avatar_url":"https://github.com/infinityofspace.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pkb_client\n\nPython client for the Porkbun API\n\n---\n[![PyPI](https://img.shields.io/pypi/v/pkb_client)](https://pypi.org/project/pkb-client/) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pkb_client) [![Downloads](https://static.pepy.tech/personalized-badge/pkb-client?period=total\u0026units=international_system\u0026left_color=grey\u0026right_color=orange\u0026left_text=Total%20Downloads)](https://pepy.tech/project/pkb-client) ![GitHub](https://img.shields.io/github/license/infinityofspace/pkb_client) ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/infinityofspace/pkb_client/pypi-publish-release.yml)\n---\n\n### Table of Contents\n\n1. [About](#about)\n2. [Installation](#installation)\n    1. [With pip (recommend)](#with-pip-recommend)\n    2. [From source](#from-source)\n3. [Usage](#usage)\n4. [Notes](#notes)\n5. [Third party notices](#third-party-notices)\n6. [Development](#development)\n    1. [Setup environment](#setup-environment)\n    2. [Tests](#tests)\n    3. [Documentation](#documentation)\n7. [License](#license)\n\n---\n\n### About\n\n*pkb_client* is a python client for the [Porkbun](https://porkbun.com) API. It supports the v3 of the API. You can\nfind the official documentation of the Porkbun API [here](https://api.porkbun.com/api/json/v3/documentation).\n\n### Installation\n\nThis project only works with Python 3, make sure you have at least Python 3.10 installed.\n\n#### With pip (recommend)\n\nUse the following command to install *pkb_client* with pip:\n\n```commandline\npip3 install pkb_client\n```\n\nYou can also very easily update to a newer version:\n\n```commandline\npip3 install pkb_client -U\n```\n\n#### From source\n\n```commandline\ngit clone https://github.com/infinityofspace/pkb_client.git\ncd pkb_client\npip3 install .\n```\n\n### Usage\n\nEach request must be made with the API key and secret. You can easily create them at Porkbun. Just follow\nthe [official instructions](https://api.porkbun.com/api/json/v3/documentation#Authentication). Make sure that you explicitly\nactivate the API usage for your domain at the end. There are two ways to use `pkb_client`. The first way is to use it as\na Python module. See the [module documentation](https://infinityofspace.github.io/pkb_client) for more information. The\nsecond way is to use the module from the command line, see below for more information.\n\nAfter installation *pkb_client* is available under the command `pkb-client`.\n\nYou have to specify your API key and secret each time as follows:\n\n```commandline\npkb-client -k \u003cYOUR-API-KEY\u003e -s \u003cYOUR-API-SECRET\u003e ping\n```\n\nIf you don't want to specify the key and secret in the program call, because for example the command line calls are\nlogged, and you don't want to log the API access, then you can also set the environment variables `PKB_API_KEY` and\n`PKB_API_SECRET`. If you not specify API key and secret in any way, *pkb-client* asks for a user input. The command line\narguments of the API key and secret have the highest priority.\n\nYou can see an overview of all usable cli methods via the help:\n\n```commandline\npkb-client -h\n```\n\nIf you need more help on a supported API method, you can use the following command, for example for the ping method:\n\n```commandline\npkb-client ping -h\n```\n\n#### Here are a few usage examples:\n\nCreate a new TXT record for the subdomain `test` of the domain `example.com` with the value `porkbun is cool` and a TTL\nof `500`:\n\n```commandline\npkb-client -k \u003cYOUR-API-KEY\u003e -s \u003cYOUR-API-KEY-SECRET\u003e dns-create example.com TXT \"porkbun is cool\" --name test --ttl 500\n```\n\nThe call returns the DNS record id. The record DNS ids are used to distinguish the DNS records and can be used for\nediting or deleting records. The ID is only a Porkbun internal identifier and is not publicly available.\n\nDelete the DNS record with the ID `12345` of the domain `example.com`:\n\n```commandline\npkb-client -k \u003cYOUR-API-KEY\u003e -s \u003cYOUR-API-SECRET\u003e dns-delete example.com 12345\n```\n\nGet all DNS records of the domain `example.com`:\n\n```commandline\npkb-client -k \u003cYOUR-API-KEY\u003e -s \u003cYOUR-API-SECRET\u003e dns-retrieve example.com\n```\n\nChange the TXT DNS record content with the ID `456789` of the domain `example.com` to `the answer is 42`:\n\n```commandline\npkb-client -k \u003cYOUR-API-KEY\u003e -s \u003cYOUR-API-SECRET\u003e dns-edit example.com 456789 TXT \"the answer is 42\"\n```\n\nExporting all current DNS records of the domain `example.com` to the file `dns_recods.json`:\n\n```commandline\npkb-client -k \u003cYOUR-API-KEY\u003e -s \u003cYOUR-API-SECRET\u003e dns-export example.com dns_recods.json\n```\n\nRemove all existing DNS records of the domain `example.com` and restore the DNS records from the file `dns_recods.json`:\n\n```commandline\npkb-client -k \u003cYOUR-API-KEY\u003e -s \u003cYOUR-API-SECRET\u003e dns-import example.com dns_recods.json clear\n```\n\n*Note:* The `dns-import` function uses the record ID to distinguish DNS records.\n\n### Notes\n\nCurrently, TTL smaller than `600` are ignored by the Porkbun API and the minimum value is `600`, although a minimum\nvalue of `300` is [supported](https://api.porkbun.com/api/json/v3/documentation) and allowed by the RFC standard. However,\nyou can do TTL smaller than `600` via the web dashboard.\n\n### Third party notices\n\nAll modules used by this project are listed below:\n\n|                         Name                          |                                              License                                              |\n|:-----------------------------------------------------:|:-------------------------------------------------------------------------------------------------:|\n|      [requests](https://github.com/psf/requests)      |            [Apache 2.0](https://raw.githubusercontent.com/psf/requests/master/LICENSE)            |\n| [setuptools](https://github.com/pypa/setuptools)      |               [MIT](https://raw.githubusercontent.com/pypa/setuptools/main/LICENSE)               |\n|    [sphinx](https://github.com/sphinx-doc/sphinx)     | [BSD 2 Clause](https://raw.githubusercontent.com/sphinx-doc/sphinx/refs/heads/master/LICENSE.rst) |\n|  [dnspython](https://github.com/rthalley/dnspython)   |       [ISC](https://raw.githubusercontent.com/rthalley/dnspython/refs/heads/main/LICENSEc)        |\n|  [responses](https://github.com/getsentry/responses)  |   [Apache 2.0](https://raw.githubusercontent.com/getsentry/responses/refs/heads/master/LICENSE)   |\n|       [ruff](https://github.com/astral-sh/ruff)       |          [MIT](https://raw.githubusercontent.com/astral-sh/ruff/refs/heads/main/LICENSE)          |\n\nFurthermore, this readme file contains embeddings of [Shields.io](https://github.com/badges/shields)\nand [PePy](https://github.com/psincraian/pepy) images.\n\n_This project is not associated with Porkbun LLC._\n\n### Development\n\n#### Setup environment\n\nFirst get the source code:\n\n```commandline\ngit clone https://github.com/infinityofspace/pkb_client.git\ncd pkb_client\n```\n\nNow create a virtual environment, activate it and install all dependencies with the following commands:\n\n```commandline\npython3 -m venv venv\nsource venv/bin/activate\npip3 install -r requirements.txt\n```\n\nNow you can start developing.\n\nFeel free to contribute to this project by creating a pull request.\nBefore you create a pull request, make sure that you code meets the following requirements (you can use the specified\ncommands to check/fulfill the requirements):\n\n- check unit tests: `python -m unittest tests/*.py`\n- format the code: `ruff format`\n- check linting errors: `ruff check`\n\n#### Tests\n\nYou can run the tests with the following command:\n\n```commandline\npython -m unittest tests/*.py\n```\n\n#### Documentation\n\nTo build the documentation you can use the following commands:\n\n```commandline\nsphinx-apidoc -f -o docs/source pkb_client\ncd docs \u0026\u0026 make html\n```\n\n### License\n\n[MIT](https://github.com/infinityofspace/pkb_client/blob/master/License) - Copyright (c) Marvin Heptner\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfinityofspace%2Fpkb_client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finfinityofspace%2Fpkb_client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfinityofspace%2Fpkb_client/lists"}