Contents generated with DocToc
This is a little python script that generates a list of projects for a given GitHub organisation, and saves this information as a table in a .docx document
The table is structured as follows:
No. | Name | Description | Language | Stars | Forks | Last updated | Has setup.py ? |
---|---|---|---|---|---|---|---|
1 | |||||||
2 | |||||||
3 | |||||||
... |
- PyGithub -- a Python library to access the GitHub REST API.
- python-dotenv -- Reads key-value pairs from a .env file and can set them as environment variables
- docxtpl -- Use a .docx document as a Jinja2 template
- Clone the repo, create a virtual environment and install the dependencies (
pip install -r requirements.txt
). - Create a GitHub personal access token, and save it in a
.env
file asGITHUB_ACCESS_TOKEN=....
. You can make a copy of the provided.env.sample
:
cp -v .env.sample .env
Make it executable:
chmod +x ./create_project_list.py
Simply pass the organization name to the script:
./create_project_list.py -o [organization]
or
./create_project_list.py --org [organization]
If you want additional info for each repo, feel free to customize the script as well as the template to your liking.
Please refer to the PyGithub docs for more info. I also created a text file in the docs directory to serve as quick reference for methods/properties available for a repo instance, fir example, repo.html_url
for a repo's URL.