Skip to main content

The easy way to create powerful apis in python

Project description

Easy_API_Builder

An Python Package for easily create APIs in Python.

pip install easy-api-builder

Requiremnets: <= python 3.6

Required modules –> Flask, requests

Documentation

Build an API with easy_api_builder:

from easy_api_builder.builder import apiBuilder
json_response = \
{
    "easy_api_builder.Version": 0.1,
    "downloads": "200+"
}

builder = apiBuilder()
builder.create_get_api(json_response, "/")
builder.start(port=80)

Build an api with authorization by an api key

from easy_api_builder.builder import apiBuilder
json_response = \
{
    "easy_api_builder.Version": 0.1,
    "downloads": "200+"
}

builder = apiBuilder()
builder.build_auth_api(json_response, ["key1", "key2], "/api/")
builder.start(port=80)

To get a response from the api you must make a requests to this url: http://yourdomain.com/api?key=key1/

Build a Documentation Page for your API:

# Import the required Packages
from easy_api_builder.builder import apiBuilder

json_response = \
{
    "easy_api_builder.Version": 0.1,
    "downloads": "200+"
}

# Define the apiBuilder

builder = apiBuilder()

# Create a GET API
builder.build_get_api(json=json_response, path="/")

# Create a Documentation Page for the API
builder.create_docs(sitename="Cocumentation", sitedescription="Official Documentation for easy_api API", path="/docs", docs="How to use our API? etc...")

# Start the API on defualt Port 80
builder.start(port=80)

Build a custom docs page

...
# Define the apiBuilder}
builder = apiBuilder()

builder.create_custom_docs("/docs/v3", "customfile.html")

builder.start()

Note: You can create only a Documentation Page too:

# Import the Required Packages
from easy_api_builder.builder import apiBuilder
# Define the apiBuilder

builder = apiBuilder()

# Create a Documentation Page
builder.create_docs(sitename="Cocumentation", sitedescription="Official Documentation for easy_api API", path="/docs", docs="How to use our API? etc...")

# Start the API on defualt Port 80
builder.start(port=80)

You can change the path. For example “/api/v3”

How to customize the Documentation- and Error Page?

To customize the Documentation- and error page, go in the package folder and edit the index.html and the 404.html

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

easy_api_builder-0.3.tar.gz (2.8 kB view details)

Uploaded Source

File details

Details for the file easy_api_builder-0.3.tar.gz.

File metadata

  • Download URL: easy_api_builder-0.3.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.0

File hashes

Hashes for easy_api_builder-0.3.tar.gz
Algorithm Hash digest
SHA256 df79bc93f1a1048e8a00b97867898deae7542adfe2e9276a0dce55ab946d2a17
MD5 6ac7e4fd75f42c99a120966c438c3dce
BLAKE2b-256 7f4d056d619bbe577614bd0b4d4cf870808e253b7e042a25a51c584146785b31

See more details on using hashes here.

Supported by

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