{% extends 'portal.html' %} {% block title %}Welcome {{ name }}{% endblock %} {% block content %}
Congratulation, you have successfully configured and installed PBSHM Core.
PBSHM Core is a minimal application built on Flask to enable development of PBSHM modules that consume PBSHM Schema data. It was designed to deal with all the basic requirements of a PBSHM system, allowing developers to focus on implementation of PBSHM modules. For more information on how to develop your own PBSHM module and include it within your core installation, please see here.
The PBSHM Core comes with a few tools which are available via the mechanic and timekeeper modules. The mechanic module enables easy interaction with the PBSHM Schema and your local database. The timekeeper module enables conversions from native python datetime object into the UTC nanoseconds since epoch time stored within the database.
To retrieve all versions of the PBSHM Schema available for installation, use the following cli command:
flask mechanic versions
To create a new collection with the latest version of the PBSHM Schema installed within the collection, use the following command:
flask mechanic new-structure-collection collection-name
To create a new collection with a specific version of the PBSHM Schema installed within the collection, use the following command:
flask mechanic new-structure-collection collection-name --version=v1.0
To convert a python datetime object into UTC nanoseconds since epoch, use the following code:
from datetime import datetime
from pbshm.timekeeper.timekeeper import datetime_to_nanoseconds_since_epoch
now = datetime.now()
nanoseconds = datetime_to_nanoseconds_since_epoch(now)
To convert a UTC nanoseconds since epoch into a native python datetime object, use the following code:
from pbshm.timekeeper.timekeeper import nanoseconds_since_epoch_to_datetime
nanoseconds = 1706884924912888000
date_time = nanoseconds_since_epoch_to_datetime(nanoseconds)
If you encounter any issues/bugs with the system or the instructions above, please raise an issue through the issues system on GitHub.
{% endblock %}