Pygitstats - a package that allows you to use the GitHub GraphQL API with ease in your Python programs

Related tags

GraphQLGitStats
Overview

GitStats

PyPI PyPI - Downloads PyPI - Format PyPI - Status PyPI - License

pygitstats is a package that allows you to use the GitHub GraphQL API with ease in your Python programs.

Installation

Anyone can use this package by installing it from PyPi via one of the following commands:

Pip

pip install pygitstats
pip3 install pygitstats
python -m pip install pygitstats
python3 -m pip install pygitstats

Poetry

poetry install pygitstats

Conda

conda install pygitstats

Pipenv

pipenv install pygitstats

Usage

Just import the modules you need and get started!

License

This project is licensed under the LGPLv3 license.

You might also like...
GraphQL framework for Python

Graphene πŸ’¬ Join the community on Slack We are looking for contributors! Please check the ROADMAP to see how you can help ❀️ The below readme is the d

Ariadne is a Python library for implementing GraphQL servers using schema-first approach.
Ariadne is a Python library for implementing GraphQL servers using schema-first approach.

Ariadne Ariadne is a Python library for implementing GraphQL servers. Schema-first: Ariadne enables Python developers to use schema-first approach to

GraphQL Engine built with Python 3.6+ / asyncio
GraphQL Engine built with Python 3.6+ / asyncio

Tartiflette is a GraphQL Server implementation built with Python 3.6+. Summary Motivation Status Usage Installation Installation dependencies Tartifle

A new GraphQL library for Python πŸ“
A new GraphQL library for Python πŸ“

Strawberry GraphQL Python GraphQL library based on dataclasses Installation ( Quick Start ) The quick start method provides a server and CLI to get go

This is a simple Python that will parse instanceStats GraphQL Query into a CSV
This is a simple Python that will parse instanceStats GraphQL Query into a CSV

GraphQL Python Labs - by Gabs the CSE Table of Contents About The Project Getting Started Prerequisites Installation and Usage Roadmap Contributing Li

Graphql-codegen library - a pure python implementation

turms DEVELOPMENT Inspiration Turms is a pure python implementation of the awesome graphql-codegen library, following a simliar extensible design. It

tartiflette-aiohttp is a wrapper of aiohttp which includes the Tartiflette GraphQL Engine, do not hesitate to take a look of the Tartiflette project.
tartiflette-aiohttp is a wrapper of aiohttp which includes the Tartiflette GraphQL Engine, do not hesitate to take a look of the Tartiflette project.

tartiflette-aiohttp is a wrapper of aiohttp which includes the Tartiflette GraphQL Engine. You can take a look at the Tartiflette API documentation. U

ASGI support for the Tartiflette GraphQL engine
ASGI support for the Tartiflette GraphQL engine

tartiflette-asgi is a wrapper that provides ASGI support for the Tartiflette Python GraphQL engine. It is ideal for serving a GraphQL API over HTTP, o

GraphQL is a query language and execution engine tied to any backend service.

GraphQL The GraphQL specification is edited in the markdown files found in /spec the latest release of which is published at https://graphql.github.io

Comments
  • Add GraphQL mutation functions

    Add GraphQL mutation functions

    • [x] Possibly rename module back over to pygitapi? This would be better sooner rather than later.
    • [x] Add GraphQL mutations for functions like commenting on issues, reacting etc.

    This issue will also be used for testing mutations

    WARNING: You probably don't want to follow this thread!

    If anyone would like to reach me in this thread, please make sure to @DillonB07. Don't just leave a comment!

    opened by DillonB07 115
  • Sourcery Starbot ⭐ refactored DillonB07/GitAPI

    Sourcery Starbot ⭐ refactored DillonB07/GitAPI

    Thanks for starring sourcery-ai/sourcery ✨ 🌟 ✨

    Here's your pull request refactoring your most popular Python repo.

    If you want Sourcery to refactor all your Python repos and incoming pull requests install our bot.

    Review changes via command line

    To manually merge these changes, make sure you're on the master branch, then run:

    git fetch https://github.com/sourcery-ai-bot/GitAPI master
    git merge --ff-only FETCH_HEAD
    git reset HEAD^
    
    opened by sourcery-ai-bot 1
  • Error in `v1.0.0rc5` - field `body` doesn't exist

    Error in `v1.0.0rc5` - field `body` doesn't exist

    {'errors': [{'extensions': {'code': 'undefinedField', 'fieldName': 'body', 'typeName': 'IssueCommentEdge'}, 'locations': [{'column': 13, 'line': 5}], 'message': "Field 'body' doesn't exist on type 'IssueCommentEdge'", 'path': ['mutation', 'addComment', 'commentEdge', 'body']}]}
    
    bug High Priority 
    opened by DillonB07 0
  • Documentation

    Documentation

    Documentation will be needed. Ideally with Sphinx though MkDocs is also fine.

    I'm not good at Sphinx...

    All contributions for documentation are welcome! Credit will be added to README according to the All Contributors specification

    High Priority 
    opened by DillonB07 3
Releases(v1.0.0)
  • v1.0.0(Feb 21, 2022)

    v1.0.0!

    This is the first official release of pyGitAPI. For information about it, read the docs at https://docs.pygitapi.cf.

    You can also read this post on dev.to for a basic introduction to this package.

    https://dev.to/dillonb07/access-github-graphql-queries-easily-in-python-34j6

    pip install --upgrade pygitapi

    Links: GitHub - https://github.com/DillonB07/GitAPI PyPi - https://pypi.org/project/pygitapi Docs - https://docs.pygitapi.cf/

    Full Changelog: https://github.com/DillonB07/GitAPI/compare/v0.1.1...v1.0.0

    Source code(tar.gz)
    Source code(zip)
  • v1.0.0rc6(Jan 20, 2022)

    This pre-release just closes #15

    comment_on_issue() should now work perfectly.

    Full Changelog: https://github.com/DillonB07/GitAPI/compare/v1.0.0rc5...v1.0.0rc6

    Source code(tar.gz)
    Source code(zip)
  • v1.0.0rc5(Jan 20, 2022)

    This pre-release adds in two new functions!

    • GitAPI.comment_on_issue(owner: str, repo: str, number: int, comment: str)
    • GitAPI.get_issue_id(owner: str, repo: str, number: int))

    The comment_on_issue() function will return a response with the comment body. This function utilises the get_issue_id() function to find the issue, so you don't need to input the issue ID yourself.

    What's Changed

    • docs: add kokonut27 as a contributor for code, question, code by @allcontributors in https://github.com/DillonB07/GitAPI/pull/11
    • docs: add DillonB07 as a contributor for code, infra, maintenance, test by @allcontributors in https://github.com/DillonB07/GitAPI/pull/12

    Full Changelog: https://github.com/DillonB07/GitAPI/compare/v1.0.0rc4...v1.0.0rc5

    Source code(tar.gz)
    Source code(zip)
  • v1.0.0rc4b(Jan 18, 2022)

    In this pre-release, I've renamed the module to pygitapi. This is because it isn't just for stats, so it's clearer.

    NOTE: The old versions are still available under pygitstats

    Install like so:

    pip install --upgrade --pre pygitapi
    

    And the main class has been renamed so use it like so:

    from pygitapi.graphql import GitAPI
    
    g = GitAPI(token)
    ...
    

    Full Changelog: https://github.com/DillonB07/GitAPI/compare/v1.0.0rc3...v1.0.0rc4b

    Source code(tar.gz)
    Source code(zip)
  • v1.0.0rc3(Jan 15, 2022)

    In this release candidate, a new function has been added.

    Here's a demo!

    from pygitstats.graphql import GitStats
    import os
    
    token = os.environ['PERSONAL_ACCESS_TOKEN']
    g = GitStats(token)
    
    response = g.repo_info(name='GitStats', owner='DillonB07')
    
    print(response['data']['repository']['collaborators'])
    

    Returns:

    {'nodes': [{'avatarUrl': 'https://avatars.githubusercontent.com/u/83948303?v=4', 'login': 'DillonB07', 'name': 'Dillon Barnes', 'url': 'https://github.com/DillonB07'}], 'totalCount': 1}
    

    You can install/upgrade to v1.0.0rc3 like so:

    pip install --upgrade --pre pygitstats
    

    Full Changelog: https://github.com/DillonB07/GitStats/compare/v0.1.0rc2...v1.0.0rc3

    Source code(tar.gz)
    Source code(zip)
  • v1.0.0rc2(Jan 10, 2022)

    In this release candidate, the module has been changed back to the requests module. Also, #3 is finally closed for good, hopefully.

    You can install/upgrade this module like so:

    pip install --upgrade --pre pygitstats
    

    Full Changelog: https://github.com/DillonB07/GitStats/compare/v1.0.0rc1...v1.0.0rc2

    Source code(tar.gz)
    Source code(zip)
  • v1.0.0rc1(Jan 10, 2022)

    This is v1.0.0 Release Candidate 1.

    ~The major change in this release is that the project has moved to a new library meaning that GraphQL responses are now Python dictionaries. - Closes #3~ This has been proved wrong via some testing - Reopened #3

    This should not affect usage as all of the functions in the module do the same thing and have the same name.

    As this is a pre-release, you will need to add the --pre flag when installing from pip like so:

    pip install --upgrade --pre pygitstats
    

    Full Changelog: https://github.com/DillonB07/GitStats/compare/v0.1.1...v1.0.0rc1

    Source code(tar.gz)
    Source code(zip)
  • v0.1.1(Jan 5, 2022)

    This fixes a bug where the response was printed instead of returned! 🀦

    Full Changelog: https://github.com/DillonB07/GitStats/compare/v0.1.0...v0.1.1

    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(Jan 5, 2022)

    GitStats

    This is the first release of GitStats.

    Usage

    In this release, you can grab generic data about a user using GitStats.user_info() Here is an example:

    from pygitstats.graphql import GitStats
    import os
    
    g = GitStats(os.environ['GITHUB_PERSONAL_ACCESS_TOKEN']) # Don't store your Personal Access Token in plain text!
    
    user_info = g.user_info('DillonB07') # User to get info on
    print(user_info)
    

    You can also use custom GraphQL queries like so:

    from pygitstats.graphql import GitStats
    import os
    
    username = 'DillonB07'
    query = '''
    query repo_count {
      user(login: "''' + username + '''") {
        repositories {
          totalCount
        }
      }
    }
    '''
    
    g = GitStats(os.environ['GITHUB_PERSONAL_ACCESS_TOKEN']) # Don't store your Personal Access Token in plain text!
    
    total_repos = g.custom_query(query) # Custom query will return the amount of repositories the user has
    print(total_repos)
    

    Remember: DO NOT STORE YOUR PERSONAL ACCESS TOKEN IN YOUR PROGRAM! 0adfd2d

    Installation

    This package can be installed from PyPi via one of the following commands:

    Pip

    pip install pygitstats
    
    pip3 install pygitstats
    
    python -m pip install pygitstats
    
    python3 -m pip install pygitstats
    

    Poetry

    poetry install pygitstats
    

    Conda

    conda install pygitstats
    

    Pipenv

    pipenv install pygitstats
    

    Credit

    Feedback and suggestions for the package would be appreciated!

    Credit to @JBYT27 for GitAPI which inspired this project. I've also taken(and modified) some code from that repo.

    Source code(tar.gz)
    Source code(zip)
Owner
Dillon Barnes
An aspiring web developer who likes making weird and useless projects
Dillon Barnes
Generate daily updated visualizations of user and repository statistics from the GitHub API using GitHub Actions

Generate daily updated visualizations of user and repository statistics from the GitHub API using GitHub Actions for any combination of private and public repositories - dark mode supported

Adam Ross 15 Dec 31, 2022
Adds GraphQL support to your Flask application.

Flask-GraphQL Adds GraphQL support to your Flask application. Usage Just use the GraphQLView view from flask_graphql from flask import Flask from flas

GraphQL Python 1.3k Dec 31, 2022
graphw00f is Server Engine Fingerprinting utility for software security professionals looking to learn more about what technology is behind a given GraphQL endpoint.

graphw00f - GraphQL Server Fingerprinting graphw00f (inspired by wafw00f) is the GraphQL fingerprinting tool for GQL endpoints. Table of Contents How

Dolev Farhi 282 Jan 04, 2023
tartiflette-aiohttp is a wrapper of aiohttp which includes the Tartiflette GraphQL Engine, do not hesitate to take a look of the Tartiflette project.

tartiflette-aiohttp is a wrapper of aiohttp which includes the Tartiflette GraphQL Engine. You can take a look at the Tartiflette API documentation. U

tartiflette 60 Nov 08, 2022
Graphene MongoEngine integration

Graphene-Mongo A Mongoengine integration for Graphene. Installation For installing graphene-mongo, just run this command in your shell pip install gra

GraphQL Python 261 Dec 31, 2022
This is a graphql api build using ariadne python that serves a graphql-endpoint at port 3002 to perform language translation and identification using deep learning in python pytorch.

Language Translation and Identification this machine/deep learning api that will be served as a graphql-api using ariadne, to perform the following ta

crispengari 2 Dec 30, 2021
GraphiQL & the GraphQL LSP Reference Ecosystem for building browser & IDE tools.

Black Lives Matter πŸ–€ GraphQL IDE Monorepo Security Notice: All versions of graphiql 1.4.7 are vulnerable to an XSS attack in cases where the GraphQ

GraphQL 14.5k Jan 08, 2023
MGE-GraphQL is a Python library for building GraphQL mutations fast and easily

MGE-GraphQL Introduction MGE-GraphQL is a Python library for building GraphQL mutations fast and easily. Data Validations: A similar data validation w

MGE Software 4 Apr 23, 2022
Integrate GraphQL into your Django project.

Graphene-Django A Django integration for Graphene. πŸ’¬ Join the community on Slack Documentation Visit the documentation to get started! Quickstart For

GraphQL Python 4k Dec 31, 2022
A Django GraphQL Starter that uses graphene and graphene_django to interface GraphQL.

Django GraphQL Starter GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data... According to the doc

0101 Solutions 1 Jan 10, 2022
ReplAPI.it A Simple and Complete Replit API Package

Notice: Currently this project is just a framework. It does not work yet. If you want to get updated when 1.0.0 is released, then click Watch - Custo

The ReplAPI.it Project 10 Jun 05, 2022
Fastapi strawberry graphql

fastapi-strawberry-graphql Quick and dirty πŸ“ python python --version Python 3.10 pip pip install sqlalchemy pip install sqlmodel pip install fastapi

Rodrigo Ney 7 Oct 19, 2022
This is a minimal project using graphene with django and user authentication to expose a graphql endpoint.

Welcome This is a minimal project using graphene with django and user authentication to expose a graphql endpoint. Definitely checkout how I have mana

yosef salmalian 1 Nov 18, 2021
GraphQL Engine built with Python 3.6+ / asyncio

Tartiflette is a GraphQL Server implementation built with Python 3.6+. Summary Motivation Status Usage Installation Installation dependencies Tartifle

tartiflette 839 Dec 31, 2022
Django Project with Rest and Graphql API's

Django-Rest-and-Graphql ο»Ώ# 1. Django Project Setup With virtual environment: mkdir {project_name}. To install virtual Environment sudo apt-get install

Shubham Agrawal 5 Nov 22, 2022
A real time webchat made in graphql

Graphql Chat. This is a real time webchat made in graphql. Description Welcome to my webchat api, here i put my knowledge in graphql to work. Requirem

Nathan AndrΓ© 1 Jan 03, 2022
Blazing fast GraphQL endpoints finder using subdomain enumeration, scripts analysis and bruteforce.

Graphinder Graphinder is a tool that extracts all GraphQL endpoints from a given domain. Run with docker docker run -it -v $(pwd):/usr/bin/graphinder

Escape 76 Dec 28, 2022
The Foundation for All Legate Libraries

Legate The Legate project endeavors to democratize computing by making it possible for all programmers to leverage the power of large clusters of CPUs

Legate 144 Dec 26, 2022
Modular, cohesive, transparent and fast web server template

kingdom-python-server 🐍 Modular, transparent, batteries (half) included, lightning fast web server. Features a functional, isolated business layer wi

T10 20 Feb 08, 2022
A small command-line tool for interacting with GQL APIs

igqloo A small tool for interacting with GQL APIs Arguments, mutations, aliases are all supported. Other features, such as fragments, are left unsuppo

Joshua Mottaz 7 Dec 20, 2021