Skip to main content

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 a toml file that contains at least two sections, project and domains.

https://toml.io/en/

### Project

The main configuration options without which HalfAPI cannot be run.

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

Specify the domains configurations in the following form :

[domains.DOMAIN_NAME]
name = "DOMAIN_NAME"
enabled = true
prefix = "/prefix"
module = "domain_name.path.to.api.root"
port = 1002

Specific configuration can be done under the "config" section :

[domains.DOMAIN_NAME.config]
boolean_option = false
string_value = "String"
answer = 42
listylist = ["hello", "world"]

And can be accessed through the app's "config" dictionnary.

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.

PYTHONPATH=$PWD/tests python -m halfapi domain dummy_domain

CLI documentation

Use the CLI help.

python -m halfapi --help
python -m halfapi domain --help

API Testing

@TODO

Example

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

Development

@TODO

Metadata

Release files for halfapi 0.6.31

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for halfapi 0.6.31
File Size Uploaded
halfapi-0.6.31.tar.gz 35.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for halfapi 0.6.31
File Interpreter ABI Platform
halfapi-0.6.31-py3-none-any.whl Python 3 none any Details

Total release size: 71.8 kB

Release files / halfapi-0.6.31.tar.gz

Download URL halfapi-0.6.31.tar.gz
Size 35.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c92e78a3763afae230679cd45d7f363f25d35aa8cd3a3558113c37f465401279
BLAKE2b-256 checksum
How to use checksums
7a8e533d107cda69ad0e0fe46c3f3d944d03e9f8310e37b16661392bf4e843d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / halfapi-0.6.31-py3-none-any.whl

Download URL halfapi-0.6.31-py3-none-any.whl
Size 36.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
54b89152d77a0e8d60c81a9fd976305064b83ebf58f11dbb366e37d78ae623a7
BLAKE2b-256 checksum
How to use checksums
6596282abb18ea0819035a3c21d29bf9a4b5c2939352436f81d81b31ebed17d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release history Release notifications | RSS feed

This release

0.6.31 This release

2 release files

0.6.29

2 release files

0.6.28

1 release file

0.6.25

2 release files

0.6.23

2 release files

0.6.22

1 release file

0.6.18

2 release files

0.6.17

2 release files

0.6.16

2 release files

0.6.15

2 release files

0.6.14

2 release files

0.6.13

2 release files

0.6.12

2 release files

0.6.11

2 release files

0.6.9

2 release files

0.6.8

2 release files

0.6.7

2 release files

0.6.6

2 release files

0.6.5

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.10

2 release files

0.5.9

2 release files

0.5.8

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page