fastapi-cli

Run and manage FastAPI apps from the command line with FastAPI CLI. ๐Ÿš€

https://github.com/fastapi/fastapi-cli

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • โœ“
    CITATION.cff file
    Found CITATION.cff file
  • โœ“
    codemeta.json file
    Found codemeta.json file
  • โœ“
    .zenodo.json file
    Found .zenodo.json file
  • โ—‹
    DOI references
  • โ—‹
    Academic publication links
  • โ—‹
    Committers with academic emails
  • โ—‹
    Institutional organization owner
  • โ—‹
    JOSS paper metadata
  • โ—‹
    Scientific vocabulary similarity
    Low similarity (13.1%) to scientific vocabulary

Keywords

cli fastapi typer uvicorn

Keywords from Contributors

typehints click pydantic spacy-extension json-schema openapi3 python-types redoc starlette swagger-ui
Last synced: 4 months ago · JSON representation ·

Repository

Run and manage FastAPI apps from the command line with FastAPI CLI. ๐Ÿš€

Basic Info
  • Host: GitHub
  • Owner: fastapi
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 202 KB
Statistics
  • Stars: 497
  • Watchers: 6
  • Forks: 61
  • Open Issues: 18
  • Releases: 9
Topics
cli fastapi typer uvicorn
Created over 1 year ago · Last pushed 4 months ago
Metadata Files
Readme Contributing Funding License Citation Security

README.md

FastAPI CLI

Test Publish Coverage Package version


Source Code: https://github.com/fastapi/fastapi-cli


Run and manage FastAPI apps from the command line with FastAPI CLI. ๐Ÿš€

Description

FastAPI CLI is a command line program fastapi that you can use to serve your FastAPI app, manage your FastAPI project, and more.

When you install FastAPI (e.g. with pip install "fastapi[standard]"), it includes a package called fastapi-cli, this package provides the fastapi command in the terminal.

To run your FastAPI app for development, you can use the fastapi dev command:

```console $ fastapi dev main.py FastAPI Starting development server ๐Ÿš€ Searching for package file structure from directories with __init__.py files Importing from /home/user/code/awesomeapp module ๐Ÿ main.py code Importing the FastAPI app object from the module with the following code: from main import app app Using import string: main:app server Server started at http://127.0.0.1:8000 server Documentation at http://127.0.0.1:8000/docs tip Running in development mode, for production use: fastapi run Logs: INFO Will watch for changes in these directories: ['/home/user/code/awesomeapp'] INFO Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit) INFO Started reloader process [4106097] using WatchFiles INFO Started server process [4106120] INFO Waiting for application startup. INFO Application startup complete. ```

That command line program called fastapi is FastAPI CLI.

FastAPI CLI takes the path to your Python program and automatically detects the variable with the FastAPI (commonly named app) and how to import it, and then serves it.

For production you would use fastapi run instead. ๐Ÿš€

Internally, FastAPI CLI uses Uvicorn, a high-performance, production-ready, ASGI server. ๐Ÿ˜Ž

fastapi dev

When you run fastapi dev, it will run on development mode.

By default, it will have auto-reload enabled, so it will automatically reload the server when you make changes to your code. This is resource intensive and could be less stable than without it, you should only use it for development.

By default it will listen on the IP address 127.0.0.1, which is the IP for your machine to communicate with itself alone (localhost).

fastapi run

When you run fastapi run, it will run on production mode by default.

It will have auto-reload disabled by default.

It will listen on the IP address 0.0.0.0, which means all the available IP addresses, this way it will be publicly accessible to anyone that can communicate with the machine. This is how you would normally run it in production, for example, in a container.

In most cases you would (and should) have a "termination proxy" handling HTTPS for you on top, this will depend on how you deploy your application, your provider might do this for you, or you might need to set it up yourself. You can learn more about it in the FastAPI Deployment documentation.

License

This project is licensed under the terms of the MIT license.

Owner

  • Name: FastAPI
  • Login: fastapi
  • Kind: organization

FastAPI and friends open source projects. Created and managed by @tiangolo.

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: FastAPI CLI
message: >-
  If you use this software, please cite it using the
  metadata from this file.
type: software
authors:
  - given-names: Sebastiรกn
    family-names: Ramรญrez
    email: tiangolo@gmail.com
identifiers:
repository-code: 'https://github.com/fastapi/fastapi-cli'
url: 'https://fastapi.tiangolo.com'
abstract: >-
  Run and manage FastAPI apps from the command line with FastAPI CLI. ๐Ÿš€
keywords:
  - fastapi
  - typer
  - fastapi-cli
license: MIT

GitHub Events

Total
  • Create event: 62
  • Issues event: 1
  • Release event: 3
  • Watch event: 147
  • Delete event: 58
  • Issue comment event: 82
  • Push event: 106
  • Pull request review comment event: 2
  • Pull request review event: 12
  • Pull request event: 137
  • Fork event: 26
Last Year
  • Create event: 62
  • Issues event: 1
  • Release event: 3
  • Watch event: 147
  • Delete event: 58
  • Issue comment event: 82
  • Push event: 106
  • Pull request review comment event: 2
  • Pull request review event: 12
  • Pull request event: 137
  • Fork event: 26

Committers

Last synced: 8 months ago

All Time
  • Total Commits: 165
  • Total Committers: 10
  • Avg Commits per committer: 16.5
  • Development Distribution Score (DDS): 0.545
Past Year
  • Commits: 147
  • Committers: 10
  • Avg Commits per committer: 14.7
  • Development Distribution Score (DDS): 0.605
Top Committers
Name Email Commits
Sebastiรกn Ramรญrez t****o@g****m 75
github-actions g****s@g****m 58
dependabot[bot] 4****] 21
pre-commit-ci[bot] 6****] 3
Patrick Arminio p****o@g****m 3
Sofie Van Landeghem s****g 1
PokkaKiyo 3****o 1
Peter Kraft p****t@g****m 1
Pedro Impulcetto p****o@g****m 1
Flavien c****t@f****r 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 3
  • Total pull requests: 252
  • Average time to close issues: about 3 hours
  • Average time to close pull requests: 15 days
  • Total issue authors: 3
  • Total pull request authors: 26
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.69
  • Merged pull requests: 93
  • Bot issues: 0
  • Bot pull requests: 156
Past Year
  • Issues: 2
  • Pull requests: 146
  • Average time to close issues: N/A
  • Average time to close pull requests: 15 days
  • Issue authors: 2
  • Pull request authors: 13
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.66
  • Merged pull requests: 38
  • Bot issues: 0
  • Bot pull requests: 108
Top Authors
Issue Authors
  • tiangolo (1)
  • patrick91 (1)
  • twibster (1)
Pull Request Authors
  • dependabot[bot] (148)
  • tiangolo (45)
  • patrick91 (9)
  • pre-commit-ci[bot] (8)
  • AliYmn (4)
  • hafid-Qa (4)
  • mattmess1221 (3)
  • 07pepa (3)
  • FlavienRx (3)
  • mlasevich (2)
  • rasputyashka (2)
  • JoelYoung01 (2)
  • smarcelloc (2)
  • dutyrok (2)
  • svlandeg (2)
Top Labels
Issue Labels
internal (1)
Pull Request Labels
dependencies (148) internal (132) python (117) github_actions (31) bug (7) feature (5) docs (4) upgrade (3) breaking (2) refactor (1)

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 18,823,059 last-month
  • Total dependent packages: 7
    (may contain duplicates)
  • Total dependent repositories: 1
    (may contain duplicates)
  • Total versions: 20
  • Total maintainers: 1
pypi.org: fastapi-cli

Run and manage FastAPI apps from the command line with FastAPI CLI. ๐Ÿš€

  • Versions: 10
  • Dependent Packages: 7
  • Dependent Repositories: 1
  • Downloads: 18,822,621 Last month
Rankings
Dependent packages count: 10.1%
Average: 21.6%
Dependent repos count: 21.6%
Downloads: 33.2%
Maintainers (1)
Last synced: 4 months ago
pypi.org: fastapi-cli-slim

Run and manage FastAPI apps from the command line with FastAPI CLI. ๐Ÿš€

  • Versions: 10
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 438 Last month
Rankings
Dependent packages count: 9.6%
Average: 36.4%
Dependent repos count: 63.3%
Maintainers (1)
Last synced: 4 months ago

Dependencies

.github/workflows/issue-manager.yml actions
  • tiangolo/issue-manager 0.5.0 composite
.github/workflows/latest-changes.yml actions
  • actions/checkout v4 composite
  • docker://tiangolo/latest-changes 0.3.0 composite
  • mxschmitt/action-tmate v3 composite
.github/workflows/publish.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
  • pypa/gh-action-pypi-publish v1.8.11 composite
.github/workflows/smokeshow.yml actions
  • actions/setup-python v5 composite
  • dawidd6/action-download-artifact v3.1.4 composite
.github/workflows/test-redistribute.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
.github/workflows/test.yml actions
  • actions/cache v3 composite
  • actions/checkout v4 composite
  • actions/download-artifact v3 composite
  • actions/setup-python v5 composite
  • actions/upload-artifact v3 composite
  • mxschmitt/action-tmate v3 composite
  • re-actors/alls-green release/v1 composite
pyproject.toml pypi
  • typer >= 0.12.3
requirements-tests.txt pypi
  • coverage >=6.2,<8.0 test
  • mypy ==1.4.1 test
  • pytest >=4.4.0,<8.0.0 test
  • ruff ==0.2.0 test
requirements.txt pypi
  • pre-commit >=2.17.0,<4.0.0