Skip to main content

Color scheme manager package for your projects

Project description

csmpy

The csmpy python package (color scheme manager) for your projects enabling customization and management of color schemes.

Installation

Install the package:

With pip or pip3

pip install csmpy

Add it to your requirements.txt file:

csmpy>=<version>

Now you can install it by running:

pip install -r requirements.txt

Usage

Feel free to customize the variable name according to your preference!

Without YAML file

from csmpy import ColorSchemeManager

# Define values (required)
DEFAULT_COLORS = {
    'logo': 'red',
    'text': 'blue',
    'result': 'light_white',
}

# Load all colors
all_colors = ColorSchemeManager.load_colors(DEFAULT_COLORS)

# Example usage
logo_color = all_colors['logo']
text_color = all_colors['text']
result_color = all_colors['result']

print(f"This is a {logo_color} example of {text_color} using {result_color} colors.")

With a YAML file

from csmpy import ColorSchemeManager

# Define values (required)
DEFAULT_COLORS = {
    'logo': 'red',
    'text': 'blue',
    'result': 'light_white',
}

# Load custom colors from a YAML file
custom_colors = ColorSchemeManager.load_custom_yaml_file('examples/custom_settings.yaml')

# Merge default and custom colors
all_colors = ColorSchemeManager.load_colors(DEFAULT_COLORS, custom_colors)

# Example usage
logo_color = all_colors['logo']
text_color = all_colors['text']
result_color = all_colors['result']

print(f"This is a {logo_color} example of {text_color} using {result_color} colors.")

Both of these examples can be found in the examples folder.

License

The source code is released under the MIT 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

csmpy-0.2.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

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

csmpy-0.2-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file csmpy-0.2.tar.gz.

File metadata

  • Download URL: csmpy-0.2.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.10

File hashes

Hashes for csmpy-0.2.tar.gz
Algorithm Hash digest
SHA256 f87385c64cefb9319e357e5cf9f0818907f8ddae4336c06f4b0953558a1ef9a7
MD5 deeca29d3e7ce4e06e9d783c759123f0
BLAKE2b-256 a73c78f8385a3dcc6d4ac0a13778ddf0d8f2c2f97008d849446529fe44d12903

See more details on using hashes here.

File details

Details for the file csmpy-0.2-py3-none-any.whl.

File metadata

  • Download URL: csmpy-0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.10

File hashes

Hashes for csmpy-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 064e312d14397ea72f986960781ea19aa5e1315f4d6e8ea5e91a653bc53f806c
MD5 10e8b71b7d9370947db472ead5a7769d
BLAKE2b-256 4c0164f5c321e6253f69a05311440ee739a9c6a13dabb294885db5712d3c190b

See more details on using hashes here.

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