{"id":20738974,"url":"https://github.com/blacksuan19/redash-python","last_synced_at":"2025-04-24T02:21:17.946Z","repository":{"id":54566633,"uuid":"522487541","full_name":"Blacksuan19/redash-python","owner":"Blacksuan19","description":"A More complete Redash API python client","archived":false,"fork":false,"pushed_at":"2023-07-17T10:54:12.000Z","size":2083,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T04:07:50.983Z","etag":null,"topics":["dashboards","data-science","data-visualization","python"],"latest_commit_sha":null,"homepage":"https://redash.blacksuan19.dev/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Blacksuan19.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}},"created_at":"2022-08-08T09:39:19.000Z","updated_at":"2024-09-09T05:37:56.000Z","dependencies_parsed_at":"2023-02-16T03:45:29.357Z","dependency_job_id":null,"html_url":"https://github.com/Blacksuan19/redash-python","commit_stats":null,"previous_names":[],"tags_count":81,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blacksuan19%2Fredash-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blacksuan19%2Fredash-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blacksuan19%2Fredash-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blacksuan19%2Fredash-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Blacksuan19","download_url":"https://codeload.github.com/Blacksuan19/redash-python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250546363,"owners_count":21448313,"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":["dashboards","data-science","data-visualization","python"],"created_at":"2024-11-17T06:22:08.669Z","updated_at":"2025-04-24T02:21:17.925Z","avatar_url":"https://github.com/Blacksuan19.png","language":"Python","readme":"# Redash API Python Client\n\npython package for interacting with the Redash API\n\n[![view - Documentation](https://img.shields.io/badge/PyPi-0.3.27-blue?style=for-the-badge)](https://pypi.org/project/redash-python \"view package on PyPi\")\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\n[![view - Documentation](https://img.shields.io/badge/view-Documentation-blue?style=for-the-badge)](https://redash.blacksuan19.dev/ \"go to documentation\")\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\n[![GitHub Actions](https://img.shields.io/badge/github%20actions-%232671E5.svg?style=for-the-badge\u0026logo=githubactions\u0026logoColor=white)](# \"Build with github actions\")\n\n## Features\n\n- Complete access to all endpoints in the Redash API.\n- Pagination by default.\n- Duplicate dashboards.\n- Manage users and groups.\n- Duplicate queries with different source tables.\n\n### Implemented Services\n\n- [x] Dashboards\n- [x] Queries\n- [x] Data Sources\n- [x] Alerts\n- [x] Users\n- [x] Destinations\n- [x] Groups\n- [x] query_snippets\n- [x] Widgets\\*\n\n\\* widgets endpoint does not support GET requests, only update, delete and\ncreate.\n\n## Getting Started\n\nan API key is required in addition to the instance's host URL.\n\n### Installation\n\n```bash\npip install redash-python\n```\n\n### Usage\n\n```python\nfrom redash_python import Redash\n\nrd = Redash(base_url=\"\", api_key=\"\")\n\n\n# get all dashboards\ndashboards = rd.dashboards.get_all()\n\n# get specific dashboards by id\ndash = rd.dashboards.get(1)\n\n# get by slug or name\nquery = rd.queries.get_by_name(\"my-dashboard\")\n\n# get by tags\nq = rd.queries.get_by_tags([\"my-tag\"])\n\n# get without tags\ndash = rd.dashboards.get_by_tags([\"my-tag\"], without=True)\n\n# Duplicate query with a different table as source\nques = rd.queries\nques.duplicate_query_table(\n    query=ques.get(1),\n    table_map={\"old_table\": \"new_table\"},\n    tags=[\"admin\", \"test\"],\n    publish=True,\n)\n\n# get a list of implemented API endpoints\nprint(rd.services)\n\n# get a list of implemented endpoints in a service\nprint(rd.users)\n```\n\nfor a full list of implemented methods in each service, print the service\nobject.\n\n```python\n\u003e\u003e\u003e print(client.dashboards)\nDashboardsService(attributes: ['endpoint'], methods: ['create', 'create_widget', 'delete', 'duplicate', 'exists', 'favorite', 'favorited', 'get', 'get_all', 'get_by_name', 'get_by_tags', 'get_id', 'get_slug', 'paginate', 'publish', 'refresh', 'share', 'unfavorite', 'unpublish', 'update'])\n```\n\nfor more examples on usage, see examples folder on github.\n\n## Development\n\nbefore starting development, install dev dependencies:\n\n```bash\npip install redash-python[dev]\n```\n\n### Architecture\n\nthis library implements a services based architecture splitting each API\nendpoint group to its own service, on top of which is the `Redash` class. all\nthe services share base classes from mixins that make it easier to share common\nbehavior and allows rapid development for any new endpoints. for instance adding\nquery_snippets is as simple as:\n\n```python\nfrom .base import BaseService\nfrom .mixins import CommonMixin, NameMixin, PrintMixin\n\n\nclass QSnipsService(CommonMixin, NameMixin, PrintMixin):\n    def __init__(self, base: BaseService) -\u003e None:\n        # init mixins\n        CommonMixin.__init__(self, base)\n\n        self.__base = base\n        self.endpoint = \"/api/query_snippets\"\n```\n\n### Directory Structure\n\n```bash\nredash_python\n├── __init__.py\n├── redash.py               # Services wrapper\n└── services                # implemented services\n    ├── base.py             # Base service class\n    └── mixins.py           # Mixins for services with shared functionality\n```\n\n## Contributing\n\nContributions are welcome, please open an issue or PR to propose any changes.\n\n## License\n\n[![view - Documentation](https://img.shields.io/badge/License-BSD%202%20Clause-green?style=for-the-badge)](https://github.com/Blacksuan19/redash-python/blob/master/LICENSE \"View License\")\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblacksuan19%2Fredash-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblacksuan19%2Fredash-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblacksuan19%2Fredash-python/lists"}