Skip to main content

ReadyAPI CLI

Test Publish Coverage Package version

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


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

Description

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

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

To run your ReadyAPI app for development, you can use the readyapi dev command:

$ readyapi dev main.py
INFO     Using path main.py
INFO     Resolved absolute path /home/user/code/awesomeapp/main.py
INFO     Searching for package file structure from directories with __init__.py files
INFO     Importing from /home/user/code/awesomeapp

 โ•ญโ”€ Python module file โ”€โ•ฎ
 โ”‚                      โ”‚
 โ”‚  ๐Ÿ main.py          โ”‚
 โ”‚                      โ”‚
 โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

INFO     Importing module main
INFO     Found importable ReadyAPI app

 โ•ญโ”€ Importable ReadyAPI app โ”€โ•ฎ
 โ”‚                           โ”‚
 โ”‚  from main import app     โ”‚
 โ”‚                           โ”‚
 โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€-โ•ฏ

INFO     Using import string main:app

 โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ReadyAPI CLI - Development mode โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
 โ”‚                                                     โ”‚
 โ”‚  Serving at: http://127.0.0.1:8000                  โ”‚
 โ”‚                                                     โ”‚
 โ”‚  API docs: http://127.0.0.1:8000/docs               โ”‚
 โ”‚                                                     โ”‚
 โ”‚  Running in development mode, for production use:   โ”‚
 โ”‚                                                     โ”‚
 โ”‚  readyapi run                                       โ”‚
 โ”‚                                                     โ”‚
 โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

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 [56345] using WatchFiles
INFO:     Started server process [56352]
INFO:     Waiting for application startup.
INFO:     Application startup complete.

That command line program called readyapi is ReadyAPI CLI.

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

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

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

readyapi dev

When you run readyapi 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).

readyapi run

When you run readyapi 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 ReadyAPI Deployment documentation.

License

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

Metadata

Release files for readyapi-cli-slim 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for readyapi-cli-slim 0.0.6
File Size Uploaded
readyapi_cli_slim-0.0.6.tar.gz 15.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for readyapi-cli-slim 0.0.6
File Interpreter ABI Platform
readyapi_cli_slim-0.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 25.1 kB

Release files / readyapi_cli_slim-0.0.6.tar.gz

Download URL readyapi_cli_slim-0.0.6.tar.gz
Size 15.5 kB
Tags Source
SHA-256 checksum
How to use checksums
6c9d5ff401b7cafa9c8043703e63992508444338e1766c1fc0edd47bdbae90b4
BLAKE2b-256 checksum
How to use checksums
15024c5263a920fb35e2b2fb56969ed25302fd347c5e2ecf1f523109624aa89f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.5

Release files / readyapi_cli_slim-0.0.6-py3-none-any.whl

Download URL readyapi_cli_slim-0.0.6-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f7ab58295ccf8eca6b5bc21b9ab59c567c251005b5c1da52cea068dd96893315
BLAKE2b-256 checksum
How to use checksums
f825351cc431977af5601ae8d9fa1cea11aa5c52b4adfd8e38da80da575985c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.5

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 release files

0.0.5

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page