Skip to content

NTHU-SA/NTHU-Data-API

Repository files navigation

NTHU-Data-API

NTHU-Data-API is a project designed for NTHU developers.
It provides an easy way to fetch data from the NTHU website.

Code style: black Test Coverage Test Action Status

Maintainability Rating Lines of Code Technical Debt

Getting Started

Prerequisites

Ensure you have Python 3 installed on your machine. You can verify this by running python3 --version in your terminal. If you don't have Python 3 installed, you can download it here.

Installation

  1. Clone the repository:
git clone https://github.com/NTHU-SA/NTHU-Data-API.git
  1. Navigate to the project directory:
cd NTHU-Data-API
  1. Install the required dependencies:
pip3 install -r requirements-dev.txt

Configuration

Copy the environment template file and fill in your details:

cp .env.template .env

Install Pre-commit Hooks (For Contributors)

To ensure code quality and consistency, we use pre-commit hooks. The pre-commit will automatically format your code before each commit. Install them by running:

pre-commit install

Running the Application

python3 main.py

Contributing

We follow certain guidelines for contributing. Here are the types of commits we accept:

  • feat: Add or modify features
  • fix: Fix a bug ... You can refer to the full list of commit types in the Conventional Commits specification.

Running Tests

To run tests locally before committing changes, follow these steps:

  1. Install the required dependencies:
pip3 install -r requirements-tests.txt
  1. Run tests: Navigate to the project's root directory and execute:
python3 -m pytest -n auto tests
  1. Generate a coverage report (optional): If you need a test coverage report, run:
python3 -m pytest -n auto tests --cov=src --cov=tests --cov-report=xml --cov-report=html:coverage --cov-fail-under=85

Credit

This project is maintained by NTHUSA 32nd.

License

This project is licensed under the MIT License.

Acknowledgements

Thanks to SonarCloud for providing code quality metrics:

SonarCloud

About

This is a project for NTHU students to get data from NTHU website.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 5