Skip to main content

Shared functionality for the calcipy-ecosystem

Project description

corallium

CLI utility functions extracted from Calcipy.

Installation

  1. poetry add corallium

  2. Take advantage of the logger or other common functionality

    form corallium.log import LOGGER
    
    LOGGER.info('Hello!')
    

Usage

  • log: Configure and use the global logger

    from corallium.log import LOGGER, configure_logger
    import logging
    
    configure_logger(log_level=logging.INFO)
    LOGGER.info('Processing started', item_count=42)
    
  • pretty_process: Run parallel tasks with progress bars

    from corallium.pretty_process import pretty_process
    
    
    def task(task_id, shared_progress, data):
        for item in data:
            process(item)
            shared_progress[task_id] += 1
        return len(data)
    
    
    results = pretty_process(task, data=items, num_workers=4)
    
  • shell: Execute shell commands with output capture

    from corallium.shell import capture_shell
    
    output = capture_shell('git status', timeout=30)
    
  • file_helpers: File utilities and project configuration

    from corallium.file_helpers import find_in_parents, read_pyproject
    
    pyproject = read_pyproject()
    lock_path = find_in_parents(name='uv.lock')
    
  • tomllib: Backport wrapper for TOML parsing (Python <3.11 compatibility)

    from corallium.tomllib import tomllib
    
    data = tomllib.loads(content)
    
  • dot_dict: Wrapper for dotted-dictionary access via Python-Box

    from corallium.dot_dict import ddict
    
    config = ddict({'nested': {'value': 42}})
    print(config.nested.value)
    

For more example code, see the scripts directory or the tests.

Project Status

See the Open Issues and/or the CODE_TAG_SUMMARY. For release history, see the CHANGELOG.

Contributing

We welcome pull requests! For your pull request to be accepted smoothly, we suggest that you first open a GitHub issue to discuss your idea. For resources on getting started with the code base, see the below documentation:

Code of Conduct

We follow the Contributor Covenant Code of Conduct.

Open Source Status

We try to reasonably meet most aspects of the "OpenSSF scorecard" from Open Source Insights

Responsible Disclosure

If you have any security issue to report, please contact the project maintainers privately. You can reach us at dev.act.kyle@gmail.com.

License

LICENSE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

corallium-2.3.0rc0.tar.gz (27.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

corallium-2.3.0rc0-py3-none-any.whl (31.9 kB view details)

Uploaded Python 3

File details

Details for the file corallium-2.3.0rc0.tar.gz.

File metadata

  • Download URL: corallium-2.3.0rc0.tar.gz
  • Upload date:
  • Size: 27.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for corallium-2.3.0rc0.tar.gz
Algorithm Hash digest
SHA256 6cc512ea1e06e481b152224e753e2869049f6c147abc0c6170d39119179c0344
MD5 5ebe7ce5b36b250e6450bb567d302375
BLAKE2b-256 78b74ddd74abcc9a4dd93aeb7fb8a00ad8976379c1c819055d2db11777b1b622

See more details on using hashes here.

Provenance

The following attestation bundles were made for corallium-2.3.0rc0.tar.gz:

Publisher: publish.yml on KyleKing/corallium

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file corallium-2.3.0rc0-py3-none-any.whl.

File metadata

  • Download URL: corallium-2.3.0rc0-py3-none-any.whl
  • Upload date:
  • Size: 31.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for corallium-2.3.0rc0-py3-none-any.whl
Algorithm Hash digest
SHA256 061e7d8c68576f31f45409d22e413079a4f83fa57c7dde42bf911558a5902071
MD5 499aa1d8929b130f182f93c5b3a7ab76
BLAKE2b-256 5af9d00a34890d080cbcdf5f77be87540e54fb0ab082da0385ebc7c33b51ac0b

See more details on using hashes here.

Provenance

The following attestation bundles were made for corallium-2.3.0rc0-py3-none-any.whl:

Publisher: publish.yml on KyleKing/corallium

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page