Skip to main content

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

Metadata

Release files for oswald 0.0.4

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

Source distribution (sdist)

Source distribution for oswald 0.0.4
File Size Uploaded Provenance Actions
oswald-0.0.4.tar.gz 4.5 kB Without provenance Details for oswald-0.0.4.tar.gz

Release files / oswald-0.0.4.tar.gz

Download URL oswald-0.0.4.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
43d2b834d1322774991692af9d1f4d2bb16b261c7aed78bf1c43078a4b466928
BLAKE2b-256 checksum
How to use checksums
e682c03cff03d8c3f78eca0b983ad5a297caf1517d34512e1f8f97a6b5d9d3c8
Upload date
Uploaded using Trusted Publishing?
What is 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

Security for oswald 0.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.4 This release

1 release file No provenance

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