• Stars
    star
    183
  • Rank 210,154 (Top 5 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created over 2 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A GitHub activity digest tool

Dinghy

Dinghy, a GitHub activity digest tool.

PyPI Supported Python versions License Sponsor me on GitHub nedbat on Mastodon

Dinghy uses the GitHub GraphQL API to find recent activity on releases, issues and pull requests, and writes a compact HTML digest like this.

Sample Digest

Here's a sample of a Dinghy digest reporting on some PSF repos: black, requests, and PEPs.

Getting Started

  1. Install dinghy:

    $ python -m pip install dinghy
  2. To run dinghy you will need a GitHub personal access token. The scopes you need to assign to it depend on what repos you'll be accessing. If you are only accessing public repos, then you don't need any scopes. If you will be accessing any private repos, then you need the "repo" scope. Create a token and define the GITHUB_TOKEN environment variable with the value:

    $ export GITHUB_TOKEN=ghp_Y2oxDn9gHJ3W2NcQeyJsrMOez
  1. Then run dinghy with a GitHub URL:

    $ dinghy https://github.com/Me/MyProject
    Wrote digest: digest.html

    You will have a digest of the repo's last week of activity in digest.html. It will look something like this.

    You can also write a YAML configuration file to digest multiple sources, or with different time periods:

    $ dinghy my-dinghy-config.yaml
    Wrote digest: proj1.html
    Wrote digest: proj2-daily.html
    Wrote digest: proj2-weekly.html

    Extra arguments specify which digests to write:

    $ dinghy my-dinghy-config.yaml proj1.html
    Wrote digest: proj1.html

Configuration

Dinghy configuration is read from a YAML file (dinghy.yaml by default). Here's an example:

digests:
  - digest: lastweek.html
    title: My projects last week
    since: 1 week
    items:
      - https://github.com/orgs/myorg/projects/17
      - https://github.com/orgs/anotherorg/projects/8
      - https://github.com/myorg/myrepo/pulls

  - digest: hotnews.html
    title: Today's news
    since: 1 day
    items:
      - url: https://github.com/orgs/anotherorg/projects/8
        home_repo: anotherorg/wg
      - https://github.com/myorg/churnchurn/issues

  - digest: all_prs.html
    since: 1 day
    items:
      - search: org:myorg is:pr
        title: MyOrg pull requests

defaults:
  ignore_users:
    - app-user
    - fake-bot

The digests clause is a list of digests to produce. The defaults clause sets defaults for the digest options in the rest of the file. Each digests clause specifies what to digest:

  • The digest setting is the HTML digest file to write.
  • The since setting indicates how far back to look for activity. It can use units of weeks, days, hours, minutes and seconds, and can also be abbreviated, like 1d6h. Using since: forever will include all activity regardless of when it happened. If since is omitted, it defaults to one week. You can specify --since=<SINCE> on the dinghy command line to provide an explicit value.
  • The items setting is a list of things to report on, specified in a few different ways:
    • The url setting is a GitHub URL, in a number of forms:
      • An organization project URL will report on the issues and pull requests in the project. Your GitHub token will need the "read:project" scope.
      • A URL to a repo will report on the issues, pull requests and releases in the repo.
      • A URL to a repo's issues will report on the issues in the repo.
      • A URL to a repo's pull requests will report on the pull requests in the repo.
      • A URL to a repo's releases will report on the releases in the repo.
      • Any of these URLs can point to a GitHub Enterprise installation instead of https://github.com.
    • The search setting can specify a GitHub search query to find issues or pull requests. The query will have an updated: term added to it to account for the since: setting.
    • If an item only needs to specify a GitHub URL, then it can simply be the URL string.
  • The optional title setting will be used to construct the title and main header of the HTML page.
  • The template setting is the name of a Jinja2 template file to use to produce the digest. It defaults to "digest.html.j2", which is packaged with dinghy. The data passed to the template is under-specified; if you want to write a template of your own, model it on the built-in digest.html.j2.
  • For GitHub Enterprise, you can specify api_root, which is the URL to build on for GraphQL API requests. It defaults to "https://api.github.com/graphql".

Items can have additional options:

  • By default, no activity is reported for bot users. If you want to include them, use include_bots: true.
  • Some applications perform actions using real user accounts, but you'd like to ignore them anyway. You can list those user names that should be ignored in the ignore_users setting.
  • Digests can have an explicit title set with the title setting.
  • Options for organization projects include:
    • home_repo is the owner/repo of the repo in which most issues will be created. Issues in other repos will have the repo indicated in the digest.

Daily Publishing

The sample digest is published daily using a GitHub Action from its own repo: nedbat/dinghy_sample. You can use it as a starting point for your own publishing.

More Repositories

1

coveragepy

The code coverage tool for Python
Python
2,959
star
2

byterun

A Python implementation of a Python bytecode runner
Python
1,280
star
3

cog

Small bits of Python computation for static files
Python
335
star
4

watchgha

Live display of current GitHub action runs
Python
334
star
5

scriv

Changelog management tool
Python
253
star
6

django_coverage_plugin

A plugin for coverage.py to measure Django template execution
Python
196
star
7

pkgsample

A simple example of how to structure a Python project
Python
107
star
8

gefilte

Gefilte Fish GMail filter creator
Python
47
star
9

truchet

Playing with Truchet tiles
Jupyter Notebook
47
star
10

pydoctor

A diagnostic program to show the Python environment
Python
31
star
11

dot

Personal dotfiles
Shell
25
star
12

pytest-gallery

A sampler of tests showing different ways to construct tests for pytest
Python
23
star
13

cupid

Python
20
star
14

choosy

A Python teaching tool
Python
20
star
15

aptus

Mandelbrot fractal viewer
Python
19
star
16

zellij

A toy for making geometric art, inspired by Islamic Zellij.
Python
18
star
17

pylintdb

Put pylint violations into sqlite
Python
18
star
18

flourish

Harmonograph toy
Python
13
star
19

gpxmapper

Python
12
star
20

adventofcode2017

Python
10
star
21

unittest-mixins

Helpful unittest mixin classes
Python
10
star
22

adventofcode2018

Python
9
star
23

adventofcode2020

Python
8
star
24

unipain

PyCon presentation: Pragmatic Unicode, or, How Do I Stop the Pain?
HTML
8
star
25

adventofcode2019

Python
8
star
26

odds

Odds & Ends
Python
8
star
27

iter

PyCon presentation about iteration
HTML
7
star
28

nedbatcom

nedbatchelder.com
HTML
7
star
29

song-basket

Simple Spotify app to collect songs into a basket playlist.
Python
6
star
30

pyhurry

Python
6
star
31

adventofcode2021

Python
6
star
32

coverage-reports

HTML
5
star
33

nedbat

nedbat's profile
Shell
5
star
34

adventofcode2015

Python
5
star
35

adventofcode2022

adventofcode 2022
Python
5
star
36

adventofcode2016

Python
5
star
37

coverage_pytest_plugin

Python
5
star
38

adventures_prz

A presentation
JavaScript
4
star
39

injectx

Python
4
star
40

test0

PyCon presentation: Getting Started Testing
HTML
4
star
41

pgeom

Jupyter Notebook
4
star
42

native-matrix

4
star
43

toomuchregex

A lightning talk
JavaScript
4
star
44

templite

Python
4
star
45

typing_app

JavaScript
4
star
46

stilted

Python
3
star
47

blowyournose

Python
3
star
48

bigo

HTML
3
star
49

version_dummy

Absolute minimal versioned Python package.
Shell
3
star
50

hello-github-actions

3
star
51

jreport

Utility for making console reports from JSON APIs
Python
3
star
52

commitstats

Jupyter Notebook
3
star
53

natsworld

Python
3
star
54

point_match

A presentation.
HTML
3
star
55

blogtools

Python
3
star
56

explainer

3
star
57

tabtest

Python
3
star
58

branch-tests

2
star
59

toxghabug

2
star
60

xunit_tools

Janky tools for doing things with xunit.xml files
Python
2
star
61

sarai

HTML
2
star
62

madlib

Python
2
star
63

blank_prz

A blank presentation, using my own crappy toolchain
JavaScript
2
star
64

django_issue_25793

Demo for https://code.djangoproject.com/ticket/25793
Python
2
star
65

prznames

HTML
2
star
66

dinghy_sample

An example of publishing Dinghy digests
HTML
2
star
67

wikicrawl

Python
2
star
68

cyclorama

Python
1
star
69

adventofcode2023

Python
1
star
70

nedbat_dinghy

HTML
1
star
71

hackathon-edx-exams-copy

Python
1
star
72

badge-samples

1
star