Skip to main content

Organize and rapidly/easily create endpoints for an API. Built on top of Falcon.

Project description

Oswald

Easy to create and maintain endpoints for an API. Built on top of Falcon.

falconBadge pythonBadge Actions Status


Automatic detection and addition of new endpoints. disable any endpoint in one line

Sample Layout

📁Endpoints (Directory)
  ↳ - __init__.py
    - ShoppingCart.py
    - WebVideos.py
    - Announcements.py
    

Sample Endpoint file

class SampleResource:
  # Still Falcon
  def on_get(req, resp):
    resp.media = {
      "message": "hello world"
    }
    
  
  # Required Class + Variables in order for Oswald to detect it's valid.
  class Endpoint:
    API_ENDS = [
      {
        "endpoint": "/Sample",
        "endpointObj": SampleResource
      }
    ]
    

Usage with Gunicorn/Others

Oswald simply returns a normal falcon WGSI object with the additions and removals.

import oswald

stage_1 = oswald.Oswald("moduleFolder")

# Falcon object can be accessed
api = stage_1.api

Sample Output

2019-11-06 22:57:50.490 | DEBUG    | helpers.checkModuleFolder:detect_api_endpoints:21 - Ignoring Init.
2019-11-06 22:57:50.491 | INFO     | helpers.checkModuleFolder:detect_api_endpoints:34 - Importing modules.sampleResource.
2019-11-06 22:57:50.491 | INFO     | helpers.checkModuleFolder:detect_api_endpoints:36 - Imported modules.sampleResource
[-] Endpoints: 1
[-] Generating API Object.
[-] Attemping addition for /sample.
[-] 1 resource(s) added.
[-] Initalizing Webserver.
Serving on http://localhost:8874

Installation

pip install oswald

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

oswald-0.0.4.tar.gz (4.5 kB view details)

Uploaded Source

File details

Details for the file oswald-0.0.4.tar.gz.

File metadata

  • Download URL: oswald-0.0.4.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.3

File hashes

Hashes for oswald-0.0.4.tar.gz
Algorithm Hash digest
SHA256 43d2b834d1322774991692af9d1f4d2bb16b261c7aed78bf1c43078a4b466928
MD5 a11b6563fdc84063ac50d868e523763a
BLAKE2b-256 e682c03cff03d8c3f78eca0b983ad5a297caf1517d34512e1f8f97a6b5d9d3c8

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