Utils for fastapi based services.

Overview

coverage PyPI version fury.io PyPI pyversions Documentation Status MIT License Powered by Dephell

Installation

    pip install fastapi-serviceutils

Usage

For more details and usage see: readthedocs

Development

Getting started

After cloning the repository initialize the development environment using:

    make init

This will create the dev environment exampleservice/dev. Activate it using:

    poetry shell

Note:

Make sure to always activate the environment when you start working on the project in a new terminal using

    poetry shell

ATTENTION: the environment should also be activated before using make.

Updating dependencies

After each change in dependencies defined at pyproject.toml run the following to ensure the environment-definition and lock-file are up to date:

    make update

Checking with linters and checkers

To run all pre-commit-hooks manually run:

    make check

Info about project-state

To show summary about project run:

    make info

Documentation

The project's developer documentation is written using Sphinx.

The documentation sources can be found in the docs subdirectory.

The API-documentation is auto-generated from the docstrings of modules, classes, and functions. We're using the Google docstring standard.

To generate the documentation, run:

    make docs

The output for generated HTML files is in the docs/_build directory.

Tests

For testing we use pytest, for details see Pytest Docs. To run all tests:

    make tests
You might also like...
The template for building scalable web APIs based on FastAPI, Tortoise ORM and other.

FastAPI and Tortoise ORM. Powerful but simple template for web APIs w/ FastAPI (as web framework) and Tortoise-ORM (for working via database without h

🐞 A debug toolbar for FastAPI based on the original django-debug-toolbar. 🐞

Debug Toolbar 🐞 A debug toolbar for FastAPI based on the original django-debug-toolbar. 🐞 Swagger UI & GraphQL are supported. Documentation: https:/

Github timeline htmx based web app rewritten from Common Lisp to Python FastAPI
Github timeline htmx based web app rewritten from Common Lisp to Python FastAPI

python-fastapi-github-timeline Rewrite of Common Lisp htmx app _cl-github-timeline into Python using FastAPI. This project tries to prove, that with h

Basic fastapi blockchain - An api based blockchain with full functionality

Basic fastapi blockchain - An api based blockchain with full functionality

Redis-based rate-limiting for FastAPI

Redis-based rate-limiting for FastAPI

A dynamic FastAPI router that automatically creates CRUD routes for your models
A dynamic FastAPI router that automatically creates CRUD routes for your models

⚡ Create CRUD routes with lighting speed ⚡ A dynamic FastAPI router that automatically creates CRUD routes for your models

Adds simple SQLAlchemy support to FastAPI

FastAPI-SQLAlchemy FastAPI-SQLAlchemy provides a simple integration between FastAPI and SQLAlchemy in your application. It gives access to useful help

Opinionated set of utilities on top of FastAPI

FastAPI Contrib Opinionated set of utilities on top of FastAPI Free software: MIT license Documentation: https://fastapi-contrib.readthedocs.io. Featu

Reusable utilities for FastAPI

Reusable utilities for FastAPI Documentation: https://fastapi-utils.davidmontague.xyz Source Code: https://github.com/dmontagu/fastapi-utils FastAPI i

Comments
  • ERROR InstallationError: Invalid requirement: 'app/main.py'

    ERROR InstallationError: Invalid requirement: 'app/main.py'

    Bootstrapped example app with following results

    dephell inspect venv
    

    results in:

    {
      "activate": "/Users/<devcomp>/.local/share/dephell/venvs/<my_app>-IrrL/main/bin/activate.fish",
      "bin": "/Users/<devcomp>/.local/share/dephell/venvs/<my_app>-IrrL/main/bin",
      "exists": true,
      "lib": "/Users/<devcomp>/.local/share/dephell/venvs/<my_app>-IrrL/main/lib/python3.7/site-packages",
      "lib_size": "9.87Mb",
      "project": "/Users/<devcomp>/<Apps Dir>/<my_app>",
      "python": "/Users/<devcomp>/.local/share/dephell/venvs/<my_app>-IrrL/main/bin/python",
      "venv": "/Users/<devcomp>/.local/share/dephell/venvs/<my_app>-IrrL/main"
    }
    

    issue is as follows:

    dephell venv run app/main.py
    WARNING executable is not found in venv, trying to install... (executable=app/main.py)
    ERROR InstallationError: Invalid requirement: 'app/main.py' (from line 1 of /var/folders/mr/3ctw8jvj4jdfk_sznlwnhv7m0000gn/T/tmphv2x_qlu)
    Hint: It looks like a path. File 'app/main.py' does not exist. 
    
    opened by phyxavier 7
  • create_service command git error

    create_service command git error

    after installing fastapi_serviceutils I try running the following command,

    create_service -n exampleservice -p 9999 -a "John Doe" -e [email protected] -ep example -o /Documents 
    

    I get the following error message,

    [email protected] ~ % create_service -n exampleservice -p 9999 -a "John Doe" -e [email protected] -ep example -o /Documents 
    Traceback (most recent call last):
      File "/Library/Frameworks/Python.framework/Versions/3.9/bin/create_service", line 8, in <module>
        sys.exit(main())
      File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/fastapi_serviceutils/cli/create_service.py", line 107, in main
        filepath = clone(
      File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/cookiecutter/vcs.py", line 101, in clone
        subprocess.check_output(
      File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 424, in check_output
        return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
      File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 528, in run
        raise CalledProcessError(retcode, process.args,
    subprocess.CalledProcessError: Command '['git', 'clone', 'ssh://[email protected]/skallfass/fastapi_serviceutils_template.git']' returned non-zero exit status 128.
    

    I simply followed up the following guideline https://fastapi-serviceutils.readthedocs.io/en/latest/exampleservice.html#creating-new-service

    could anyone please help resolving this issue? many thanks

    opened by ghost 0
  • Error: pg_config executable not found.

    Error: pg_config executable not found.

    Hi there, Great idea for providing all of this together, although I think it's possibly a little too opinionated for general use. But it's really well laid out. Nice job!

    Somewhere in the setup.py it expects the postgres binary to be available. I hit this error when it was not.

    Thanks!

    opened by philwinder 1
Releases(2.1.0)
Owner
Simon Kallfass
Simon Kallfass
Dead simple CSRF security middleware for Starlette ⭐ and Fast API ⚡

csrf-starlette-fastapi Dead simple CSRF security middleware for Starlette ⭐ and Fast API ⚡ Will work with either a input type="hidden" field or ajax

Nathaniel Sabanski 9 Nov 20, 2022
REST API with FastAPI and PostgreSQL

REST API with FastAPI and PostgreSQL To have the same data in db: create table CLIENT_DATA (id SERIAL PRIMARY KEY, fullname VARCHAR(50) NOT NULL,email

Luis Quiñones Requelme 1 Nov 11, 2021
Keepalive - Discord Bot to keep threads from expiring

keepalive Discord Bot to keep threads from expiring Installation Create a new Di

Francesco Pierfederici 5 Mar 14, 2022
A rate limiter for Starlette and FastAPI

SlowApi A rate limiting library for Starlette and FastAPI adapted from flask-limiter. Note: this is alpha quality code still, the API may change, and

Laurent Savaete 562 Jan 01, 2023
Get MODBUS data from Sofar (K-TLX) inverter through LSW-3 or LSE module

SOFAR Inverter + LSW-3/LSE Small utility to read data from SOFAR K-TLX inverters through the Solarman (LSW-3/LSE) datalogger. Two scripts to get inver

58 Dec 29, 2022
Keycloak integration for Python FastAPI

FastAPI Keycloak Integration Documentation Introduction Welcome to fastapi-keycloak. This projects goal is to ease the integration of Keycloak (OpenID

Code Specialist 113 Dec 31, 2022
Light, Flexible and Extensible ASGI API framework

Starlite Starlite is a light and flexible ASGI API framework. Using Starlette and pydantic as foundations. Check out the Starlite documentation 📚 Cor

1.5k Jan 04, 2023
Run your jupyter notebooks as a REST API endpoint. This isn't a jupyter server but rather just a way to run your notebooks as a REST API Endpoint.

Jupter Notebook REST API Run your jupyter notebooks as a REST API endpoint. This isn't a jupyter server but rather just a way to run your notebooks as

Invictify 54 Nov 04, 2022
Dead-simple mailer micro-service for static websites

Mailer Dead-simple mailer micro-service for static websites A free and open-source software alternative to contact form services such as FormSpree, to

Romain Clement 42 Dec 21, 2022
Prometheus exporter for several chia node statistics

prometheus-chia-exporter Prometheus exporter for several chia node statistics It's assumed that the full node, the harvester and the wallet run on the

30 Sep 19, 2022
Hyperlinks for pydantic models

Hyperlinks for pydantic models In a typical web application relationships between resources are modeled by primary and foreign keys in a database (int

Jaakko Moisio 10 Apr 18, 2022
Simple notes app backend using Python's FastAPI framework.

my-notes-app Simple notes app backend using Python's FastAPI framework. Route "/": User login (GET): return 200, list of all of their notes; User sign

José Gabriel Mourão Bezerra 2 Sep 17, 2022
This is an API developed in python with the FastApi framework and putting into practice the recommendations of the book Clean Architecture in Python by Leonardo Giordani,

This is an API developed in python with the FastApi framework and putting into practice the recommendations of the book Clean Architecture in Python by Leonardo Giordani,

0 Sep 24, 2022
Flood Detection with Google Earth Engine

ee-fastapi: Flood Detection System A ee-fastapi is a simple FastAPI web application for performing flood detection using Google Earth Engine in the ba

Cesar Aybar 69 Jan 06, 2023
Prometheus exporter for metrics from the MyAudi API

Prometheus Audi Exporter This Prometheus exporter exports metrics that it fetches from the MyAudi API. Usage Checkout submodules Install dependencies

Dieter Maes 7 Dec 19, 2022
A minimum reproducible repository for embedding panel in FastAPI

FastAPI-Panel A minimum reproducible repository for embedding panel in FastAPI Follow either This Tutorial or These steps below ↓↓↓ Clone the reposito

Tyler Houssian 15 Sep 22, 2022
Github timeline htmx based web app rewritten from Common Lisp to Python FastAPI

python-fastapi-github-timeline Rewrite of Common Lisp htmx app _cl-github-timeline into Python using FastAPI. This project tries to prove, that with h

Jan Vlčinský 4 Mar 25, 2022
Beyonic API Python official client library simplified examples using Flask, Django and Fast API.

Beyonic API Python Examples. The beyonic APIs Doc Reference: https://apidocs.beyonic.com/ To start using the Beyonic API Python API, you need to start

Harun Mbaabu Mwenda 46 Sep 01, 2022
FastAPI interesting concepts.

fastapi_related_stuffs FastAPI interesting concepts. FastAPI version :- 0.70 Python3 version :- 3.9.x Steps Test Django Like settings export FASTAPI_S

Mohd Mujtaba 3 Feb 06, 2022
cookiecutter template for web API with python

Python project template for Web API with cookiecutter What's this This provides the project template including minimum test/lint/typechecking package

Hitoshi Manabe 4 Jan 28, 2021