dennislwm / pydocker-cli

3 stars 0 forks source link

pydocker-cli

pydocker-cli starter project.


Table of Contents


Famed Contributors

@dennislwm

Hypothesis

pydocker-cli was a personal project to:


Project Structure

 pydocker-cli/                                <-- Root of your project
   |- .gitignore                              <-- Git ignore file
   |- CONTRIBUTING.md                         <-- Contributing guide
   |- README.md                               <-- This README markdown file
   +- .github/                                <-- Root of GitHub templates, workflows, actions
      +- workflows/                           <-- Source files for GitHub workflows
   +- biblia/                                 <-- Source files for bible data
   +- etfdata/                                <-- Source files for ETF and stock data
   +- htmltopdf/                              <-- Source files for Html link to PDF conversion
   +- textscore/                              <-- Source files for text readability score
   +- udemyenrol/                             <-- Source files for Udemy free course
      |- .dockerignore                        <-- Docker ignore file
      |- actions.yml                          <-- GitHub actions file
      |- app.py                               <-- Tiny Python app
      |- Dockerfile                           <-- Dockerfile for app
      |- requirements.txt                     <-- Tiny Python app dependencies
      |- udemyenrol.md                        <-- Daily Free Udemy Courses published by GitHub Actions

Methodology

This is the minimum viable product (MVP) to test the above hypothesis.

Non-existant viable feature

Existing viable feature


Complexity

Count the cost of complexity, i.e. incremental reward and risk reduction, before evolving MVP.

Non-existant bloat

Existing bloat


1. etfdata

This tiny app prints etf and stock data.

1.1 Usage

$ python3 etfdata.py
Usage: etfdata.py [OPTIONS] COMMAND [ARGS]...

  This script prints etf and stock data

Options:
  -o, --out [csv|json|markdown|text]
                                  Output type, default=text
  -h, --help                      Show this message and exit.

Commands:
  cal    Economic calendar
  etf    ETF fundamentals
  list   List of symbols
  news   Latest market news
  stock  Stock fundamentals of SYMBOLS where SYMBOLS is one or more...

1.2 Configuration

etfdata requires a config.json to run correctly. This file contains sensitive information, hence it is not checked into repo.

Create a new file config.json in the same folder as etfdata.py and copy and paste below.

{
  "FINNHUB_API_KEY": "asdfasdfasdfasfasdfasdf",
  "FINNHUB_API_KEY_SANDBOX": "sandbox_asdfasdfasdfsadfasfdsaf"
}

Go to Finnhub Stock API to create a free account. Then copy and paste both of the above api keys.

1.3 References


2. htmltopdf

This tiny app does what its name suggests.


3. udemyenrol

This tiny app is invoked by GitHub Actions daily.

3.1 Nothing to do

The action file runs this Python app that updates this page at UTC 0:01 daily. You can bookmark this page to save thousands of dollars for Udemy courses every year (legally).

Daily Free Udemy Courses

3.2 Fork this repository if you want to receive email

If you want to receive this page in your email, fork this repository. In your forked repository, add these to the GitHub secrets:

  GMAIL: user@gmail.com
  GMAIL_APP_PASSWORD: generatedpassword

The app uses GMAIL to send both from (sender) and to (recepient). Go to Gmail account to create GMAIL_APP_PASSWORD.

Warning: Do not use your Gmail password for the app password, which is a special password that is used to bypass two-factor authentication.

3.3 Configuration (only if you are Contributing)

Udemyenrol requires a settings.yaml to run in your local development. This file contains sensitive information, hence it is not checked into repo.

Create a new file settings.yaml in the same folder as app.py and copy and paste below.

udemy:
  email: "name@example.com" 
  password: "password123" 
  gmail: "name@gmail.com"
  gmail_app_password: "generatedpassword"

This is an explanation of the above settings file.

3.4 References


4. textscore

This tiny app generates a readability score from a file.

4.1 Usage

$ python3 textscore.py --help
Usage: textscore.py [OPTIONS] TEXTFILE

  This script scores the readability of a TEXTFILE

  TEXTFILE may include wildcards, e.g. *.txt

Options:
  -o, --out [csv|json|markdown|text]
                                  Output type, default=text
  -h, --help                      Show this message and exit.

4.2 References


5. biblia

This tiny app prints bible data from Biblia.

5.1 Usage

$ python3 biblia.py --help
Usage: biblia.py [OPTIONS] COMMAND [ARGS]...

  This script prints bible data

Options:
  -o, --out [csv|json|markdown|text]
                                  Output type, default=text
  -h, --help                      Show this message and exit.

Commands:
  content  Returns the content of a bible
  search   Searches the text of a bible
  toc      Returns the table of contents of a bible
  votd     Returns a carefully chosen verse each day

5.1 References

Requirements

Making code changes locally

  1. Clone the repository to your local workstation with git clone.

  2. Change directory to the cloned repo and project, e.g. cd pydocker-cli/udemyenrol.

  3. Create a Python virtual environment with pipenv shell.

  4. Install the Python dependencies with pipenv install.

  5. Start coding!


Common

Issue #4


Contributing

Please read the contributing guide on how you can actively participate in the development of this repository.


Reach Out!

Please consider giving this repository a star on GitHub.