An ASGI framework to build HTTP API's from a Python module structure.
Go to file
Maxime Alves LIRMM@home 837c646bc5 [ci] switch to bullseye-3.9 2021-12-01 15:49:59 +01:00
conf
halfapi [lib.domain] implement domain schema - try: halfapi domain dummy_domain 2021-12-01 13:31:46 +01:00
scripts
tests [lib.domain] implement domain schema - try: halfapi domain dummy_domain 2021-12-01 13:31:46 +01:00
.gitignore
.gitlab-ci.yml [ci] switch to bullseye-3.9 2021-12-01 15:49:59 +01:00
CHANGELOG.md
Dockerfile [dockerfile] install git 2021-10-12 18:18:54 +02:00
LICENSE.txt [doc] update README and add joel to license 2021-11-16 17:45:40 +01:00
MANIFEST.in
Pipfile [pipfile] remove dependency to python3.8, TODO find a way to specify python>=3.8 2021-12-01 12:02:21 +01:00
Pipfile.lock
README.md [wip][testfail] update config monodomain - schema gives acls 2021-11-30 18:31:40 +01:00
pyproject.toml
pytest.ini [tests] pytest.ini includes tests as pythonpath (because of dummy_domain) 2021-12-01 11:55:56 +01:00
requirements.txt
setup.cfg
setup.py [deps] add "schema" as dependency 2021-11-29 17:01:52 +01: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