Saravanan666/pypi-org huggingface dataset:
Package: colorconverters
A useful package which handles the utilities of converting colors to different forms.Notable FeaturesModern pythonic syntax.Easy utility to convert colors to hex and vice versa.Easilly installable via PyPI.Weekly major updates.InstallingRequires Python 3.6 or higher for desired results.The below codes show you how to install in various OSes# Windowspy-3-mpipinstall-Ucolorconverters# Linux/MacOSpython3-mpipinstall-UcolorconvertersIf you want to get beta and alpha versions, then install it this way instead.# Windowsgitclonehttps://github.com/ThatGenZGamer48/colorconverterscdcolorconverterspy-3-mpipinstall-U.# Linux/MacOSgitclonehttps://github.com/ThatGenZGamer48/colorconverterscdcolorconverterspython3-mpipinstall-U.Quick Exampleimportcolorconverters# To convert to hexcolorconverters.color_to_hex('red')# To convert to colorcolorconverters.hex_to_color('#FFFFFF')
Package: colorcorrect
colorcorrect
by Shunsuke Aihara -http://argmax.jpdate:February 2012description:Imprement some of color correction algorithmsrequire:python2.6 or later
numpy
Pillowinstall:% python setup.py build
% python setup.py installimpement algorithms:gray world
     colorcorrect.algorithm.gray_world
     usage: image
max white
    colorcorrect.algorithm.max_white
    usage: image
stretch
    colorcorrect.algorithm.stretch
    usage: image
retinex
    colorcorrect.algorithm.retinex
    usage: image
retinex with adjust
        colorcorrect.algorithm.retinex_with_adjust
        usage: image
standard deviation weighted grey world
         colorcorrect.algorithm.standard_deviation_weighted_grey_world
         usage: image,subblock width(default:20), subblock height(default:20)
standard deviation and luminance weighted gray world
         colorcorrect.algorithm.standard_deviation_and_luminance_weighted_gray_world
         usage: image,subblock width(default:20), subblock height(default:20)
luminance weighted gray world
          colorcorrect.algorithm.luminance_weighted_gray_world
         usage: image,subblock width(default:20), subblock height(default:20)
automatic color equalization
          colorcorrect.algorithm.automatic_color_equalization
          usage: image,slope(default:10),limit(default:1000)sample usage:>>> import Image
>>> import colorcorrect.algorithm as cca
>>> from colorcorrect.util import from_pil, to_pil
>>> img = Image.open('/path/to/image')
>>> to_pil(cca.stretch(from_pil(img))).show()References:Denis. Nikitenko, M. Wirth and K. Trudel, "Applicability Of White-Balancing Algorithms to Restoring Faded Colour Slides: An Empirical Evaluation.", Journal of Multimedia, vol. 3, no. 5, 2008.
HK. Lam, OC. Au and CW. Wong, "Automatic white balancing using luminance component and standard deviation of RGB components", in Proc. ICASSP, 2004.
A. Rizzi, C. Gatta and D. Marini, "A new algorithm for unsupervised global and local color correction.", Pattern Recognition Letters, vol. 24, no. 11, 2003.
Package: colorcorrectionML
ColorCorrectionMLColorCorrectionML is a Python package for color correction of images using machine learning. It uses ML regression methods (linear, least sqaure, and partial least squares regression) to learn the color correction function from a training image with a color checker. The learned function is then applied to correct the color of a test image.InstallationpipinstallcolorcorrectionMLUsagefromColorCorrectionMLimportColorCorrectionMLimportcv2img=cv2.imread('Images/img2.png')cc=ColorCorrectionML(img,chart='Classic',illuminant='D50')method='pls'# 'linear', 'lstsq', 'pls'# for linear regression, least square regression, and partial least square regression respectivelyshow=Truekwargs={'method':method,'degree':3,# degree of polynomial'interactions_only':False,# only interactions terms,'ncomp':10,# number of components for PLS only'max_iter':5000,# max iterations for PLS only'white_balance_mtd':0# 0: no white balance, 1: learningBasedWB, 2: simpleWB, 3: grayWorldWB,}M,patch_size=cc.compute_correction(show=show,**kwargs)# resize img by 2# img = cv2.resize(img, (0,0), fx=0.3, fy=0.3, interpolation=cv2.INTER_AREA)img_corr=cc.correct_img(img,show=True)# img_corr = cc.Parallel_correct_img(img, chunks_=50000, show=True)Example resultsScatter plot of the original image and the corrected image color valuesColor correction resultsTODOAdd other reference color values (D55, D65, D70, D75)Add other color charts (ColorChecker24, ColorCheckerSG, ColorCheckerDC)Add other color spaces (CIELab, XYZ, etc.)Add other regression methods (Ridge, Lasso, ElasticNet, etc.)Refine the white balance methods
Package: colorcountcython
This module provides functionality to count unique colors in an image represented as a NumPy array and, optionally, group their coordinates.Tested against Windows / Python 3.11 / Anacondapip install colorcountcythonThismoduleprovidesfunctionalitytocountuniquecolorsinanimagerepresentedasaNumPyarrayand,optionally,grouptheircoordinates.ItincludesaCython-basedimplementationforimprovedperformance.Functions:-colorcount(pic,coords=True,count=True):CounttheuniquecolorsinanimagerepresentedasaNumPyarray.If`coords`issettoTrue,italsogroupsthecoordinatesofeachcolor.InternalFunctions:-_dummyimport():InternalfunctiontochecktheavailabilityofCython.-searchallcolors(pic,totallengthpic,width,withcoords,withcount):Cythonfunctiontocountcolorsinanimageand,ifspecified,grouptheircoordinates.Parameters:-pic(ndarray):TheinputimagerepresentedasaNumPyarray.-coords(bool):IfTrue,thefunctionwillreturnthecoordinatesofeachuniquecolor.-count(bool):IfTrue,thefunctionwillreturnthecountofeachuniquecolor.Returns:Adictionarycontaininguniquecolorinformation.If`coords`isTrue,itincludesthecoordinatesofeachcolor.If`count`isTrue,itincludesthecountofeachcolor.Note:The`colorcount`functiontakesanimageasinputandreturnsadictionarycontainingcolorcountsand,ifspecified,colorcoordinates.TheCython-basedimplementationinthismoduleenhancestheperformanceofcolorcounting.Example:froma_cv_imwrite_imread_plusimportopen_image_in_cvfromcolorcountcythonimportcolorcountb=open_image_in_cv('c:\\tetetete.png')d=colorcount(pic=b,coords=True,count=True)print(d)
Package: color-crafter-py
🎨 Color Crafter Py🚨 ⚠️ 🚧ATTENTION PLEASE🚧 ⚠️ 🚨This is my first Python project and is still in early development. Wait for new versions to test it. Or test it at your own risk. I'm still studyingPythonand I'm not responsible for instabilities.🚀 Introduction🎨Color Crafter Pyis a versatilePythonlibrary designed for effortlessly infusing colors, styles, and custom RGB hues into text displayed on your terminal. It's a user-friendly, low-dependency package that simplifies the process of printing colorful and stylish text in the terminal. Whether you're looking to highlight important information, create visually appealing output, or add a creative flair to your scripts and applications, Color Crafter Py has you covered.🗝 Key Features:🖌 Easily customize text with a wide range of colors, including custom full RGB values.*🖌🎨 Has a set of predefined colors.🖌🎨 Accepts 8-bit colors.🖌🎨 Accepts 24-bit colors.🖌🎨 Accepts HEX format colors.📝 Apply various text styles, such as bold, italic, and more.🖼 Foreground and background colors for your text.❗Highlight specific text elements to enhance information visibility.🖥 Compatible with Unix, Windows, and other popular systems.Elevate your CLI experience with Color Crafter Py and inject a burst of vibrancy and style into your terminal interactions!🚀 Getting StartedInstall it from PyPIpipinstallcolor_crafter_pyUsagefromcolor_crafter_pyimportBaseClassfromcolor_crafter_pyimportbase_functionBaseClass().base_method()base_function()DevelopmentRead theCONTRIBUTING.mdfile.Notes*Not every terminal supports all of the colors available. The package was developed for in Linux using ZSH and BASH terminals.LicenseRead theLICENSE.mdfile.color_crafter_py created by🧔🏼‍♂️ WernerLuiz92
Package: color-craftsman
Color-CraftsmanDescriptionColor-Craftsman creates perceptually-distinct color palettes for data visualization in Python. While many great plotting libaries exist, they often rely on fixed color palettes and generally have few colors. These colors often conflict with one another. Color-Craftsman allows users to create a palette of colors that are perceptually distinct from one another. This allows for more colors to be used in a plot without sacrificing readability.Installationpipinstallcolor-craftsmanUsageSimple examples are shown below. For more examples, see theexamplesdirectory.Creating a Random Paletteimportcolor_craftsmanascc# Create a palette with 5 colorspalette=cc.generate_palette(5,min_dist=30,seed=11,output_format="rgb",)cc.visualize_palette(palette,show=True)Note:a random seed can be provided to ensure reproducibility. Distance is the distance between colors in the palette. A larger distance will result in more distinct colors. If the distance is too large, a warning message will be displayed. Too large of distances can result in colors that are too similar to each other due to clipping in the RGB color space. Distance is defined as the Delta-E color difference between colors in the palette.Creating a Palette from a Base Paletteimportcolor_craftsmanascc# Create a palette with 10 total colorsextended_palette=cc.extend_palette([np.array([153,191,80]),np.array([107,88,11]),np.array([42,19,119]),np.array([93,110,244]),np.array([213,114,236]),],10,min_dist=10,seed=18,palette_format="rgb",output_format="rgb",)cc.visualize_palette(extended_palette,show=True)Visualizing a Paletteimportcolor_craftsmanascccc.visualize_palette(palette,show=True)Colorblind-Safe PalettesTo guard against deutranopia, protanopia, and tritanopia, use thecolorblind_safeparameter.palette=cc.generate_palette(5,min_dist=30,seed=22,output_format="rgb",colorblind_safe=True,)cc.visualize_palette(extended_palette,show=True)Specific Colorblindness-Safe PalettesIf you want to guard against specific-forms of colorblindness, you can specify the type of colorblindness using the following arguments:deuteranomaly_safe,protanomaly_safe, andtritanomaly_safe.Deuteranopia-Safe Palettepalette=cc.generate_palette(5,min_dist=30,seed=33,output_format="rgb",deuteranomaly_safe=True,)cc.visualize_palette(palette,show=True)Protanopia-Safe Palettepalette=cc.generate_palette(5,min_dist=30,seed=44,output_format="rgb",protanomaly_safe=True,)cc.visualize_palette(palette,show=True)Tritanopia-Safe Palettepalette=cc.generate_palette(5,min_dist=30,seed=55,output_format="rgb",tritanomaly_safe=True,)cc.visualize_palette(palette,show=True)ContributingContributions are welcome! If you'd like to contribute to the project, please follow these guidelines:Fork the repository.Create a new branch.Make your changes.Test your changes thoroughly.Submit a pull request.Add caharper as a reviewer.Please ensure your code adheres to the project's coding style and conventions.LicenseThis project is licensed under theMIT License.ContactIf you have any questions, suggestions, or feedback, feel free to reach out:Email:caharper@smu.eduGitHub:caharper
Package: colord
ColordExecutive summaryPython package which allows you to print colored text & colored words.You need to setup lists with colored words & all words in lists will be printed in color of that list.Installationpip3 install colordUsagein printc function can be used argumets: delay, skipline.delay : delay between next letter will be printedskipline = True : will skip line after text is printedExampleimport colord

colord.setlist.magenta(['test'])
colord.setlist.green(['test2','test3'])
colord.setlist.red(['test4'])

colord.printc('testtest2test4test3')

colord.printc('testtest2test4test3',delay=0.03)

colord.printc('testtest2test4test3',delay=0.03,skipline=True)
Package: colordet2
ColorDetectorProject descriptionColorDetector is a library for exporting colors from a photo. It supports images in .jpg, .jpeg and .png format. Colors are represented in hex and rgb format. Depending on the parameter specified by the user, it can output from 3 to 25 different colors.Runningimport ColorDetectorcd = ColorDetector("filepath")cd.palete(n)Functions and variablesColorDetector(path)- class with oneinitvairable, path to image: strself.palete(n)- extract n colors from image, n must be int in range <3:25>Testspython3 -m pytest TestColorDetector.py -vProject authorJakub Zalewski
Package: color-detection-jdla
Color detection with OpenCVPython module for detecting the color of a OpenCV frame.Installation>pipinstalljdla-color-detectionUsagefromcolor_detection.detectimportMaskimportnumpyasnpimportcv2# Get dominant colorimage=cv2.imread("img/blue.jpg")color=Mask.detect_dominant(image)print(color)# Detect colormy_mask=Mask("Blue",[90,60,0],[121,255,255])detected_mask=Mask.detect(color,[my_mask])print(detected_mask.name)ContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.AcknowledgmentsThis module usesColorThieffor grabbing the most dominant color of a contour.
Package: colordiffs
Colors for your git diffsColordiffs is under development, things are bound to be broken.
If you would like to help out, start an issue or submit a pull request :)Installationpip install colordiffsHow to rungit diff HEAD^ | colordiffs | less -rexplanationgit diff HEAD^gets a diff between the current and the previous commitcolordiffsreads a diff from stdinless-rtakes the output of colordiffs and useslessto page it, the-ris required to interpret the terminal escape codesRequirementsPython 2.x, 3.x
PygmentsTODOSupport more kinds ofgit diffoutput. Right not it supports the most common—+++diffs, but if the diff is for a new file or deletion of file it breaks.
Package: colordithering
A package to color text with ANSI escape codes, but takes in an RGB value and uses dithering to try match it.The colorize_text function accepts a string and a RGB tuple. It returns the colorized string.
To see the package in use you can try the run_example function.Example usage:importcolorditheringtext='''█████████████████████████████████████████████ Hello World! ██████████████████████████████████████████████'''color=(255,125,0)# orange colorprint(colordithering.colorize_text(text,color))Thereturn_arrayparameter of colorize_text will return a 2D array of each character rather than a string. The values in each cell will be a dict, with the keystextandcolor.
Text will be the character. Color will be the ANSI escape code.Example usage with return_array:importcolorditheringtext='''█████████████████████████████████████████████ Hello World! ██████████████████████████████████████████████'''color=(255,125,0)# orange colorcolorized=colordithering.colorize_text(text,color,True)# set return_array to Trueforyinrange(len(colorized)):forxinrange(len(colorized[y])):character_at_cell=colorized[y][x]["text"]color_at_cell=colorized[y][x]["color"]print(color_at_cell+character_at_cell,end="")# print the ANSI escape code first to set the color, then the character.# the end="" makes it so python doesn't print a new line automaticallyprint()# new line
Package: colored
AboutColored, it's a simple Python library for color and formatting in terminal.
Collection of color codes and names for 256 color terminal setups.
Colored now supports RGB color mode. As "true color" graphic cards with 16 to24 bitsof color became common,
applications began to support 24-bit colors. Terminal emulators supporting setting 24-bit foreground and background
colors with escape sequences include Xterm, KDE'sKonsole, and iTerm, as well as all libvte based terminals,
includingGNOME Terminal.The colors work with most terminals and terminals emulators.ANSI/VT100 escape sequencescan be used in every programming languages.Colored is powerful and easy to use:>>>fromcoloredimportFore,Back,Style>>>>>>Fore.red'\x1b[38;5;1m'>>>>>>Back.red'\x1b[48;5;1m'>>>>>>Style.reset'\x1b[0m'>>>>>>Fore.rgb('100%','50%','30%')'\x1b[38;2;255;130;79m'>>>>>>print(f'{Fore.white}{Back.green}Colored is Awesome!!!{Style.reset}')!!! success>>>Colored is Awesome!!!InstallingOpen up a terminal and install colored withpipcommand:$pipinstallcoloredAlternatively, you can grab the latest source code fromGitLab:$gitclonehttps://gitlab.com/dslackw/colored.git
$cdcolored
$pipinstall.UsageTheUser Guideis the place to go to learn how to use the library.TheAPI Referencedocumentation provides API-level documentation.Licensecolored is made available under the MIT License. For more details, seehere.Contributing!!! info
We happily welcomecontributions!DonateDid you know that we developers love coffee?
Package: colored-arnoux-rauzy-sequences
This package was created to demonstrate results in the paper
of Lubomira Dvorakova and Jana Lepsova with the name
Critical exponent of Arnoux-Rauzy sequences.The algorithm computes the asymptotical critical exponent
of regular d-ary Arnoux-Rauzy sequence for any dimension d.In the examples we compute the asymptotical critical exponent (ACE)
of the Tribonacci word (d = 3).
==================EXAMPLES:sage: from colored_arnoux_rauzy_sequences.ARsequence import ArnouxRauzySubstitutiveSequence
sage: word = ArnouxRauzySubstitutiveSequence(3,[],[1])
sage: ACE = word.asymptotic_critical_exponent()
sage: ACE
1/2*Lambda^2 + 3/2
sage: ACE.n()
3.19148788395312colored_arnoux_rauzy_sequencespackage
Package: coloredlog
Colorize your console output.ProvidesConsoleHandler()for working withloggingmodule to get colored logging message.Usage Example1. Colorize your logging output# you can just do `from colorlog import *`importlogging,coloredloglogging.basicConfig(format='%(asctime)s%(filename)s:%(lineno)d[%(levelname)s]%(message)s',handlers=[coloredlog.ConsoleHandler()],level=logging.DEBUG)logger=logging.getLogger(__name__)logger.info('logging started')logger.debug('debug message')logger.info('informative')logger.log(coloredlog.NOTIFY,'notification')logger.warning('a warning message')logger.error('message on error occurred')try:raiseRuntimeError('An exception!')except:logger.exception('Exception:')logger.critical('THIS IS CRITICAL')Result on Windows 102. Decorate your normal messagefromcoloredlog.colorimport*print(deco('Hello, ',0x011,bold=True)+reset()+'world!')print(deco('Hello, ',reverse=True)+reset()+'world!')print(deco('Hello, ',FG_BLUE,bold=True)+reset()+'world!')print(deco('Hello, ',FG_YELLOW,BG_GREEN,bold=True)+reset()+'world!')print(deco('Hello, ',FG_MAGENTA,bold=True)+reset()+'w...')# Simple convenience functionswarning("emmm, seems there is a small proble...")error('Unknown error!')For more information on parameter rules for deco( ), please refer to the docstring.Result on Windows 103. Forintensiveuse caseSince a complete run-through ofdeco()can be a bit time-consuming under intensive use case, you may consider method below to speed up the operation ofdeco()fromcoloredlog.colorimport*const_deco=deco('',FG_BLUE,BG_WHITE,bold=True)# simulates intensive use caseforiinrange(10):print(deco('Hello world for{}times'.format(i),const_deco=const_deco))# `deco()` will return immediatelyprint(reset())# reset to normal colorResult on Windows 10Tested onWindows 10 (python 3.6)Ubuntu 16.4.1 (python 3.5)
Package: coloredlogger
Colored Logger for Python that uses clorama for colorful output with timestamp
and customizable format. Colored Logger has timestamp, colored header or full line,
and custom time formatColored Logger for Python that uses clorama for colorful output with timestamp and customizable formatSetupUsepipinstallcoloredloggerto install using pip or
use source code and install requirements withpipinstall-rrequirements.txtget a logger with:fromcoloredloggerimportColoredLoggerlogger=ColoredLogger(name=OPTIONAL_LOGGER_NAME)or get logger with optional config name and configimportcoloredloggerlogger=coloredlogger.get_logger(name=OPTIONAL_LOGGER_NAME,OPTIONAL_CONFIG_LIST)log using pre-setup methods:logger.wtf('WTF??')logger.error('Omg red as rose error')logger.success('Such success much green wow')logger.info('just a blue info')logger.verbose('some log here')And you should see:or make your own log method using a name prefix color level and whether only
header will be colored or the whole line:logger.add_config('my-log',{'prefix':"ROCK!",'color':ColoredLogger.COLORS.CYAN,'header-only':True})logger.log('my-log','YOU!')logger.log('my-log','ALL!')logger.log('my-log','test','with','at','symbols',sep='@')And you should see:You can also overwrite previous configs by:logger.add_config('error',{'prefix':'Custom error with {{TIME}}: ','timestamp':'[%Hh:%Mm:%Ss]','header-only':True})This will overwriteerrorconfig’s properties with given ones which
areprefix,timestampandheader-onlyAdding a new config using logger name and init configs is done as in following:logger=get_logger('MY LOG',[{'config_name':'custom-log','config':{'timestamp':'%Y/%m/%d%H:%M:%S'}}])logger.info('This should have [MY LOG] [?] as prefix')logger.success('This should have [MY LOG] [+] as prefix')logger.verbose('Yeey')logger.log('custom-log','This custom log should have overwritten timestamp')Config objectAll keys are optional and if not given will be overridden by defaults{'level':10,# integer'timestamp':'%Y-%m-%d%H:%M:%S',# timestamp format used with strftime'prefix':'[ ]',# prefix which can include {{TIME}} to put timestamp with'color':coloredlogger.COLORS.WHITE,# one of coloredlogger.COLORS'header-only':False# whether or not color whole line or just header}COLORS ObjectFollowing colors are supported:Normal:BLACK, BLUE, CYAN, GREEN, MAGENTA, RED, WHITE, YELLOWLight:LIGHTBLACK_EX, LIGHTBLUE_EX, LIGHTCYAN_EX, LIGHTGREEN_EX, LIGHTMAGENTA_EX, LIGHTRED_EX, LIGHTWHITE_EX, LIGHTYELLOW_EX
Package: colored-logs
colored_logsInstallpipinstallcolored-logsorpip3installcolored-logsFeaturesPrint different types of logs(info, success, fail, warning, error, critical, subtle)Add custom color for each type of log(both foreground and background. Defaults to thesecolors)Can Provide colors in RGB, HEX, HSV, HSL, or CMYKMark logs with custom ids(optional, defaults to no id)Show type for every log(optional, defaults to True)Show time of logging for every log(optional, defaults to True)Change logging env to html(defaults to Console. In html it appears likethis)Log async taskUsageimporttimefromcolored_logs.loggerimportLogger,LogType#, LogEnvironmeentlog=Logger(ID='Test-id-1'# environment=LogEnvironmeent.HTML,  # Override to print html logs# console_line_char_len=90           # Optionally provide how many chars does fir in one consolee line)log.info('This is an info log')time.sleep(0.5)log.ID='Test-id-2'log.info('This is an info log with a new id')log.ID='Test-id-1'time.sleep(0.5)log.success('This is a success log')time.sleep(0.5)log.warning('This is a warning log')time.sleep(0.5)log.error('This is an error log')time.sleep(0.5)log.fail('This is a fail log')time.sleep(0.5)log.critical('This is a critical log')time.sleep(1)log.start_process('This will take a while')time.sleep(3.5)log.info('This is an info log while also logging the active process')time.sleep(3.5)duration_float_seconds=log.stop_process(log_type=LogType.Success,values='Successfully finished task')In actionCreditThis package was inspired bycolored, which is maintained bydslackw
Package: coloredterm
ColoredTermColoredterm is a collection of functions to help you make text in your terminal a different color.With fg, bg, Fore, Back, Style, colored and cprint functions.Getting startedInstallingTo install the package you will need python3.6 or higher and pip installed.With those installed you can start.To install it go to your terminal and put in this command:pipinstallcoloredtermOr you can download it from github.
You can do that with:pipinstallgit+https://github.com/hostedposted/coloredterm.gitUsageHere is a quick example:fromcoloredtermimportFore,Back# Importing The Fore and Back class from coloredterm.print(f"{Fore.BLUE}{Back.YELLOW}Foreground of Blue Background of yellow.")# Printing text with a Foreground of Blue and Background of Yellow.For more please go to thedocumentation.