Skip to main content

Fast and flexible API framework based on Falcon and SQLAlchemy

Project description

pipeline statuscoverage reportCodacy BadgeCode style: blackPyPI - Downloads

Fast and flexible low-level API framework based on Falcon, Marshmallow and SQLAlchemy Core

API is close to OpenAPI 3.0 specification

Currently is under active development

Awokado Diagram

Changelog

You can find in: CHANGELOG.md

Installation

$ pip install awokado

Awokado uses dynaconf for loading it settings

You can find all available variables in settings.toml file

Filtering

syntax

resource_field_name[operator]=value

available operators

  • lte
  • eq
  • gte
  • ilike
  • in
  • empty
  • contains

examples

/v1/user/?username[ilike]=Andy it’s equal to SQL statement: SELECT * FROM users WHERE username ILIKE '%Andy%';

/v1/user/?id[in]=1,2,3,4 it’s equal to SQL statement: SELECT * FROM users WHERE id IN (1,2,3,4);

Sorting

syntax

sort=resource_field_name,-another_resource_field_name

use - for descending order

examples

/v1/user/?sort=name,-record_created

Includes

syntax

include=resource_relation_name

examples

/v1/author/?include=books

/v1/author/?include=books,stores

Limit \ Offset (pagination)

syntax

limit=integer&offset=integer

examples

/v1/user/?limit=10&offset=10

/v1/user/?offset=10

/v1/user/?limit=2000

Documentation

Awokado allows to generate documentation for a project using swagger(3rd version). To generate documentation you need to import generate_documentation function and call it with required parameters. Description of your project can be taken from template, in that case you need to provide path to the template as argument in template_absolute_path

function parameters

  • api - your falcon.API instance
  • api_host - IP address for your host
  • project_name - title for your documentation
  • output_dir - path, where swagger doc will be added
  • api_version default "1.0.0" - string with number of version of you project
  • template_absolute_path default None - absolute path to template with description of your project

examples

from awokado.documentation import generate_documentation
from dynaconf import settings
from api.routes import api

generate_documentation(
    api=api,
    api_host=settings.MY_HOST_FOR_DOCUMENTATION,
    api_version="2.0.0",
    project_name="API Documentation",
    template_absolute_path="Users/my_user/projects/my_project/template.tmpl",
    output_dir="my_project/documentation",
)

Contributing

Tests

To run tests locally you should create .secrets.toml file in the project root directory:

[default]
    DATABASE_PASSWORD='your_db_password_here'
    DATABASE_HOST='localhost'
    DATABASE_USER='your_db_username_here'
    DATABASE_PORT=5432 #DB port
    DATABASE_DB='test'

or

[default]
    DATABASE_URL='your_full_db_url'

Do not use both ways at the same time, you will get error!

Install required packages:

$ pip install -r requirements/requirements-dev.txt

Then you can setup your database:

$ python -m tests.test_app.init_db

And run tests:

$ python -m unittest

Authors

Is being made with the help of

Alex Sidorov

Ksenia Malyavskaya

Pavel Danilyuk

Andrew Osenenko

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

awokado-0.3b15.tar.gz (20.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

awokado-0.3b15-py3-none-any.whl (32.7 kB view details)

Uploaded Python 3

File details

Details for the file awokado-0.3b15.tar.gz.

File metadata

  • Download URL: awokado-0.3b15.tar.gz
  • Upload date:
  • Size: 20.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for awokado-0.3b15.tar.gz
Algorithm Hash digest
SHA256 e7fae7a56e06d95cd74fce72a5ed183956036edccd2b07155eee200a993c11ea
MD5 8d15fb1b625935f0942e18f340f0adb6
BLAKE2b-256 e8817fdd4a298919d73de354b3bd3d409ead93e12bb97ac88e8161928c9dbe08

See more details on using hashes here.

File details

Details for the file awokado-0.3b15-py3-none-any.whl.

File metadata

  • Download URL: awokado-0.3b15-py3-none-any.whl
  • Upload date:
  • Size: 32.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for awokado-0.3b15-py3-none-any.whl
Algorithm Hash digest
SHA256 db8c9d33a8d5df5d0af1f449606e4f12b7176700f1a78da57d1ff7d96d694eca
MD5 bf1857fff19e5122c0a5fb5b3a3f6fbc
BLAKE2b-256 9810f8afd736d243f4f287e1249a81bb2b05d9f22d3d5cd936d097a94462385f

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