An ASGI framework to build HTTP API's from a Python module structure.
Go to file
Maxime Alves LIRMM 4f4dac0ff2 [deps] Migration from starlette v0.18 to v0.23
Breaking : migrate your tests that use the TestDomain.client method
following the instructions here https://github.com/Kludex/bump-testclient

Squashed commit of the following:

commit 0417f27b3f
Author: Maxime Alves LIRMM <maxime.alves@lirmm.fr>
Date:   Sat Jan 14 11:08:44 2023 +0100

    [deps] starlette 0.23

commit 552f00a65b
Author: Maxime Alves LIRMM <maxime.alves@lirmm.fr>
Date:   Sat Jan 14 10:59:42 2023 +0100

    [deps] starlette 0.22

commit aefe448717
Author: Maxime Alves LIRMM <maxime.alves@lirmm.fr>
Date:   Sat Jan 14 10:55:45 2023 +0100

    [tests][fix] compares the json interpreted value instead of the string

commit 01333a200c
Author: Maxime Alves LIRMM <maxime.alves@lirmm.fr>
Date:   Sat Jan 14 10:55:20 2023 +0100

    [testing] changes from requests to httpx for Starlette TestClient (breaks)

commit f3784fab7f
Author: Maxime Alves LIRMM <maxime.alves@lirmm.fr>
Date:   Sat Jan 14 10:54:10 2023 +0100

    [deps][breaking] starlette 0.21

commit 717d3f8bd6
Author: Maxime Alves LIRMM <maxime.alves@lirmm.fr>
Date:   Sat Jan 14 10:26:31 2023 +0100

    [responses] use a wrapper function for exception handling (fix starlette 0.20)

commit d0876e45da
Author: Maxime Alves LIRMM <maxime.alves@lirmm.fr>
Date:   Sat Jan 14 10:25:21 2023 +0100

    [deps][breaking] starlette 0.20

commit 6504191c53
Author: Maxime Alves LIRMM <maxime.alves@lirmm.fr>
Date:   Sat Jan 14 10:12:51 2023 +0100

    [deps] starlette 0.19

commit 7b639a8dc2
Author: Maxime Alves LIRMM <maxime.alves@lirmm.fr>
Date:   Sat Jan 14 10:11:14 2023 +0100

    [deps] starlette 0.18

commit 20bd9077a4
Author: Maxime Alves LIRMM <maxime.alves@lirmm.fr>
Date:   Sat Jan 14 10:07:48 2023 +0100

    pipenv update
2023-01-14 11:10:13 +01:00
conf [release][0.1.0] First HalfAPI release 2020-07-23 17:54:47 +02:00
halfapi [deps] Migration from starlette v0.18 to v0.23 2023-01-14 11:10:13 +01:00
scripts [0.5.11] 2021-10-04 22:16:27 +02:00
tests [deps] Migration from starlette v0.18 to v0.23 2023-01-14 11:10:13 +01:00
.gitignore [0.5.3] 2021-06-17 18:53:23 +02:00
.gitlab-ci.yml [deps] pytest v7, [ci/cd] no tests on python3.6 2022-07-06 08:29:29 +02:00
CHANGELOG.md [breaking] domain description is defined in a dict, not in "__name__", "__id__", "__routers__" ... 2022-10-13 12:18:13 +02:00
Dockerfile [release] 0.6.21 2022-08-08 20:21:05 +02:00
LICENSE.txt [doc] update README and add joel to license 2021-11-16 17:45:40 +01:00
MANIFEST.in [package] fixed some paths 2020-08-27 09:54:48 +02:00
Pipfile [deps] Migration from starlette v0.18 to v0.23 2023-01-14 11:10:13 +01:00
Pipfile.lock [deps] Migration from starlette v0.18 to v0.23 2023-01-14 11:10:13 +01:00
README.md [wip][testfail] update config monodomain - schema gives acls 2021-11-30 18:31:40 +01:00
optional-requirements.txt [lib/responses] ajout format XLSX, car ODS bug avec les dates 2022-05-17 10:30:15 +02:00
pyproject.toml [deps] Updated dependencies and added files for standard packaging. 2020-07-29 22:07:16 +02:00
pytest.ini [deps] pytest v7, [ci/cd] no tests on python3.6 2022-07-06 08:29:29 +02:00
requirements.txt [release] 0.6.13 2022-03-21 09:51:04 +01:00
setup.cfg [deps] Updated dependencies and added files for standard packaging. 2020-07-29 22:07:16 +02:00
setup.py [deps] Migration from starlette v0.18 to v0.23 2023-01-14 11:10:13 +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