hypermea-core
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 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
- adjust_etag_and_updated_date(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() -> flask.Response
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
@tracedecorator (enabled by default, disable by settingHY_TRACE_LOGGINGto 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
Metadata
Release files for hypermea-core 0.9.51
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hypermea_core-0.9.51-py3-none-any.whl | Python 3 | none | any | Details |
Release files / hypermea_core-0.9.51-py3-none-any.whl
| Download URL | hypermea_core-0.9.51-py3-none-any.whl |
|---|---|
| Size | 34.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
070464a30ff53d57114d0adb9a8d0595aa7ade5636f10352d6eb213b48d47bdd
|
|
BLAKE2b-256 checksum How to use checksums |
a8c69e742266365411aedb103397712873f627953cc917a0f0ffbb188b151e47
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.3
|
Security for hypermea-core 0.9.51
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.