An ASGI framework to build HTTP API's from a Python module structure.
Go to file
Maxime Alves LIRMM b3ae9d4759 [wip] 0.7.0 - acl decorator 2022-08-19 18:45:45 +02:00
conf
halfapi [wip] 0.7.0 - acl decorator 2022-08-19 18:45:45 +02:00
scripts
tests [wip] 0.7.0 - acl decorator 2022-08-19 18:45:45 +02:00
.gitignore
.gitlab-ci.yml [deps] pytest v7, [ci/cd] no tests on python3.6 2022-07-06 08:29:29 +02:00
CHANGELOG.md [responses] html and plaintext return types as ret_type argument 2022-08-18 20:19:36 +02:00
Dockerfile [docker] 3.10.5-slim-bullseye 2022-08-05 08:55:12 +02:00
LICENSE.txt
MANIFEST.in
Pipfile [wip] 0.7.0 2022-08-18 14:17:02 +02:00
Pipfile.lock [deps] lock pipenv update 2022-07-18 20:35:49 +02:00
README.md
optional-requirements.txt [lib/responses] ajout format XLSX, car ODS bug avec les dates 2022-05-17 10:30:15 +02:00
pyproject.toml
pytest.ini [deps] pytest v7, [ci/cd] no tests on python3.6 2022-07-06 08:29:29 +02:00
requirements.txt
setup.cfg
setup.py [wip] 0.7.0 2022-08-18 14:17:02 +02:00

README.md

HalfAPI

Base tools to develop complex API with rights management.

This project was developped by Maxime Alves and Joël Maïzi. The name was chosen to reference HalfORM, a project written by Joël Maïzi.

Dependencies

  • python3
  • python3-pip
  • libgit2-dev
  • starlette
  • PyJWT
  • click
  • uvicorn
  • orjson
  • pyyaml

Configuration

Configure HalfAPI in the file : .halfapi/config .

It's an ini file that contains at least two sections, project and domains.

### Project

The main configuration options without which HalfAPI cannot be run.

name : Project's name

halfapi_version : The HalfAPI version on which you work

secret : The file containing the secret to decode the user's tokens.

port : The port for the test server.

loglevel : The log level (info, debug, critical, ...)

Domains

The name of the options should be the name of the domains' module, the value is the submodule which contains the routers.

Example :

dummy_domain = .routers

Usage

Develop an HalfAPI domain by following the examples located in tests/dummy_domain . An HalfAPI domain should be an importable python module that is available in the python path.

Run the project by using the halfapi run command.

You can try the dummy_domain with the following command.

python -m halfapi routes --export --noheader dummy_domain.routers | python -m halfapi run -

API Testing

@TODO

Example

Check out the sample project that helps you to build your own domain.

Development

@TODO