8000 GitHub - QDMarkMan/rgp: A project template for report generate and view based flask.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

QDMarkMan/rgp

Repository files navigation

rgp

Build status Python Version Dependencies Status

Code style: ruffSecurity: bandit Pre-commit Semantic Versions License Coverage Report

Report generate platform

🎯 Tech Stack

  • Typer is great for creating CLI applications.
  • Rich makes it easy to add beautiful formatting in the terminal.
  • Pydantic – data validation and settings management using Python type hinting.
  • Loguru makes logging (stupidly) simple.
  • tqdm – fast, extensible progress bar for Python and CLI.
  • IceCream is a little library for sweet and creamy debugging.
  • orjson – ultra fast JSON parsing library.
  • Returns makes you function's output meaningful, typed, and safe!
  • Hydra is a framework for elegantly configuring complex applications.
  • FastAPI is a type-driven asynchronous web framework.

1. Prepare environment

1.1. Initialize your code

  1. Initialize git inside your repo:
cd rgp && git init
  1. If you don't have Poetry.

Conda environment is is recommended.

conda create -n rgp python==3.10

Please activate python of current project and install run:

conda activate rgp
pip install poetry
  1. Initialize poetry and pre-commit hooks:
make install

If you obtain a timeout error when installing, you can try to append an image source config in poetry.toml. The following example is tsinghua image source.

[[tool.poetry.source]]
name = "tsinghua"
url = "https://pypi.tuna.tsinghua.edu.cn/simple"
priority = "default"
  1. Run the codestyle to polish your code:
make polish-codestyle

Quick start

Conda package manager is recommended. Create a conda environment.

conda create -n rgp python==3.10<
8000
/pre>

Activate conda environment and install poetry

conda activate rgp
pip install poetry

Then you can run the client using the following command:

rgp --help

or with Poetry:

poetry run rgp --help

Makefile usage

Makefile contains a lot of functions for faster development.

Install all dependencies and pre-commit hooks

Install requirements:

make install

Pre-commit hooks coulb be installed after git init via

make pre-commit-install

Codestyle and type checks

Automatic formatting uses ruff.

make polish-codestyle

# or use synonym
make formatting

Codestyle checks only, without rewriting files:

make check-codestyle

Note: check-codestyle uses ruff and darglint library

Code security

If this command is not selected during installation, it cannnot be used.

make check-safety

This command launches Poetry integrity checks as well as identifies security issues with Safety and Bandit.

make check-safety

Tests with coverage badges

Run pytest

make test

All linters

Of course there is a command to run all linters in one:

make lint

the same as:

make check-codestyle && make test && make check-safety

Docker

make docker-build

which is equivalent to:

make docker-build VERSION=latest

Remove docker image with

make docker-remove

More information about docker.

Cleanup

Delete pycache files

make pycache-remove

Remove package build

make build-remove

Delete .DS_STORE files

make dsstore-remove

Remove .mypycache

make mypycache-remove

Or to remove all above run:

make cleanup

πŸ›‘ License

License

This project is licensed under the terms of the MIT license. See LICENSE for more details.

πŸ“ƒ Citation

@misc{rgp,
  author = {rgp},
  title = {Report generate  platform},
  year = {2024},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/rgp/rgp}}
}

Credits πŸš€ Your next Python package needs a bleeding-edge project structure.

This project was generated with P3G

About

A project template for report generate and view based flask.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0