hypermea-core


Namehypermea-core JSON
Version 0.9.32 PyPI version JSON
download
home_pagehttps://github.com/pointw-dev/hypermea
SummaryThe core library used by hypermea APIs.
upload_time2024-08-19 02:53:48
maintainerNone
docs_urlNone
authorMichael Ottoson
requires_pythonNone
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # hypermea-core

![](https://github.com/pointw-dev/hypermea/blob/main/img/hypermea-letterhead.png?raw=True)


> **Please note**:  although we currently use this toolkit to create production-ready APIs, the toolkit is still under development.  Use at your own risk.  This doc is under a heavy rewrite.  Information here is mostly correct, but there are gaps and it's messy.

**Docs under construction!**

## Introduction

The core library is used by the hypermea toolkit.  It is not intended to be used by itself (though if you know what you are doing, you could).

When you create an API using hypermea, this library is automatically installed and is available for you to use.

Please see [hypermea](https://github.com/pointw-dev/hypermea) for the full toolkit and documentation.

## The core library

The core library consists of the following modules.  These are all wired up in your API when you created it using hypermea.  Some parts of the library provide useful functions to API developers.  Others are intended for internal use and will not likely be useful to you directly.

### Useful

#### hypermea.core.utils

details

* get_api() -> flask.testing.FlaskClient
* get_db() -> pymongo.database.Database
* update_etag_and_updated(record: dict) -> dict
* make_error_response(message: str, code: int, issues: Optional[List[Dict]] = None) -> flask.wrappers.Response
* url_join(*parts: str) -> str

additional, but not likely useful

* get_my_base_url() -> str
* get_id_field(collection_name: str) -> str
* get_resource_id(resource: dict, collection_name: str) -> str
* is_mongo_running() -> bool (coming soon)
* echo_message()

Note: the `log_setup.py` under `utils` is used to set up logging and has no uses for your API

#### validation

Describe the `HypermeaValidator`, used to add the following validations and types, as well as inheritable to extend:

validations

* unique_ignorecase
* unique_to_parent
* unique_to_tenant (coming soon)
* remote_relation (coming soon)

types

* iso_date
* iso_time
* iso_duration

(link to Eve doc for more info on extending)

#### logging

background explanation, mention the addition to the standard python logging 

* configures 
  * standard formatting, 
  * logging errors to SMTP (`HY_SEND_ERROR_EMAILS`), 
  * logging to folder (`HY_LOG_TO_FOLDER`) - doco details (timed rotation at midnight, etc.)
* the TRACE level accessible with `LOG.trace()`
* the `@trace` decorator (enabled by default, disable by setting `HY_TRACE_LOGGING` to disable)

reference how to adjust the logging verbosity level in the hypermea docs

#### settings_manager

details: singleton, pulls from environment variables, overridable with `_env.conf`, etc. (note no underscores in prefix)

* create(prefix: str, setting_name: str, default_value: str = None, is_optional: bool = False)
* set_prefix_description(prefix: str, description: str)
* has_enabled(setting_name: str) -> bool
* dump(prefix: str = None, callback: Optional[Callable[[str], None]] = None)
* get(setting_name: str, default_value: str = None)
* []

### Not ones you will likely use directly

#### affordances

details

#### gateway

details

#### hooks

details

#### render

details


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/pointw-dev/hypermea",
    "name": "hypermea-core",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "Michael Ottoson",
    "author_email": "michael@pointw.com",
    "download_url": null,
    "platform": null,
    "description": "# hypermea-core\r\n\r\n![](https://github.com/pointw-dev/hypermea/blob/main/img/hypermea-letterhead.png?raw=True)\r\n\r\n\r\n> **Please note**:  although we currently use this toolkit to create production-ready APIs, the toolkit is still under development.  Use at your own risk.  This doc is under a heavy rewrite.  Information here is mostly correct, but there are gaps and it's messy.\r\n\r\n**Docs under construction!**\r\n\r\n## Introduction\r\n\r\nThe core library is used by the hypermea toolkit.  It is not intended to be used by itself (though if you know what you are doing, you could).\r\n\r\nWhen you create an API using hypermea, this library is automatically installed and is available for you to use.\r\n\r\nPlease see [hypermea](https://github.com/pointw-dev/hypermea) for the full toolkit and documentation.\r\n\r\n## The core library\r\n\r\nThe core library consists of the following modules.  These are all wired up in your API when you created it using hypermea.  Some parts of the library provide useful functions to API developers.  Others are intended for internal use and will not likely be useful to you directly.\r\n\r\n### Useful\r\n\r\n#### hypermea.core.utils\r\n\r\ndetails\r\n\r\n* get_api() -> flask.testing.FlaskClient\r\n* get_db() -> pymongo.database.Database\r\n* update_etag_and_updated(record: dict) -> dict\r\n* make_error_response(message: str, code: int, issues: Optional[List[Dict]] = None) -> flask.wrappers.Response\r\n* url_join(*parts: str) -> str\r\n\r\nadditional, but not likely useful\r\n\r\n* get_my_base_url() -> str\r\n* get_id_field(collection_name: str) -> str\r\n* get_resource_id(resource: dict, collection_name: str) -> str\r\n* is_mongo_running() -> bool (coming soon)\r\n* echo_message()\r\n\r\nNote: the `log_setup.py` under `utils` is used to set up logging and has no uses for your API\r\n\r\n#### validation\r\n\r\nDescribe the `HypermeaValidator`, used to add the following validations and types, as well as inheritable to extend:\r\n\r\nvalidations\r\n\r\n* unique_ignorecase\r\n* unique_to_parent\r\n* unique_to_tenant (coming soon)\r\n* remote_relation (coming soon)\r\n\r\ntypes\r\n\r\n* iso_date\r\n* iso_time\r\n* iso_duration\r\n\r\n(link to Eve doc for more info on extending)\r\n\r\n#### logging\r\n\r\nbackground explanation, mention the addition to the standard python logging \r\n\r\n* configures \r\n  * standard formatting, \r\n  * logging errors to SMTP (`HY_SEND_ERROR_EMAILS`), \r\n  * logging to folder (`HY_LOG_TO_FOLDER`) - doco details (timed rotation at midnight, etc.)\r\n* the TRACE level accessible with `LOG.trace()`\r\n* the `@trace` decorator (enabled by default, disable by setting `HY_TRACE_LOGGING` to disable)\r\n\r\nreference how to adjust the logging verbosity level in the hypermea docs\r\n\r\n#### settings_manager\r\n\r\ndetails: singleton, pulls from environment variables, overridable with `_env.conf`, etc. (note no underscores in prefix)\r\n\r\n* create(prefix: str, setting_name: str, default_value: str = None, is_optional: bool = False)\r\n* set_prefix_description(prefix: str, description: str)\r\n* has_enabled(setting_name: str) -> bool\r\n* dump(prefix: str = None, callback: Optional[Callable[[str], None]] = None)\r\n* get(setting_name: str, default_value: str = None)\r\n* []\r\n\r\n### Not ones you will likely use directly\r\n\r\n#### affordances\r\n\r\ndetails\r\n\r\n#### gateway\r\n\r\ndetails\r\n\r\n#### hooks\r\n\r\ndetails\r\n\r\n#### render\r\n\r\ndetails\r\n\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "The core library used by hypermea APIs.",
    "version": "0.9.32",
    "project_urls": {
        "Homepage": "https://github.com/pointw-dev/hypermea"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ad10e199c09ffa79648ef05fc10e8aee7e43a9500182d5c5cb9d5fe9cc6b21f5",
                "md5": "89aec7c011a3714ea2b5d328b59216e5",
                "sha256": "a54eb7e618d908185e9fa64b7a356cbd78a283e40162bb18add9c4afe4d7218d"
            },
            "downloads": -1,
            "filename": "hypermea_core-0.9.32-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "89aec7c011a3714ea2b5d328b59216e5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 23119,
            "upload_time": "2024-08-19T02:53:48",
            "upload_time_iso_8601": "2024-08-19T02:53:48.166134Z",
            "url": "https://files.pythonhosted.org/packages/ad/10/e199c09ffa79648ef05fc10e8aee7e43a9500182d5c5cb9d5fe9cc6b21f5/hypermea_core-0.9.32-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-19 02:53:48",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pointw-dev",
    "github_project": "hypermea",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "hypermea-core"
}
        
Elapsed time: 0.58883s