# 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](https://github.com/collorg/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](https://github.com/halfAPI/halfapi_sample_project)
that helps you to build your own domain.
## Development
@TODO
Raw data
{
"_id": null,
"home_page": "https://github.com/halfAPI/halfapi",
"name": "halfapi",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "web-api development boilerplate",
"author": "Maxime ALVES",
"author_email": "maxime@freepoteries.fr",
"download_url": "https://files.pythonhosted.org/packages/13/af/deeeba194c218dcfa3e591fa12693db340ba60067f3eeaed016762c70fc6/halfapi-0.6.29.tar.gz",
"platform": null,
"description": "# HalfAPI\n\nBase tools to develop complex API with rights management.\n\nThis project was developped by Maxime Alves and Jo\u00ebl Ma\u00efzi. The name was chosen\nto reference [HalfORM](https://github.com/collorg/halfORM), a project written by Jo\u00ebl Ma\u00efzi.\n\n\n## Dependencies\n\n- python3\n- python3-pip\n- libgit2-dev\n- starlette\n- PyJWT\n- click\n- uvicorn\n- orjson\n- pyyaml\n\n\n## Configuration\n\nConfigure HalfAPI in the file : .halfapi/config .\n\nIt's a **toml** file that contains at least two sections, project and domains.\n\nhttps://toml.io/en/\n\n\n###\u00a0Project\n\nThe main configuration options without which HalfAPI cannot be run.\n\n**secret** : The file containing the secret to decode the user's tokens.\n\n**port** : The port for the test server.\n\n**loglevel** : The log level (info, debug, critical, ...)\n\n\n### Domains\n\nSpecify the domains configurations in the following form :\n\n```\n[domains.DOMAIN_NAME]\nname = \"DOMAIN_NAME\"\nenabled = true\nprefix = \"/prefix\"\nmodule = \"domain_name.path.to.api.root\"\nport = 1002\n```\n\nSpecific configuration can be done under the \"config\" section :\n\n```\n[domains.DOMAIN_NAME.config]\nboolean_option = false\nstring_value = \"String\"\nanswer = 42\nlistylist = [\"hello\", \"world\"]\n```\n\nAnd can be accessed through the app's \"config\" dictionnary.\n\n\n## Usage\n\nDevelop an HalfAPI domain by following the examples located in\ntests/dummy_domain . An HalfAPI domain should be an importable python module\nthat is available in the python path.\n\nRun the project by using the `halfapi run` command.\n\nYou can try the dummy_domain with the following command.\n\n```\nPYTHONPATH=$PWD/tests python -m halfapi domain dummy_domain\n```\n\n### CLI documentation\n\nUse the CLI help.\n\n```\npython -m halfapi --help\npython -m halfapi domain --help\n```\n\n## API Testing\n\n@TODO\n\n\n### Example\n\nCheck out the [sample project](https://github.com/halfAPI/halfapi_sample_project)\nthat helps you to build your own domain.\n\n\n## Development\n\n@TODO\n",
"bugtrack_url": null,
"license": "GPLv3",
"summary": "Core to write deep APIs using a module's tree",
"version": "0.6.29",
"project_urls": {
"Homepage": "https://github.com/halfAPI/halfapi",
"Source": "https://github.com/halfAPI/halfapi"
},
"split_keywords": [
"web-api",
"development",
"boilerplate"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "785344cf9e3be5afc81190557c12e85af39e799637434067b5860f782163bc32",
"md5": "ee10459d72e6eb002e553013fc79533b",
"sha256": "e60502fc4ad535bfcd7f0552d7cfa9c9e91794504c075101e149610a4a737d6b"
},
"downloads": -1,
"filename": "halfapi-0.6.29-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ee10459d72e6eb002e553013fc79533b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 36394,
"upload_time": "2023-12-13T15:53:55",
"upload_time_iso_8601": "2023-12-13T15:53:55.740708Z",
"url": "https://files.pythonhosted.org/packages/78/53/44cf9e3be5afc81190557c12e85af39e799637434067b5860f782163bc32/halfapi-0.6.29-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "13afdeeeba194c218dcfa3e591fa12693db340ba60067f3eeaed016762c70fc6",
"md5": "0b52934ca4d22e2c65dec3c1754c564c",
"sha256": "3bf3eecb44d35b8eb0bd3d6b34267fd2c94fb1da9d125c1d5a8dbd0e882a0756"
},
"downloads": -1,
"filename": "halfapi-0.6.29.tar.gz",
"has_sig": false,
"md5_digest": "0b52934ca4d22e2c65dec3c1754c564c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 35809,
"upload_time": "2023-12-13T15:53:58",
"upload_time_iso_8601": "2023-12-13T15:53:58.199444Z",
"url": "https://files.pythonhosted.org/packages/13/af/deeeba194c218dcfa3e591fa12693db340ba60067f3eeaed016762c70fc6/halfapi-0.6.29.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-13 15:53:58",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "halfAPI",
"github_project": "halfapi",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "halfapi"
}