Skip to main content

======== Cognate

Welcome to Cognate, a package designed with making it easy to create component services. Cognate strives to ease the burden of configuration management and logging configuration, by providing the infrastructure. Cognate fosters component service architectures by making the design, implementation, and testing of services less of a chore.

A sample hello world component:

from cognate.component_core import ComponentCore
import sys

class HelloWorld(ComponentCore):
    def __init__(self, name='World', **kwargs):
        self.name = name

        super().__init__(**kwargs)

    def cognate_options(self, arg_parser):
        arg_parser.add_argument(
            '--name',
            default=self.name,
            help='Whom will receive the salutation.')

    def run(self):
        self.log.info('Hello %s', self.name)


if __name__ == '__main__':
    argv = sys.argv
    service = HelloWorld(argv=argv)
    service.run()

Allows for the executable:

$ python hello_world.py -h
usage: hello_world.py [-h] [--service_name SERVICE_NAME]
                      [--log_level {debug,info,warn,error}]
                      [--log_path LOG_PATH] [--verbose] [--name NAME]

optional arguments:
  -h, --help            show this help message and exit
  --service_name SERVICE_NAME
                        This will set the name for the current instance.
                        This will be reflected in the log output.
                        (default: HelloWorld)
  --log_level {debug,info,warn,error}
                        Set the log level for the log output. (default: error)
  --log_path LOG_PATH   Set the path for log output. The default file created
                        is "<log_path>/<service_name>.log". If the path
                        ends with a ".log" extension, then the path be a
                        target file. (default: None)
  --verbose             Enable verbose log output to console. Useful for
                        debugging. (default: False)
  --name NAME           Whom will receive the salutation. (default: World)

Documentation

For the latest documentation, visit http://neoinsanity.github.io/cognate.

Getting Cognate

Installation

Use pip to install Cognate.

pip install cognate

Source

The latest stable release source of Cognate can be found on the master branch at https://github.com/neoinsanity/cognate/tree/master.

For the latest development code, use the develop branch at https://github.com/neoinsanity/cognate. Please note that the development branch may change without notification.

To install Cognate from source utilize the setup.py:

python setup.py install

Project Development

If you are interested in developing Cognate code, utilize the helper scripts in the cognate/bin directory.

Setup the Development Environment

Prior to running the dev setup scripts, ensure that you have virtualenv installed. All setup commands are assumed to be run from the project root, which is the directory containing the setup.py file.

Prep the development environment with the command:

bin/dev_setup.sh

This command will setup the virtualenv for the project in the directory /venv. It will also install the Cognate in a develop mode, with the creation of a development egg file.

Enable the Development Environment

To make it easy to ensure a correctly configured development session, utilize the command:

. bin/enable_dev.sh

or

source bin/enable_dev.sh

Note that the script must be sourced, as it will enable a virtualenv session and add the bin directory scripts to environment PATH.

Running Tests

To run the unit tests:

run_tests.sh

A BUILD/COVERAGE_REPORT directory will be generated with the test coverage report. To view the report, open index.html in the generated directory in a browser.

Building Documentation

To run the documentation generation:

doc_build.sh

A BUILD//doc/build directory will be generated with the documentation. To view the documentation, open index.html in the generated directory in a browser.

Metadata

Release files for cognate 1.0.0

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

Source distribution (sdist)

Source distribution for cognate 1.0.0
File Size Uploaded Provenance Actions
cognate-1.0.0.tar.gz 15.1 kB Without provenance Details for cognate-1.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 30.1 kB

Release files / cognate-1.0.0.tar.gz

Download URL cognate-1.0.0.tar.gz
Size 15.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4b61e3f00761906d2c4055b17bf455d49a6cca70e5782cab0f4652e563674dba
BLAKE2b-256 checksum
How to use checksums
3980244ecd6236070b763f75789922771630e91c5050615d1bea2c1f242e7981
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.5

Release files / cognate-1.0.0-py3-none-any.whl

Download URL cognate-1.0.0-py3-none-any.whl
Size 15.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
32c25a5086580500e3ecff63de8d9a05b96363c8af828ce309dd4911a628a0ab
BLAKE2b-256 checksum
How to use checksums
e328c17b708ca52ea6b45253d48586ed44a0f62cecb7b4ad17e9806d5a104c37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.5

Security for cognate 1.0.0

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.

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