Skip to main content

Command Line Interface for GitHub as part of the professional python course

Project description

Exercise2: GitHub Command line interface (CLI)

Purpose

This is the second exercise for the professional python course. The purpose is to build a proper CLI using the github API. The task is (copied from the professional python course):

Create a python program to interact with GitHub and retrieve data. Add the following commands:

  • Count all stars of all repos of yourself, a specified user or an organization.
  • Print out details about yourself, a user or organization. Allow a nicely printed format as default and offer output as json too.
  • One of the following:
    • (easy) Modify your user description by adding a tea emoji and a heart.
    • (difficult) Set your user status (top-right when clicking on username) to a tea emoji with the message "Drinking Tea".

Focus points:

  • End-users will use your program so focus on usability
  • Integrate previous lessons as much as it makes sense

Quickstart

Installing

This repository uses poetry to install the dependencies and taskfile to execute the most basic functionality. After having installed taskfile onto your system you can simply use task install to install the necessary dependendcies into a virtual environment. 4 Besides the dependencies you will need a GitHub Access Token to use this program. Get it here.

Usage

Promt task to get a list of the tasks availabe and go for one of the options:

$ task
task: Available tasks for this project:
* build:                Builds the puthon package
* docs-publish:         Publish the documentation to gh-pages
* docs-serve:           Serve the documentation locally
* getdetails:           Get details of a given user and print it to console
* getdetailsjson:       Get details of a given user in json
* install:              Installs the dependecies based on the poetry file
* lint:                 Runs formatting and linting
* sbom:                 Generate the Software Bill of Materials
* stars:                Get the number of stars of the given user's repositories
* starsjson:            Get the number of stars of the given user's repositories in json format
* status:               Set the status of your user to something delicous
* test:                 Runs tests on the code

The other way of using this tool is directly with calling etiher poetry or native python to start on of the functions, like

poetry run python professional_python_exercises_2_githubcli/github_cli.py setstatus

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file professional_python_exercises_2_githubcli-0.1.0a0.tar.gz.

File metadata

File hashes

Hashes for professional_python_exercises_2_githubcli-0.1.0a0.tar.gz
Algorithm Hash digest
SHA256 02acb7e988ca90efec84a14d389b693cd9a788fcec0bc4386fc8680bfaa617ee
MD5 a9ace2ce700bd35feff3cf356bd9f47b
BLAKE2b-256 5effba95fc31d9dec1370713e43bc20c1a5a31fbb354dabc10129e5f7d2c95fa

See more details on using hashes here.

File details

Details for the file professional_python_exercises_2_githubcli-0.1.0a0-py3-none-any.whl.

File metadata

File hashes

Hashes for professional_python_exercises_2_githubcli-0.1.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 62fe5c467e5ff2606c2cc9f4ce486079982f6c065f7bde6b272f4dfc66cbcf53
MD5 9db91014d554a683ee554e5ae412ec8f
BLAKE2b-256 fd406547fb88586037467d86afb373b20dd0d96ca6628a9796d51c3a57a2fa8f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page