New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

githubapps.py

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

githubapps.py

This is a wrapper for the Github Apps API.

  • 1.1.0
  • PyPI
  • Socket score

Maintainers
1

githubapps.py

GitHub license GitHub issues GitHub forks GitHub stars PyPI version Python Versions Downloads

A Python wrapper for the Github Apps API

installing

Install and update using pip:

pip install githubapps.py

examples

A simple example.

Sync

import githubapps
def main():
    with open('env/private.key', 'rb') as f_private:
        private_key = f_private.read()
    with open('env/app_id.key', 'r') as f_app_id:
        app_id = f_app_id.read()
    with open('env/installation_id.key', 'r') as f_installation_id:
        installation_id = f_installation_id.read()
    client_secret = private_key
    auth = githubapps.RequestsAuth(app_id, installation_id, client_secret)
    access_token = auth.get_access_token()
    print(access_token)

if __name__ == "__main__":
    main()

Async

import githubapps
import asyncio

async def main():
    with open('env/private.key', 'rb') as f_private:
        private_key = f_private.read()
    with open('env/app_id.key', 'r') as f_app_id:
        app_id = f_app_id.read()
    with open('env/installation_id.key', 'r') as f_installation_id:
        installation_id = f_installation_id.read()
    client_secret = private_key
    auth = githubapps.AiohttpAuth(app_id, installation_id, client_secret)
    access_token = await auth.get_access_token()
    print(access_token)

if __name__ == "__main__":
    asyncio.run(main())

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc