Skip to main content

AJAS

Build Status License: LGPL v3 Generic badge

Description

Another JSON Api Server. This is a library for Python 3 to create fast JSON-Rest APIs. It uses flask and gevent in the background.

Usage

A simple start:

from AJAS import Api

def simple_resolver(header, query):
    return {"hello":"world"}

api = Api()
api.add_get_resolver("/hello", simple_resolver)
api.add_post_resolver("/hello", simple_resolver)
api.run("localhost", 8080)

This will run an webserver returning '{"hello":"world"}' at the adress http://localhost:8080/hello for both GET and POST requests.

Using blocks

Using blocks allows you to seperate different parts of your API. This can be used for versioning. Also, blocks can hold a authenticator, which can accept or deny a request based on the header and query of the reuest.

from AJAS import Api, Authenticator

class MyAuth(Authenticator):
    def authenticate(self, header, query):
        if someCheck() == True:
            return True
        else:
            return False

def simple_resolver(header, query):
    return {"hello":"world"}

api = Api()
v1 = Block("/v1")
v1.add_get_resolver("/hello", resolver)
api.add_block(v1)
api.run("localhost", 8080)

Metadata

Release files for AJAS 0.2.3

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

Source distribution (sdist)

Source distribution for AJAS 0.2.3
File Size Uploaded Provenance Actions
AJAS-0.2.3.tar.gz 3.4 kB Without provenance Details for AJAS-0.2.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for AJAS 0.2.3
File Interpreter ABI Platform Actions
AJAS-0.2.3-py3-none-any.whl Python 3 none any Details for AJAS-0.2.3-py3-none-any.whl

Total release size: 7.9 kB

Release files / AJAS-0.2.3.tar.gz

Download URL AJAS-0.2.3.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b238222fe09ece86232f9d8d0b210e7da07ff030fc526a1dc6604dca90bc9305
BLAKE2b-256 checksum
How to use checksums
685b28f628aaff406c90efcd82a81d45cf8785f3fbaf75f88c750d49b45a5eb9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

Release files / AJAS-0.2.3-py3-none-any.whl

Download URL AJAS-0.2.3-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0ec580a206d31a161b7a7448f1bba354554c9f6d693cde37e1934aaed9535322
BLAKE2b-256 checksum
How to use checksums
b94235bbcce2fc7d405e024b522169ce83ff88e2e0dd4e8e083249a99bc05e6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

Security for AJAS 0.2.3

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.2.3 This release

2 release files 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