GPT Cookbook | Efficient Project Programming (BrilliantSoup)

5 min readSep 28, 2023

Introduction

Let’s program efficient projects! Project management is a fight between scope, time, and cost. The following Artificial Intelligence process is where expediency contends with quality. Let’s look into the steps necessary to get a programming project off the ground from concept to implementation. To see what I mean, I’ll show you “BrilliantSoup” as a case study to illustrate how to be more efficient.

PSA: Be careful with what you share, and who you share it with. Never scrape the web unless you follow a website’s robots.txt file.

Photo by Anton Filatov on Unsplash

Crawl Phase: Speedy Development

Insert Idea

The initial thought for any programming project is the “idea” phase. Here, you will outline the Problem — Solution or Service that will be provided. For our project, “BrilliantSoup,” let’s say the idea is to develop a shell interface to scrape web data.

Expand the Idea

In this phase, we will form the initial idea to a better understanding for features to be identified. For example, “BrilliantSoup” has features that include:

  • BeautifulSoup for data scraping
  • Real-time output visualization using Computer Vision Models
  • The ability to use this as a web scraping shell with an interactive command line interface, built-in security, scripting capabilities, modular architecture, and data privacy

Add to the Idea Until It’s Mostly Conceptualized

Once the idea is understood better, we’re closer to the finish line.

Things we could do is to research similar projects, ask “is this feasible”, and discover the tech stack you need. For“BrilliantSoup,” we will make it into a Python Library on PyPI. Users can now type the following for an import.

Walk Phase: Project Planning

Create a Gantt Chart

Timelines are important to achieve milestones. A Gantt chart helps show the timeline, milestones, and dependencies. Each task is divided.

In the same GPT chat where you have an idea, just ask the following (fill in the blanks):

Create a Gantt chart to build [Project Name]. List the directories and files in a `tree /f` structure. Format in [Naming Convention].

This was the output:

Gantt Chart GPT-4 output | OpenAI

And so was this:

BilliantSoupProject/
├── ProjectInitialization/
│ └── ProjectPlan.md
│ - Project Summary
│ - Scope
│ - Timeline
│ - Stakeholders
├── EnvironmentSetup/
│ └── VirtualEnvironment.md
│ - Installation Steps
│ - Required Libraries
├── CoreLibraryDevelopment/
│ ├── BrilliantSoupCore.py
│ │ - Dependencies: BeautifulSoup, requests
│ │ - Class: BrilliantSoupCore
│ │ - Methods: fetch_data, parse_data
│ │ - Variables: url, soup
│ └── WebScraper.py
│ - Dependencies: BrilliantSoupCore
│ - Functions: scrape_images, scrape_videos
│ - Variables: urls, scraped_data
├── SecurityFeatures/
│ ├── Harden.py
│ │ - Dependencies: None
│ │ - Functions: apply_firewall, restrict_access
│ │ - Variables: security_level
│ └── EncryptionModule.py
│ - Dependencies: cryptography library
│ - Functions: encrypt_data, decrypt_data
│ - Variables: encryption_key, encrypted_data
├── ComputerVisionIntegration/
│ ├── ObjectDetection.py
│ │ - Dependencies: OpenCV
│ │ - Functions: detect_objects, classify_objects
│ │ - Variables: image_data, detected_objects
│ └── ImageAnalysis.py
│ - Dependencies: OpenCV, NumPy
│ - Functions: analyze_image, extract_features
│ - Variables: image_data, features
├── CommandLineInterface/
│ └── BrilliantSoupShell.py
│ - Dependencies: argparse, BriliantSoupCore, SecurityFeatures, ComputerVisionIntegration
│ - Functions: main, execute_command
│ - Variables: command_args, active_session
├── Testing/
│ ├── UnitTests/
│ │ ├── TestSecurityFeatures.py
│ │ │ - Dependencies: unittest, SecurityFeatures
│ │ │ - Class: TestSecurityFeatures
│ │ │ - Methods: test_encrypt, test_decrypt
│ │ └── TestComputerVision.py
│ │ - Dependencies: unittest, ComputerVisionIntegration
│ │ - Class: TestComputerVision
│ │ - Methods: test_object_detection, test_image_analysis
│ └── IntegrationTests/
│ └── TestBrilliantSoupShell.py
│ - Dependencies: unittest, BrilliantSoupShell
│ - Class: TestBrilliantSoupShell
│ - Methods: test_command_execution, test_session_management
├── Documentation/
│ ├── UserManual.md
│ │ - Installation Guide
│ │ - User Guide
│ └── APIReference.md
│ - Class and Method Definitions
│ - Code Examples
├── Deployment/
│ └── DeploymentGuide.md
│ - Server Requirements
│ - Deployment Steps
└── UserTraining/
└── TrainingMaterial/
└── TutorialVideos/
└── HowToUseBrilliantSoup.mp4
- Video Content Outline
- List of Topics Covered

Run Phase: Directory Structure Creation

How about ask the following to make files and folders rapidly?

Use PowerShell commands with the least amount of characters to create the directory and files (i.e. commands such as mkdir, ni “” -type “”, etc.). Start with `mkdir C:\src` and `cd C:\src`. Include comments.

After this is entered into the chat prompt, Bash and PowerShell scripts will be generated for you. Just open the Command Prompt or PowerShell and type the following:

PowerShell Commands

# Create the root project directory and navigate into it
md C:\src; cd C:\src; md BrilliantSoupProject; cd BrilliantSoupProject

# Create primary directories inside the project root
md ProjectInitialization,EnvironmentSetup,CoreLibraryDevelopment,SecurityFeatures,ComputerVisionIntegration,CommandLineInterface,Testing,Documentation,Deployment,UserTraining

# Create test-related directories and navigate back to the root project directory
cd Testing; md UnitTests,IntegrationTests; cd ..

# Create user training directories and navigate back to the root project directory
cd UserTraining; md TrainingMaterial; cd TrainingMaterial; md TutorialVideos; cd ..\..

# Create a hashtable to store the paths of files to be created
$fs = @{
'ProjectInitialization\ProjectPlan.md'=$null;
'EnvironmentSetup\VirtualEnvironment.md'=$null;
'CoreLibraryDevelopment\BrilliantSoupCore.py'=$null;
'CoreLibraryDevelopment\WebScraper.py'=$null;
'SecurityFeatures\Harden.py'=$null;
'SecurityFeatures\EncryptionModule.py'=$null;
'ComputerVisionIntegration\ObjectDetection.py'=$null;
'ComputerVisionIntegration\ImageAnalysis.py'=$null;
'CommandLineInterface\BrilliantSoupShell.py'=$null;
'Testing\UnitTests\TestSecurityFeatures.py'=$null;
'Testing\UnitTests\TestComputerVision.py'=$null;
'Testing\IntegrationTests\TestBrilliantSoupShell.py'=$null;
'Documentation\UserManual.md'=$null;
'Documentation\APIReference.md'=$null;
'Deployment\DeploymentGuide.md'=$null;
'UserTraining\TrainingMaterial\TutorialVideos\HowToUseBrilliantSoup.mp4'=$null;
}

# Iterate over the hashtable keys to create files
$fs.Keys | ForEach-Object { New-Item $_ -type f }

Don’t forget to check yourself! We ARE dealing with Artificial Intelligence.

This is what will be created:

PowerShell `tree /f`

“Take off you hoser!”: Quick Script Generation

It’s time to accelerate the script making process. Enter the following to the AI chat prompt:

Explain what each file does, and include each variable name, object, and function. Also, include why each variable, object, function are used. Use intuitive names.

Now you have a rudimentary checklist to start your programming project.

Summary: Create Gantt Chart, Name Files and Folders, Structure Files and Folders, Create Files and Folders, and Generate a Checklist to Make Scripts

  1. Come up with your idea
  2. Finalize your ideay
  3. Create a Gantt chart to build [Project Name]. List the directories and files in a `tree /f` structure. Format in [Naming Convention].
  4. Use PowerShell commands with the least amount of characters to create the directory and files (i.e. commands such as mkdir, ni “” -type “”, etc.). Start with `mkdir C:\src` and `cd C:\src`. Include comments.
  5. Explain what each file does, and include each variable name, object, and function. Also, include why each variable, object, function are used. Use intuitive names.

--

--

No responses yet