{"id":19235210,"url":"https://github.com/sensson/python-directadmin","last_synced_at":"2025-04-21T05:31:53.447Z","repository":{"id":57418243,"uuid":"170978745","full_name":"sensson/python-directadmin","owner":"sensson","description":"A Python interface to the DirectAdmin API","archived":false,"fork":false,"pushed_at":"2021-08-17T10:31:16.000Z","size":12,"stargazers_count":12,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-31T15:23:59.693Z","etag":null,"topics":["directadmin","python"],"latest_commit_sha":null,"homepage":null,"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/sensson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-16T08:06:33.000Z","updated_at":"2024-04-24T17:33:19.000Z","dependencies_parsed_at":"2022-09-07T05:50:09.879Z","dependency_job_id":null,"html_url":"https://github.com/sensson/python-directadmin","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sensson%2Fpython-directadmin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sensson%2Fpython-directadmin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sensson%2Fpython-directadmin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sensson%2Fpython-directadmin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sensson","download_url":"https://codeload.github.com/sensson/python-directadmin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223849176,"owners_count":17213640,"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","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":["directadmin","python"],"created_at":"2024-11-09T16:16:17.922Z","updated_at":"2024-11-09T16:16:18.421Z","avatar_url":"https://github.com/sensson.png","language":"Python","readme":"# python-directadmin\n\nThis is a Python interface to the DirectAdmin API.\n\n# Usage\n\n```\nfrom directadmin.api import API\n\napi = API(\n  username='username',\n  password='secure',\n  server='https://1.2.3.4:2222',\n)\n\nresellers = api.cmd_api_show_resellers()\nprint(resellers)\n```\n\n# API\n\n`API()` handles all connections, calls and responses. It accepts the following\nparameters:\n\n* `username`: the username that you use to login to DirectAdmin;\n* `password`: the password belonging to the username;\n* `server`: the server you're connecting to, including http(s) and the port;\n* `debug`: a boolean to turn on debugging mode;\n* `json`: a boolean to enable JSON output in the DirectAdmin API.\n\nAlthough it supports the new JSON output DirectAdmin uses in its evolution\nskin, this hasn't been added for all endpoints yet. JSON output is disabled\nby default.\n\n## Supported methods\n\nThe [API documentation](https://www.directadmin.com/api.html) has a list of all\navailable endpoints in DirectAdmin. All endpoints DirectAdmin provides are\nsupported, including future ones.\n\nIn the DirectAdmin documentation you will find endpoints such as:\n\n* CMD_API_ACCOUNT_USER\n* CMD_API_SHOW_USER_DOMAINS\n\nAnd others.\n\nThese translate directly to methods of the API object. For example:\n\n* CMD_API_ACCOUNT_USER is accessed via `api.cmd_api_account_user()`;\n* CMD_API_SHOW_USER_DOMAINS is accessed via `api.cmd_api_show_user_domains()`.\n\nEvery method accepts the keywords as documented by DirectAdmin. To create a new\nuser you would use:\n\n```\napi.cmd_api_account_user(\n  action='create',\n  add='Submit',\n  username='test',\n  ...\n)\n```\n\n## Impersonation\n\nYou can use `become()` to impersonate another user as an admin or reseller. For\nexample:\n\n```\napi = API(..)\napi.become('username').cmd_api_databases(..)\n```\n\n`become()` will return a new instance of `API()`.\n\n# Error handling\n\n* `ResponseException` is raised when the API returns an unexpected response;\n* `UnauthorizedException` is raised when your username or password is wrong.\n\nSet `debug` to `True` when initializing the API object to get more information.\n\n# Tests\n\nSorry, this code doesn't come with tests yet.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsensson%2Fpython-directadmin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsensson%2Fpython-directadmin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsensson%2Fpython-directadmin/lists"}