See attached:
Link to program on browser: http://127.0.0.1:8000
"Simple-Instructions" file with simpler instructions for accessing the program. "Name-Plan" files under "api" folder to begin writing out code for ideas.
Welcome to the base repository for the final project of the Python Introductory Course! This repository serves as the foundation for your final project, where you'll apply the knowledge you've gained throughout the course to contribute to and improve an open-source project on GitHub.
In this course, you've learned the fundamentals of Python programming, including working with data structures, functions, modules, and object-oriented programming. The final project is designed to help you gain experience working with real-world open-source projects on GitHub. You'll start by forking this repository, making improvements or adding new features, and ultimately submitting your work back to the community.
Before you can begin working on this project, you need to set up your development environment by installing the necessary tools. Below are step-by-step instructions for both macOS and Windows to install:
brew --version
If Homebrew is not installed, install it with:
/bin/bash -c "$(curl -fsSL <https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh>)"
brew install --cask visual-studio-code
# verify installation
code --version
Open a terminal and check if Python 3 is already installed by running:
python3 --version
If Python 3 is installed, you’ll see a version number like Python 3.x.x. If not, install Python using Homebrew:
brew install python
# verify installation
python3 --version
Open a terminal and check if Git is installed by running:
git --version
If Git is not installed, Homebrew will prompt you to install it, or you can manually install Git by running:
brew install git
# verify installation
git --version
python --version
You should see Python 3.x.x.
git --version
You should see the Git version number printed.
Once these steps are completed, you will have all the tools (VSCode, Python, Git) installed, and you’ll be ready to start working on the project!
Start by forking this repository to your GitHub account. This will create a copy of the repository under your GitHub profile, where you can make your own changes.
Clone the forked repository to your local machine using the following command:
git clone https://github.com/your-username/intro-to-python.git
Navigate into the project directory:
cd intro-to-python
Create a virtual environment and install the necessary dependencies:
# Create a virtual environment:
# ----------------------------
# On macOS, you use python3...
# ... or create aliases in your profile (e.g., alias python=python3)
# I use short aliases for brevity, such as:
# alias py=python3
# alias g=git
python -m venv venv # This works
# Activate the virtual environment:
# --------------------------------
# On Windows, use `venv\Scripts\activate`
source venv/bin/activate
# Install the dependencies:
# ------------------------
# You can use pip3 instead
pip install -r requirements.txt
After setting up the environment, you can run the application locally using Uvicorn, an ASGI server that is great for serving Python web applications, particularly those built with FastAPI or similar frameworks.
Ensure Uvicorn is Installed:
requirements.txt
file, so it should already be installed if you've run pip install -r requirements.txt
.pip install uvicorn
Run the Application:
uvicorn api.main:app --reload
Here’s a breakdown of the command:
api.main:app
refers to the app
object inside your main.py
file located in the api
directory. This is the application instance that Uvicorn will serve.--reload
enables auto-reloading, which is useful during development. It automatically restarts the server whenever you make changes to the code.Access the Application:
http://127.0.0.1:8000
in your web browser.Stopping the Server:
Ctrl + C
in your terminal.When you run the command, you should see output similar to this in your terminal:
INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
INFO: Started reloader process [12345] using StatReload
INFO: Started server process [12346]
INFO: Waiting for application startup.
INFO: Application startup complete.
Navitage to http://127.0.0.1:8000 in your browser to see the application in action, it should look like this after you enter the artist name:
Navigate to http://127.0.0.1:8000/docs to see the API documentation:
Now, you can interact with your Python web application directly from your browser or API client!
Take some time to explore the project structure and understand the existing code. Familiarize yourself with the different modules and files in the repository.
Choose an area of the project to work on. You might want to add a new feature, improve an existing one, or fix a bug. Once you've identified what you want to work on, create a new branch for your changes:
git checkout -b feature/your-feature-name
As you work on your feature, commit your changes regularly:
git add .
git commit -m "Describe your changes here"
git push origin feature/your-feature-name
Once you're satisfied with your work, open a pull request to merge your changes back into your forked repository. If you'd like, you can also submit a pull request to the original repository to contribute your improvements to the wider community.
Here's a brief overview of the project structure:
intro-to-python/
│
├── api/ # API module
│ ├── __init__.py # Initialization file for the package
│ └── main.py # Main entry point for the API
│
├── model/ # Model module
│ ├── __init__.py # Initialization file for the package
│ ├── album.py # Album class
│ ├── artist.py # Artist class
│ └── track.py # Track class
│
├── service/ # Service module
│ ├── __init__.py # Initialization file for the package
│ ├── filecache.py # File cache implementation
│ └── itunes.py # iTunes implementation
│
├── templates/ # HTML templates
│ └── index.html # Home page
│
├── test/ # Unit tests for the project
│ ├── test_album.py # Tests for album
│ └── test_services.py # Tests for services
│
├── requirements.txt # List of project dependencies
├── README.md # Project documentation (this file)
├── .gitignore # .gitignore file
└── LICENSE # License for the project
If you need help, feel free to reach out to your instructors or refer to the following resources:
We encourage you to contribute to this project by submitting pull requests with your improvements. Please ensure that your code follows the project's coding standards and includes appropriate tests.
This project is licensed under the MIT License - see the LICENSE file for details.