Skip to content

A python library for the beginners. The program includes simple calulations. Genuine PRs will be merged without delays

Notifications You must be signed in to change notification settings

extinctsion/easyPythonpi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

easyPythonpi


Introduction

easyPythonpi is a beginner-friendly Python library that focuses on simple calculations. It's designed to encourage open-source contributions, making it an ideal project for newcomers to programming and open source.

Getting Started


🔍 Fork the Repository
  1. Fork this repository by clicking the "Fork" button in the top-right corner of this page. Alternatively, you can fork it directly from here.
📥 Clone the Repository
  1. Clone your forked repository to your local computer using the following command. Replace url_you_just_copied with the URL of your forked repository.

    git clone url_you_just_copied
📂 Open the Repository
  1. Open the cloned repository in your preferred code editor. Additionally, open a terminal within the repository directory.

    cd easyPythonpi
🌿 Create a New Branch
  1. Create a new branch for your changes. Replace username with your GitHub username in the following command:

    git checkout -b username
🚀 Contribute Code
  1. Add your new methods or functions to the easyPythonpi.py file within the codebase. Ensure that your code adheres to the coding style and conventions used in the existing code for consistency. For example:

    def calculate_average(numbers):
        """Calculate the average of a list of numbers."""
        if len(numbers) == 0:
            return 0
        return sum(numbers) / len(numbers)
📝 Commit Your Changes
  1. Once you've added your code, commit your changes to GitHub using the following commands. Make sure you execute them in the precise order, one after another, in your terminal.

    # Stage your changes
    git add .
    
    # Commit your changes with a descriptive message
    git commit -m "Hacktoberfest contribution"
    
    # Push your changes to your GitHub repository
    git push -u origin your_github_username
📢 Open a Pull Request
  1. Navigate to your forked repository on GitHub. You'll see a yellow box at the top indicating that some changes have been pushed. Click the "Compare & pull request" button.

  2. Submit your pull request by adding a title and description. Congratulations, you have successfully opened a pull request in this repository.

    Note: To complete the Hacktoberfest challenge, you need to open four valid pull requests. If you've followed the above steps, you've already opened one pull request, and you need three more.


Library File Structure


Running Test Cases


To ensure the reliability of your contributions and modifications, it's important to run test cases for the easyPythonpi library.

Prerequisites

Before running the test cases, ensure you have the following prerequisites installed on your system:

  • Python: The Python programming language.
🧪 Run Test Cases
  1. Install the required dependencies using pip:

    pip install -r requirements.txt
  2. Navigate to the project directory in your terminal.

  3. Run the test suite:

    python tests.py

    The test suite will execute, and you'll see the test results in your terminal. Ensure that all tests pass before making any contributions or modifications.


Setting Up a Virtual Environment (Optional method)


Working in a virtual environment is a good practice as it isolates project dependencies from your global Python environment.

🔮 Prerequisites

Before setting up a virtual environment, ensure you have Python installed on your system.

📦 Install and Activate a Virtual Environment
  1. Create a virtual environment (you can replace venv with your preferred environment name):

    python -m venv venv
  2. Activate the virtual environment:

    • On Windows:

      venv\Scripts\activate
    • On macOS and Linux:

      source venv/bin/activate
  3. Install unittest (if not already installed):

    pip install unittest
🔬 Run the Test Cases within the Virtual Environment
  1. Run the test cases as mentioned above.
🔓 Deactivate the Virtual Environment (when done)
  1. When you're finished working on the project, deactivate the virtual environment:

    deactivate

Hacktoberfest

Repositories with the hacktoberfest label are considered for the Hacktoberfest challenge. Your contributions to this project can help you achieve your Hacktoberfest goals.

Thank you for contributing to the open-source community!