Metadata-Version: 2.1
Name: aibs-informatics-core
Version: 0.0.7
Summary: Core package for informatics projects at the Allen Institute for Brain Science
Author: AIBS Informatics Group
Maintainer: AIBS Informatics Group
License: Allen Institute Software License – This software license is the 2-clause BSD 
        license plus a third clause that prohibits redistribution and use for 
        commercial purposes without further permission. 
        
        Copyright © 2024. Allen Institute.  All rights reserved.
        
        Redistribution and use in source and binary forms, with or without 
        modification, are permitted provided that the following conditions are met:
        
        1. Redistributions of source code must retain the above copyright notice, this 
        list of conditions and the following disclaimer.
        
        2. Redistributions in binary form must reproduce the above copyright notice, 
        this list of conditions and the following disclaimer in the documentation 
        and/or other materials provided with the distribution.
        
        3. Redistributions and use for commercial purposes are not permitted without 
        the Allen Institute’s written permission. For purposes of this license, 
        commercial purposes are the incorporation of the Allen Institute's software 
        into anything for which you will charge fees or other compensation or use of 
        the software to perform a commercial service for a third party. Contact 
        terms@alleninstitute.org for commercial licensing opportunities.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
        ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
        WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 
        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 
        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Project-URL: Documentation, https://.github.io/aibs-informatics-core/
Project-URL: Homepage, https://github.com/AllenInstitute/aibs-informatics-core/
Project-URL: Issues, https://github.com/AllenInstitute/aibs-informatics-core/issues
Project-URL: Repository, https://github.com/AllenInstitute/aibs-informatics-core/
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: marshmallow~=3.22.0
Requires-Dist: dataclasses-json~=0.6.7
Requires-Dist: pathlib-abc
Requires-Dist: python-dateutil
Requires-Dist: pytz
Requires-Dist: pyyaml~=6.0
Requires-Dist: requests
Requires-Dist: typing_inspect
Provides-Extra: dev
Requires-Dist: aibs-informatics-test-resources; extra == "dev"
Provides-Extra: release
Requires-Dist: build; extra == "release"
Requires-Dist: bump-my-version; extra == "release"
Requires-Dist: twine; extra == "release"
Requires-Dist: wheel; extra == "release"

# AIBS Informatics Core

[![Build Status](https://github.com/AllenInstitute/aibs-informatics-core/actions/workflows/build.yml/badge.svg)](https://github.com/AllenInstitute/aibs-informatics-core/actions/workflows/build.yml)

---

## Overview

The AIBS Informatics Core library provides a collection of core functionalities and utilities for various projects at the Allen Institute for Brain Science. This library includes modules for handling environment configurations, data models, executors, and various utility functions.

## Modules

### Utils

The `utils` module provides various utility functions and classes to facilitate common tasks such as logging, hashing, and working with dictionaries and strings.

- **file_operations**: Functions for working with files and directories.
- **decorators**: Decorators for adding functionality to functions and methods.
- **hashing**: Functions for generating hashes.
- **json**: Functions for working with JSON data.
- **logging**: Utilities for setting up and managing logging.
- **modules**: Functions dealing with modules and imports.
- **multiprocessing**: Functions for working with multiprocessing.
- **os_operations**: Functions for working with the operating system.
- **time**: Functions for working with time.
- **units**: Functions for converting units.
- **version**: Functions and classes for handling version numbers.
- **tools.dicttools**: Functions for manipulating dictionaries.
- **tools.strtools**: Functions for manipulating strings.

### Models

The `models` module defines protocols and base models used for serialization and deserialization of data. This module provides base classes for creating data models and utilities for working with data models.

There are a few base classes that can be used to create data models:
- **ModelBase**: A base class for creating data models.
- **DataClassModel**: A base class for creating data models using dataclasses.
- **SchemaModel**: A base class for creating data models using marshmallow schemas + dataclass.
- **WithValidation**: A mixin class for adding validation to data models.


### Executors

The `executors` module provides base classes and utilities for creating and running executors. Executors are responsible for handling specific tasks or requests. They allow for validating inputs/outputs based on schema data models 

- **BaseExecutor**: A base class for creating executors.
- **run_cli_executor**: A utility function for running executors from the command line.

### Env

The `env` module provides a concept of `EnvBase` which allows for creating isolated namespaces based on the type and name of environment:

```python
env_base = EnvBase('dev-projectX')
env_base.prefixed('my_resource', 'blue')  # 'dev-projectX-my_resource-blue'
```


### Collections

The `collections` module provides various collection classes and utilities for working with collections of data.
- Classes
  - **DeepChainMap**: A class for creating recursive capable deep chain maps.
  - **Tree**: A subclass of dict for creating tree structures from sequences.
  - **ValidatedStr**: A class for creating validated strings based on regex patterns.
- Mixins
  - **PostInitMixin**: A mixin class for handling post-initialization tasks.
  - **EnvBaseMixins**: A mixin class for handling environment-related tasks.
- Enums
  - **BaseEnum**: A base class for creating enums.
  - **OrderedEnum**: A base class for creating ordered enums.
  - **StrEnum**: A base class for creating string enums. 
  - **OrderedStrEnum**: A base class for creating ordered string enums.


## Contributing

Any and all PRs are welcome. Please see [CONTRIBUTING.md](CONTRIBUTING.md) for more information.

## Licensing

This software is licensed under the Allen Institute Software License, which is the 2-clause BSD license plus a third clause that prohibits redistribution and use for commercial purposes without further permission. For more information, please visit [Allen Institute Terms of Use](https://alleninstitute.org/terms-of-use/).
