{"id":23564754,"url":"https://github.com/pr0ger/pyapns2","last_synced_at":"2025-05-15T16:01:54.492Z","repository":{"id":3942059,"uuid":"50348325","full_name":"Pr0Ger/PyAPNs2","owner":"Pr0Ger","description":"Python library for interacting with the Apple Push Notification service (APNs) via HTTP/2 protocol","archived":false,"fork":false,"pushed_at":"2024-04-19T13:05:17.000Z","size":115,"stargazers_count":356,"open_issues_count":14,"forks_count":185,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-05-08T05:47:15.406Z","etag":null,"topics":["apns","apple","python-library"],"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/Pr0Ger.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}},"created_at":"2016-01-25T12:12:06.000Z","updated_at":"2025-05-04T21:05:55.000Z","dependencies_parsed_at":"2024-06-18T13:42:48.190Z","dependency_job_id":null,"html_url":"https://github.com/Pr0Ger/PyAPNs2","commit_stats":{"total_commits":106,"total_committers":33,"mean_commits":3.212121212121212,"dds":0.4056603773584906,"last_synced_commit":"aac4bd3494670b8090774cb051798cfac5e0ed6a"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pr0Ger%2FPyAPNs2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pr0Ger%2FPyAPNs2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pr0Ger%2FPyAPNs2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pr0Ger%2FPyAPNs2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pr0Ger","download_url":"https://codeload.github.com/Pr0Ger/PyAPNs2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254374388,"owners_count":22060609,"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":["apns","apple","python-library"],"created_at":"2024-12-26T17:17:30.304Z","updated_at":"2025-05-15T16:01:54.442Z","avatar_url":"https://github.com/Pr0Ger.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyAPNs2\n\n[![PyPI version](https://img.shields.io/pypi/v/apns2.svg)](https://pypi.python.org/pypi/apns2)\n[![PyPI version](https://img.shields.io/pypi/pyversions/apns2.svg)](https://pypi.python.org/pypi/apns2)\n[![Build Status](https://drone.pr0ger.dev/api/badges/Pr0Ger/PyAPNs2/status.svg)](https://drone.pr0ger.dev/Pr0Ger/PyAPNs2)\n\nPython library for interacting with the Apple Push Notification service (APNs) via HTTP/2 protocol\n\n## Installation\n\nEither download the source from GitHub or use pip:\n\n    $ pip install apns2\n\n## Sample usage\n\n```python\nfrom apns2.client import APNsClient\nfrom apns2.payload import Payload\n\ntoken_hex = 'b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b87'\npayload = Payload(alert=\"Hello World!\", sound=\"default\", badge=1)\ntopic = 'com.example.App'\nclient = APNsClient('key.pem', use_sandbox=False, use_alternative_port=False)\nclient.send_notification(token_hex, payload, topic)\n\n# To send multiple notifications in a batch\nNotification = collections.namedtuple('Notification', ['token', 'payload'])\nnotifications = [Notification(payload=payload, token=token_hex)]\nclient.send_notification_batch(notifications=notifications, topic=topic)\n\n# To use token based authentication\nfrom apns2.credentials import TokenCredentials\n\nauth_key_path = 'path/to/auth_key'\nauth_key_id = 'app_auth_key_id'\nteam_id = 'app_team_id'\ntoken_credentials = TokenCredentials(auth_key_path=auth_key_path, auth_key_id=auth_key_id, team_id=team_id)\nclient = APNsClient(credentials=token_credentials, use_sandbox=False)\nclient.send_notification_batch(notifications=notifications, topic=topic)\n```\n\n## Further Info\n\n[iOS Reference Library: Local and Push Notification Programming Guide][a1]\n\n## Contributing\n\nTo develop PyAPNs2, check out the code and install dependencies. It's recommended to use a virtualenv to isolate dependencies:\n```shell\n# Clone the source code.\ngit clone https://github.com/Pr0Ger/PyAPNs2.git\ncd PyAPNs2\n# Create a virtualenv and install dependencies.\nvirtualenv venv\n. venv/bin/activate\npip install -e .[tests]\n```\n\nTo run the tests:\n```shell\npytest\n```\n\nYou can use `tox` for running tests with all supported Python versions:\n```shell\npyenv install 3.5.6; pyenv install 3.6.7; pyenv install 3.7.1; pyenv install 3.8.0\npyenv local 3.8.0 3.7.1 3.6.7 3.5.6\npip install tox\ntox\n```\n\nTo run the linter:\n```shell\npip install pylint\npylint --reports=n apns2 test\n```\n\n## License\n\nPyAPNs2 is distributed under the terms of the MIT license.\n\nSee [LICENSE](LICENSE) file for the complete license details.\n\n[a1]:https://developer.apple.com/documentation/usernotifications?language=objc\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpr0ger%2Fpyapns2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpr0ger%2Fpyapns2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpr0ger%2Fpyapns2/lists"}