{"id":22998954,"url":"https://github.com/jezza34000/py-petkit-api","last_synced_at":"2026-04-01T22:15:40.903Z","repository":{"id":267175435,"uuid":"900458648","full_name":"Jezza34000/py-petkit-api","owner":"Jezza34000","description":"Petkit client API library","archived":false,"fork":false,"pushed_at":"2026-04-01T19:12:07.000Z","size":509,"stargazers_count":26,"open_issues_count":4,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-01T21:53:44.921Z","etag":null,"topics":["api","client-api","petkit","smartdevices"],"latest_commit_sha":null,"homepage":"","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/Jezza34000.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-12-08T20:24:55.000Z","updated_at":"2026-04-01T19:12:12.000Z","dependencies_parsed_at":"2026-03-23T23:00:45.595Z","dependency_job_id":null,"html_url":"https://github.com/Jezza34000/py-petkit-api","commit_stats":null,"previous_names":["jezza34000/py-petkit-api"],"tags_count":112,"template":false,"template_full_name":null,"purl":"pkg:github/Jezza34000/py-petkit-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jezza34000%2Fpy-petkit-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jezza34000%2Fpy-petkit-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jezza34000%2Fpy-petkit-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jezza34000%2Fpy-petkit-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jezza34000","download_url":"https://codeload.github.com/Jezza34000/py-petkit-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jezza34000%2Fpy-petkit-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31292637,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T21:15:39.731Z","status":"ssl_error","status_checked_at":"2026-04-01T21:15:34.046Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-api","petkit","smartdevices"],"created_at":"2024-12-15T06:15:11.181Z","updated_at":"2026-04-01T22:15:40.895Z","avatar_url":"https://github.com/Jezza34000.png","language":"Python","funding_links":["https://github.com/sponsors/Jezza34000","https://www.buymeacoffee.com/jezza"],"categories":[],"sub_categories":[],"readme":"# Petkit API Client\n\n---\n\n[![Lifecycle:Maturing](https://img.shields.io/badge/Lifecycle-Stable-007EC6)](https://github.com/Jezza34000/py-petkit-api/)\n[![Python Version](https://img.shields.io/pypi/pyversions/pypetkitapi)][python version] [![Actions status](https://github.com/Jezza34000/py-petkit-api/workflows/CI/badge.svg)](https://github.com/Jezza34000/py-petkit-api/actions)\n\n[![PyPI](https://img.shields.io/pypi/v/pypetkitapi.svg)][pypi_] [![PyPI Downloads](https://static.pepy.tech/badge/pypetkitapi)](https://pepy.tech/projects/pypetkitapi)\n\n---\n\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Jezza34000_py-petkit-api\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=Jezza34000_py-petkit-api) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=Jezza34000_py-petkit-api\u0026metric=coverage)](https://sonarcloud.io/summary/new_code?id=Jezza34000_py-petkit-api) [![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=Jezza34000_py-petkit-api\u0026metric=ncloc)](https://sonarcloud.io/summary/new_code?id=Jezza34000_py-petkit-api)\n\n[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=Jezza34000_py-petkit-api\u0026metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=Jezza34000_py-petkit-api)\n[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=Jezza34000_py-petkit-api\u0026metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=Jezza34000_py-petkit-api)\n[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=Jezza34000_py-petkit-api\u0026metric=security_rating)](https://sonarcloud.io/summary/new_code?id=Jezza34000_py-petkit-api)\n[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=Jezza34000_py-petkit-api\u0026metric=bugs)](https://sonarcloud.io/summary/new_code?id=Jezza34000_py-petkit-api)\n[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=Jezza34000_py-petkit-api\u0026metric=code_smells)](https://sonarcloud.io/summary/new_code?id=Jezza34000_py-petkit-api)\n[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=Jezza34000_py-petkit-api\u0026metric=duplicated_lines_density)](https://sonarcloud.io/summary/new_code?id=Jezza34000_py-petkit-api)\n[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=Jezza34000_py-petkit-api\u0026metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=Jezza34000_py-petkit-api)\n\n[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit\u0026logoColor=white)][pre-commit]\n[![Black](https://img.shields.io/badge/code%20style-black-000000.svg)][black]\n[![mypy](https://img.shields.io/badge/mypy-checked-blue)](https://mypy.readthedocs.io/en/stable/)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n\n---\n\n[pypi_]: https://pypi.org/project/pypetkitapi/\n[python version]: https://pypi.org/project/pypetkitapi\n[pre-commit]: https://github.com/pre-commit/pre-commit\n[black]: https://github.com/psf/black\n\n### Enjoying this library?\n\n[![Sponsor Jezza34000][github-sponsor-shield]][github-sponsor] [![Static Badge][buymeacoffee-shield]][buymeacoffee]\n\n---\n\n## ℹ️ Overview\n\nPetKit Client is a Python library for interacting with the PetKit API. It allows you to manage your PetKit devices, retrieve account data, and control devices through the API.\n\n## 🚀 Features\n\n- Login and session management\n- Fetch account and device data\n- Control PetKit devices (Feeder, Litter Box, Water Fountain, Purifiers)\n- Fetch images \u0026 videos produced by devices\n  \u003e Pictures are available **with or without** Care+ subscription, Videos are only available **with** Care+ subscription\n\n## ⬇️ Installation\n\nInstall the library using pip:\n\n```bash\npip install pypetkitapi\n```\n\n## 💡 Usage Example:\n\nHere is a simple example of how to use the library to interact with the PetKit API \\\nThis example is not an exhaustive list of all the features available in the library.\n\n```python\nimport asyncio\nimport logging\nimport aiohttp\nfrom pypetkitapi.client import PetKitClient\nfrom pypetkitapi.command import DeviceCommand, FeederCommand, LBCommand, DeviceAction, LitterCommand\n\nlogging.basicConfig(level=logging.DEBUG)\n\nasync def main():\n    async with aiohttp.ClientSession() as session:\n        client = PetKitClient(\n            username=\"username\",  # Your PetKit account username or id\n            password=\"password\",  # Your PetKit account password\n            region=\"FR\",  # Your region or country code (e.g. FR, US,CN etc.)\n            timezone=\"Europe/Paris\",  # Your timezone(e.g. \"Asia/Shanghai\")\n            session=session,\n        )\n\n        await client.get_devices_data()\n\n        # Lists all devices and pet from account\n\n        for key, value in client.petkit_entities.items():\n            print(f\"{key}: {type(value).__name__} - {value.name}\")\n\n        # Select a device\n        device_id = key\n        # Read devices or pet information\n        print(client.petkit_entities[device_id])\n\n        # Send command to the devices\n        ### Example 1 : Turn on the indicator light\n        ### Device_ID, Command, Payload\n        await client.send_api_request(device_id, DeviceCommand.UPDATE_SETTING, {\"lightMode\": 1})\n\n        ### Example 2 : Feed the pet\n        ### Device_ID, Command, Payload\n        # simple hopper :\n        await client.send_api_request(device_id, FeederCommand.MANUAL_FEED, {\"amount\": 1})\n        # dual hopper :\n        await client.send_api_request(device_id, FeederCommand.MANUAL_FEED, {\"amount1\": 2})\n        # or\n        await client.send_api_request(device_id, FeederCommand.MANUAL_FEED, {\"amount2\": 2})\n\n        ### Example 3 : Start the cleaning process\n        ### Device_ID, Command, Payload\n        await client.send_api_request(device_id, LitterCommand.CONTROL_DEVICE, {DeviceAction.START: LBCommand.CLEANING})\n\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n\n## 💡 More example usage\n\nCheck at the usage in the Home Assistant integration : [here](https://github.com/Jezza34000/homeassistant_petkit)\n\n## ☑️ Supported Devices\n\n- **[Supported Devices](https://github.com/Jezza34000/homeassistant_petkit/wiki/Supported-Devices)**\n\n## 🛟 Help and Support\n\nDevelopers? Want to help? Join us on our Discord channel dedicated to developers and contributors.\n\n[![Discord][discord-shield]][discord]\n\n## 👨‍💻 Contributing\n\nContributions are welcome!\\\nPlease open an issue or submit a pull request.\n\n## License\n\nThis project is licensed under the MIT License. See the LICENSE file for details.\n\n---\n\n[homeassistant_petkit]: https://github.com/Jezza34000/py-petkit-api\n[commits-shield]: https://img.shields.io/github/commit-activity/y/Jezza34000/py-petkit-api.svg?style=flat\n[commits]: https://github.com/Jezza34000/py-petkit-api/commits/main\n[discord]: https://discord.gg/Va8DrmtweP\n[discord-shield]: https://img.shields.io/discord/1318098700379361362.svg?style=for-the-badge\u0026label=Discord\u0026logo=discord\u0026color=5865F2\n[forum-shield]: https://img.shields.io/badge/community-forum-brightgreen.svg?style=for-the-badge\u0026label=Home%20Assistant%20Community\u0026logo=homeassistant\u0026color=18bcf2\n[forum]: https://community.home-assistant.io/t/petkit-integration/834431\n[license-shield]: https://img.shields.io/github/license/Jezza34000/py-petkit-api.svg??style=flat\n[maintenance-shield]: https://img.shields.io/badge/maintainer-Jezza34000-blue.svg?style=flat\n[releases-shield]: https://img.shields.io/github/release/Jezza34000/py-petkit-api.svg?style=for-the-badge\u0026color=41BDF5\n[releases]: https://github.com/Jezza34000/py-petkit-api/releases\n[github-sponsor-shield]: https://img.shields.io/badge/sponsor-Jezza34000-blue.svg?style=for-the-badge\u0026logo=githubsponsors\u0026color=EA4AAA\n[github-sponsor]: https://github.com/sponsors/Jezza34000\n[buymeacoffee-shield]: https://img.shields.io/badge/Donate-buy_me_a_coffee-yellow.svg?style=for-the-badge\u0026logo=buy-me-a-coffee\n[buymeacoffee]: https://www.buymeacoffee.com/jezza\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjezza34000%2Fpy-petkit-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjezza34000%2Fpy-petkit-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjezza34000%2Fpy-petkit-api/lists"}