Skip to main content

A command line tool for generating the template files needed to integrate fastapi, uvicorn, and a requests based client into a Python project.

Project description

homecloud

W.I.P/ more detailed readme to come
A command line tool for generating the template files needed to integrate fastapi, uvicorn, and a requests based client into a Python project over a local network.
Devices on the local network running a client can automatically find the server for their app name at startup.

Installation

Install with

pip install homecloud

Usage

Navigate to your project directory in the terminal and run

>homecloud

Several files should have been generated. Assuming the project directory is called myapp, you should see the following files:

homecloud_config.toml
myapp_client.py
myapp_get_routes.py
myapp_post_routes.py
myapp_request_models.py
myapp_server.py

The server for myapp can be started by running the myapp_server.py script.
Any device on the local network that runs code that creates a myapp.MyappClient object should be able to automatically find the ip address and port of the myapp server.

Other myapp_*_routes.py files can be generated by passing their names with the -r/--routes switch to the homecloud tool.
If, earlier, we ran

>homecloud -r trace put

then we would have generated the previous files as well as

myapp_trace_routes.py
myapp_put_routes.py

The help display for homecloud:

>homecloud -h
usage: homecloud [-h] [-r [ROUTES ...]] [-d DESTINATION] [app_name]

positional arguments:
  app_name              The name of the app to generate files for. If a value isn't provided, the folder name of the current working directory will be used.

options:
  -h, --help            show this help message and exit
  -r [ROUTES ...], --routes [ROUTES ...]
                        The routes to generate files for in addition to 'get' and 'post' routes.
  -d DESTINATION, --destination DESTINATION
                        The directory to save the generated files to. By default, uses the current working directory.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

homecloud-0.2.0.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

homecloud-0.2.0-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

Details for the file homecloud-0.2.0.tar.gz.

File metadata

  • Download URL: homecloud-0.2.0.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for homecloud-0.2.0.tar.gz
Algorithm Hash digest
SHA256 af3e1464861aaf846b8a280d3025a3599468b2fe861307c3e3fe05339c88b87f
MD5 1c80d368e8b4f33d4d4372bbc639a1eb
BLAKE2b-256 fcc9495a345e9bd3297495e8fa0da6a90892d3e3bc61038175281c03c3bfa5ff

See more details on using hashes here.

File details

Details for the file homecloud-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: homecloud-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 15.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for homecloud-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b8d57af2b3109417a96a5aaa3a3d33f64e0233409b9e4dd67cae184870693482
MD5 afe1f43eef3b73fe2c11ec1a375d961f
BLAKE2b-256 01e974ce2e5ba7ac28cc0314699f599d8cf1872e18e677c4dfd40c08e2099967

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page