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
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
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
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
Gerenciar a velocidade da internet banda larga

Monitoramento da Velocidade da internet 📶 Status do Projeto: ✔️ (pronto) Tópicos ✍️ Descrição do projeto Funcionalidades Deploy da Aplicação Pré-requ

Bárbara Guerbas de Figueiredo 147 Nov 02, 2022
Burp Suite extension to log GraphQL operations as a comment

Burp GraphQL Logger A very simple, straightforward extension that logs GraphQL operations as a comment in the Proxy view. To enable the highlight, unc

22 Jul 02, 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
A python graphql api, which serves ECB currency rates from last 90 days.

Exchange Rate Api using GraphQL Get Code git pull https://github.com/alaturqua/exchangerate-graphql.git Create .env file with following content and s

Isa 1 Nov 04, 2021
Getting the ip of a fivem server with a cfx.re link

Dark Utilities - FIVEM-IP-RESOLVER Our Website https://omega-project.cz/ ! Install the app on the server Inplex-sys 12 Oct 25, 2022

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
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

GraphQL Python 7.5k Jan 01, 2023
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
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
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
An unofficial Blender add-on for Autodesk's Arnold render engine.

Arnold for Blender Arnold for Blender (or BtoA) provides a bridge to the Arnold renderer from within Blender's standard interface. BtoA is an unoffici

Luna Digital, Ltd. 89 Dec 28, 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
GraphQL security auditing script with a focus on performing batch GraphQL queries and mutations

BatchQL BatchQL is a GraphQL security auditing script with a focus on performing batch GraphQL queries and mutations. This script is not complex, and

Assetnote 267 Dec 24, 2022
Integrate GraphQL with your Pydantic models

graphene-pydantic A Pydantic integration for Graphene. Installation pip install "graphene-pydantic" Examples Here is a simple Pydantic model: import u

GraphQL Python 179 Jan 02, 2023
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

GraphQL 14k Jan 01, 2023
Django GraphQL To Do List Application

Django GraphQL Simple ToDo HOW TO RUN just run the following instructions: python -m venv venv pip install -r requirements.txt source venv/bin/activat

pedram shahsafi 1 Nov 13, 2021
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

Strawberry GraphQL 2.8k Jan 01, 2023