Pampy: The Pattern Matching for Python you always dreamed of.

Overview

Pampy in Star Wars

Pampy: Pattern Matching for Python

License MIT Travis-CI Status Coverage Status PyPI version

Pampy is pretty small (150 lines), reasonably fast, and often makes your code more readable and hence easier to reason about. There is also a JavaScript version, called Pampy.js.

You can write many patterns

Patterns are evaluated in the order they appear.

You can write Fibonacci

The operator _ means "any other case I didn't think of".

from pampy import match, _

def fibonacci(n):
    return match(n,
        1, 1,
        2, 1,
        _, lambda x: fibonacci(x-1) + fibonacci(x-2)
    )

You can write a Lisp calculator in 5 lines

from pampy import match, REST, _

def lisp(exp):
    return match(exp,
        int,                lambda x: x,
        callable,           lambda x: x,
        (callable, REST),   lambda f, rest: f(*map(lisp, rest)),
        tuple,              lambda t: list(map(lisp, t)),
    )

plus = lambda a, b: a + b
minus = lambda a, b: a - b
from functools import reduce

lisp((plus, 1, 2))                 	# => 3
lisp((plus, 1, (minus, 4, 2)))     	# => 3
lisp((reduce, plus, (range, 10)))       # => 45

You can match so many things!

match(x,
    3,              "this matches the number 3",

    int,            "matches any integer",

    (str, int),     lambda a, b: "a tuple (a, b) you can use in a function",

    [1, 2, _],      "any list of 3 elements that begins with [1, 2]",

    {'x': _},       "any dict with a key 'x' and any value associated",

    _,              "anything else"
)

You can match [HEAD, TAIL]

from pampy import match, HEAD, TAIL, _

x = [1, 2, 3]

match(x, [1, TAIL],     lambda t: t)            # => [2, 3]

match(x, [HEAD, TAIL],  lambda h, t: (h, t))    # => (1, [2, 3])

TAIL and REST actually mean the same thing.

You can nest lists and tuples

from pampy import match, _

x = [1, [2, 3], 4]

match(x, [1, [_, 3], _], lambda a, b: [1, [a, 3], b])           # => [1, [2, 3], 4]

You can nest dicts. And you can use _ as key!

pet = { 'type': 'dog', 'details': { 'age': 3 } }

match(pet, { 'details': { 'age': _ } }, lambda age: age)        # => 3

match(pet, { _ : { 'age': _ } },        lambda a, b: (a, b))    # => ('details', 3)

It feels like putting multiple _ inside dicts shouldn't work. Isn't ordering in dicts not guaranteed ? But it does because in Python 3.7, dict maintains insertion key order by default

You can match class hierarchies

class Pet:          pass
class Dog(Pet):     pass
class Cat(Pet):     pass
class Hamster(Pet): pass

def what_is(x):
    return match(x,
        Dog, 		'dog',
        Cat, 		'cat',
        Pet, 		'any other pet',
          _, 		'this is not a pet at all',
    )

what_is(Cat())      # => 'cat'
what_is(Dog())      # => 'dog'
what_is(Hamster())  # => 'any other pet'
what_is(Pet())      # => 'any other pet'
what_is(42)         # => 'this is not a pet at all'

Using Dataclasses

Pampy supports Python 3.7 dataclasses. You can pass the operator _ as arguments and it will match those fields.

@dataclass
class Pet:
    name: str
    age: int

pet = Pet('rover', 7)

match(pet, Pet('rover', _), lambda age: age)                    # => 7
match(pet, Pet(_, 7), lambda name: name)                        # => 'rover'
match(pet, Pet(_, _), lambda name, age: (name, age))            # => ('rover', 7)

Using typing

Pampy supports typing annotations.

class Pet:          pass
class Dog(Pet):     pass
class Cat(Pet):     pass
class Hamster(Pet): pass

timestamp = NewType("year", Union[int, float])

def annotated(a: Tuple[int, float], b: str, c: E) -> timestamp:
    pass

match((1, 2), Tuple[int, int], lambda a, b: (a, b))             # => (1, 2)
match(1, Union[str, int], lambda x: x)                          # => 1
match('a', Union[str, int], lambda x: x)                        # => 'a'
match('a', Optional[str], lambda x: x)                          # => 'a'
match(None, Optional[str], lambda x: x)                         # => None
match(Pet, Type[Pet], lambda x: x)                              # => Pet
match(Cat, Type[Pet], lambda x: x)                              # => Cat
match(Dog, Any, lambda x: x)                                    # => Dog
match(Dog, Type[Any], lambda x: x)                              # => Dog
match(15, timestamp, lambda x: x)                               # => 15
match(10.0, timestamp, lambda x: x)                             # => 10.0
match([1, 2, 3], List[int], lambda x: x)                        # => [1, 2, 3]
match({'a': 1, 'b': 2}, Dict[str, int], lambda x: x)            # => {'a': 1, 'b': 2}
match(annotated, 
    Callable[[Tuple[int, float], str, Pet], timestamp], lambda x: x
)                                                               # => annotated

For iterable generics actual type of value is guessed based on the first element.

match([1, 2, 3], List[int], lambda x: x)                        # => [1, 2, 3]
match([1, "b", "a"], List[int], lambda x: x)                    # => [1, "b", "a"]
match(["a", "b", "c"], List[int], lambda x: x)                  # raises MatchError
match(["a", "b", "c"], List[Union[str, int]], lambda x: x)      # ["a", "b", "c"]

match({"a": 1, "b": 2}, Dict[str, int], lambda x: x)            # {"a": 1, "b": 2}
match({"a": 1, "b": "dog"}, Dict[str, int], lambda x: x)        # {"a": 1, "b": "dog"}
match({"a": 1, 1: 2}, Dict[str, int], lambda x: x)              # {"a": 1, 1: 2}
match({2: 1, 1: 2}, Dict[str, int], lambda x: x)                # raises MatchError
match({2: 1, 1: 2}, Dict[Union[str, int], int], lambda x: x)    # {2: 1, 1: 2}

Iterable generics also match with any of their subtypes.

match([1, 2, 3], Iterable[int], lambda x: x)                     # => [1, 2, 3]
match({1, 2, 3}, Iterable[int], lambda x: x)                     # => {1, 2, 3}
match(range(10), Iterable[int], lambda x: x)                     # => range(10)

match([1, 2, 3], List[int], lambda x: x)                         # => [1, 2, 3]
match({1, 2, 3}, List[int], lambda x: x)                         # => raises MatchError
match(range(10), List[int], lambda x: x)                         # => raises MatchError

match([1, 2, 3], Set[int], lambda x: x)                          # => raises MatchError
match({1, 2, 3}, Set[int], lambda x: x)                          # => {1, 2, 3}
match(range(10), Set[int], lambda x: x)                          # => raises MatchError

For Callable any arg without annotation treated as Any.

def annotated(a: int, b: int) -> float:
    pass
    
def not_annotated(a, b):
    pass
    
def partially_annotated(a, b: float):
    pass

match(annotated, Callable[[int, int], float], lambda x: x)     # => annotated
match(not_annotated, Callable[[int, int], float], lambda x: x) # => raises MatchError
match(not_annotated, Callable[[Any, Any], Any], lambda x: x)   # => not_annotated
match(annotated, Callable[[Any, Any], Any], lambda x: x)       # => raises MatchError
match(partially_annotated, 
    Callable[[Any, float], Any], lambda x: x
)                                                              # => partially_annotated

TypeVar is not supported.

All the things you can match

As Pattern you can use any Python type, any class, or any Python value.

The operator _ and built-in types like int or str, extract variables that are passed to functions.

Types and Classes are matched via instanceof(value, pattern).

Iterable Patterns match recursively through all their elements. The same goes for dictionaries.

Pattern Example What it means Matched Example Arguments Passed to function NOT Matched Example
"hello" only the string "hello" matches "hello" nothing any other value
None only None None nothing any other value
int Any integer 42 42 any other value
float Any float number 2.35 2.35 any other value
str Any string "hello" "hello" any other value
tuple Any tuple (1, 2) (1, 2) any other value
list Any list [1, 2] [1, 2] any other value
MyClass Any instance of MyClass. And any object that extends MyClass. MyClass() that instance any other object
_ Any object (even None) that value
ANY The same as _ that value
(int, int) A tuple made of any two integers (1, 2) 1 and 2 (True, False)
[1, 2, _] A list that starts with 1, 2 and ends with any value [1, 2, 3] 3 [1, 2, 3, 4]
[1, 2, TAIL] A list that start with 1, 2 and ends with any sequence [1, 2, 3, 4] [3, 4] [1, 7, 7, 7]
{'type':'dog', age: _ } Any dict with type: "dog" and with an age {"type":"dog", "age": 3} 3 {"type":"cat", "age":2}
{'type':'dog', age: int } Any dict with type: "dog" and with an int age {"type":"dog", "age": 3} 3 {"type":"dog", "age":2.3}
re.compile('(\w+)-(\w+)-cat$') Any string that matches that regular expression expr "my-fuffy-cat" "my" and "puffy" "fuffy-dog"
Pet(name=_, age=7) Any Pet dataclass with age == 7 Pet('rover', 7) ['rover'] Pet('rover', 8)
Any The same as _ that value
Union[int, float, None] Any integer or float number or None 2.35 2.35 any other value
Optional[int] The same as Union[int, None] 2 2 any other value
Type[MyClass] Any subclass of MyClass. And any class that extends MyClass. MyClass that class any other object
Callable[[int], float] Any callable with exactly that signature def a(q:int) -> float: ... that function def a(q) -> float: ...
Tuple[MyClass, int, float] The same as (MyClass, int, float)
Mapping[str, int] Any subtype of Mapping acceptable too any mapping or subtype of mapping with string keys and integer values {'a': 2, 'b': 3} that dict {'a': 'b', 'b': 'c'}
Iterable[int] Any subtype of Iterable acceptable too any iterable or subtype of iterable with integer values range(10) and [1, 2, 3] that iterable ['a', 'b', 'v']

Using default

By default match() is strict. If no pattern matches, it raises a MatchError.

You can instead provide a fallback value using default to be used when nothing matches.

>>> match([1, 2], [1, 2, 3], "whatever")
MatchError: '_' not provided. This case is not handled: [1, 2]

>>> match([1, 2], [1, 2, 3], "whatever", default=False)
False

Using Regular Expressions

Pampy supports Python's Regex. You can pass a compiled regex as pattern, and Pampy is going to run patter.search(), and then pass to the action function the result of .groups().

def what_is(pet):
    return match(pet,
        re.compile('(\w+)-(\w+)-cat$'),     lambda name, my: 'cat '+name,
        re.compile('(\w+)-(\w+)-dog$'),     lambda name, my: 'dog '+name,
        _,                                  "something else"
    )

what_is('fuffy-my-dog')     # => 'dog fuffy'
what_is('puffy-her-dog')    # => 'dog puffy'
what_is('carla-your-cat')   # => 'cat carla'
what_is('roger-my-hamster') # => 'something else'

Install for Python3

Pampy works in Python >= 3.6 Because dict matching can work only in the latest Pythons.

To install it:

$ pip install pampy

or $ pip3 install pampy

If you really must use Python2

Pampy is Python3-first, but you can use most of its features in Python2 via this backport by Manuel Barkhau:

pip install backports.pampy

from backports.pampy import match, HEAD, TAIL, _
Comments
  • python 2 support

    python 2 support

    hi there, thanks for writing pampy and it looks very interesting. at the moment, only python2 is possible in my work environment, may I ask if there is chance we can have this backport to python2? thanks

    opened by haoxian-zhao 12
  • "Type Dict cannot be instantiated" error when executing code line from readme

    I get this error when i try to match a Dict[str, int] :

    I cant find any imports for Dict but assumed it was from typing?

    In [1]: from pampy import match, _
    
    In [2]: from typing import Dict
    
    In [3]: match({"a": 1, "b": 2}, Dict[str, int], lambda x: x)
    ---------------------------------------------------------------------------
    TypeError                                 Traceback (most recent call last)
    <ipython-input-3-e5c0ae675d5a> in <module>
    ----> 1 match({"a": 1, "b": 2}, Dict[str, int], lambda x: x)
    
    ~/.virtualenvs/sqlparse/lib/python3.7/site-packages/pampy/pampy.py in match(var, default, strict, *args)
        176
        177     for patt, action in pairs:
    --> 178         matched_as_value, args = match_value(patt, var)
        179
        180         if matched_as_value:
    
    ~/.virtualenvs/sqlparse/lib/python3.7/site-packages/pampy/pampy.py in match_value(pattern, value)
         45         return match_dict(pattern, value)
         46     elif callable(pattern):
    ---> 47         return_value = pattern(value)
         48         if return_value is True:
         49             return True, [value]
    
    /usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/typing.py in __call__(self, *args, **kwargs)
        666     def __call__(self, *args, **kwargs):
        667         if not self._inst:
    --> 668             raise TypeError(f"Type {self._name} cannot be instantiated; "
        669                             f"use {self._name.lower()}() instead")
        670         result = self.__origin__(*args, **kwargs)
    
    TypeError: Type Dict cannot be instantiated; use dict() instead
    
    opened by jn73 7
  • Interactive demo for `pampy` code examples

    Interactive demo for `pampy` code examples

    Hello @santinic,

    I'm following pampy since a few weeks and I really like what you guys have built. The concept is really cool, and it's incredible how simple your solution was. We've even started using it to teach our students at https://rmotr.com/ (co-founder and teacher here).

    While looking at the code examples in the README file I thought it would be great to provide some interactive demo that people can use to play with the library before committing to download and install it locally.

    A demo is worth a thousand words πŸ˜‰

    I spent some time compiling all pampy examples into a Jupyter Notebook file, and adapted it in a way that we can open it with a small service we have at RMOTR to launch Jupyter environments online. No account or subscription required to use it, so it's pretty convenient for people that wants to get hands on the library with a low entrance barrier.

    The result is what you can see in my fork of the repo (see the new "Demo" section): https://github.com/martinzugnoni/pampy

    Do you agree that having such interactive demo would help people to know and use pampy? Let's use this issue as a kick off to start a discussion. Nothing here is written in stone and we can change everything as you wish.

    I hope you guys like it, and I truly appreciate any feedback.

    thanks.

    opened by martinzugnoni 7
  • OneOf operator for matching

    OneOf operator for matching

    Say I want to have a match for any one of the items, instead of creating two statements to match against we only need one which specifies that the value must be one within a set.

    For example:

    class Choice(Enum):
    	START = 0
    	COOPERATE = 1
    	DEFECT = 2
    
    match(Choice.DEFECT, OneOf(Choice.DEFECT, Choice.COOPERATE), True)
    

    This will make some types of rules more succinct, especially with support for the Enum type.

    Sounds like a good idea?

    opened by HarryR 4
  • Some (may be) bugs I found

    Some (may be) bugs I found

    Hi. Nice small library, tested out a lot of things. I really does match anything. But I found some mistakes or bugs.

    1. I know None is matched in _, but shouldn't None be matched with None also? For example:
    x = None
    print(match(x, None, 'None', _, 'Everything else')) => return Everything else
    
    1. If I match integer 1 or float 1.0 with True, shouldn't match function not match with those values ? Same is for 0 or 0.0 . I know 0 and 1 are also boolean False and True, but there are a lot of other false values too.
    x = 1
    print(match(x, True, 'True value', _, 'Everything else')) => returns True value
    
    1. Last thing, I don't know if you wanted this to match or no, but child class inhereting parent class, when matched with any of those classes, returns True.
    class Parent:
        pass
    
    class Child(Parent):
        pass
    
    x = Child()
    print(match(x, Parent, 'Child class', _, 'Everything else')) => returns Child class
    

    Thank you for your time and time it took you to write this library πŸ‘ πŸ‘ πŸ‘ . I also made a pull request to fix some minor mistakes, so your welcome 🦊

    opened by dinko-pehar 4
  • Possibly misbehaviour of match_value function?

    Possibly misbehaviour of match_value function?

    Hello there

    Thank for the great package. Gets really handy in my current projects :)

    However, I'm wondering if following piece of code was intentionally written or it is just an logical error(?)

    #pampy.py
    ....
    ValueType = (int, float, str, bool)
    ....
    elif isinstance(pattern, ValueType):
    return pattern is value, []
    ....
    

    It is a bad idea to compare strings with is operator, isn't it? In one of the projects I'm getting errors because strings cannot be properly compared. I use regex as a workaround, but it seems like an overkill for my case, where I compare simple strings, nothing fancy

    opened by MikhailMS 3
  • Patterns with guards?

    Patterns with guards?

    Very cool module! This is one of the things I like about scala and I'm excited to be able to use this in python.

    I was wondering if there would be some way to allow for conditionals in the patterns? Something like this (but not necessarily using this syntax):

    match(input,
        pattern_1 if cond_1, action_1,  # matches pattern_1 under condition cond_1
        pattern_1, action_1a,  # default matching for pattern_1
    ...
    )
    

    So, in this case, the first pattern wouldn't match the input unless cond_1 was true. So, you could do something like:

    match(x,
        int if x < 10, print("integer value less than 10"),
        int, print("integer value >= 10")
    }
    
    opened by wooters 2
  • raise in match

    raise in match

    Hi, below sample code give me error:

       return match
        (
            name,
            "WarmupMultiStepLR",  WarmupMultiStepLR( \
                optimizer, \
                cfg.SOLVER.STEPS, \
                cfg.SOLVER.GAMMA, \
                warmup_factor=cfg.SOLVER.WARMUP_FACTOR, \
                warmup_iters=cfg.SOLVER.WARMUP_ITERS, \
                warmup_method=cfg.SOLVER.WARMUP_METHOD, \
            ),
            "WarmupCosineLR", WarmupCosineLR( \
                optimizer, \
                cfg.SOLVER.MAX_ITER, \
                warmup_factor=cfg.SOLVER.WARMUP_FACTOR, \
                warmup_iters=cfg.SOLVER.WARMUP_ITERS, \
                warmup_method=cfg.SOLVER.WARMUP_METHOD, \
            ),
            _, raise ValueError("Unknown LR scheduler: {}".format(name))
        )
    

    _, raise ValueError("Unknown LR scheduler: {}".format(name)) ^ SyntaxError: invalid syntax

    opened by sailfish009 1
  • A version with enum support does not seem to be published

    A version with enum support does not seem to be published

    The current installable version 0.2.1 via pip does not seem to have the added support for Enums. Thus, Enum's still do not work. Were there plans to publish a 0.2.2 with the Enum change?

    Thanks.

    opened by jahan-addison 1
  • Add type annotations support for matching

    Add type annotations support for matching

    Greetings!

    I implemented pattern matching support for type annotations from the typing module. You may see how it looks like in the new elaborate test

    opened by Ecialo 1
  • Matching of Python3 `enum`

    Matching of Python3 `enum`

    Matching Python 3 Enum classes always fails.

    This can be fixed by adding support for Enum at:

    https://github.com/santinic/pampy/blob/709950096ee5b3adab0e47f9b5d07481a1432818/pampy/pampy.py#L31

    To:

    from enum import Enum
    
    # ...
    
        elif isinstance(pattern, (int, float, str, bool, Enum)):
    

    Built-in equality checks for enum types will work the same as other scalar values.

    However, this will break Python 2.x compatibility, where no Enum type is available.

    opened by HarryR 1
  • Project still alive?

    Project still alive?

    Hello, is this project still alive? I noticed that the owner hasn't been active for a year and no PRs have been accepted for a while. I know that pattern matching is hitting python 3.10 at some point, but I feel like this project still has a place, especially as it supports 2.7 still.

    opened by themanifold 1
  • Possibilty to match same object

    Possibilty to match same object

    Matching an instance of a class against it's class works perfectly but i just realied that you cannot match with the class itself:

    class Marker: pass
    match({"my_marker": Marker}, {"my_marker": Marker}, lambda x: print('MATCH'))
    

    I think this should be a valid match right? Looking at the code at

    https://github.com/santinic/pampy/blob/master/pampy/pampy.py#L59

    seems like here we should add a check based on

    inspect.isclass
    

    What do you think?

    opened by sunbit 0
  • Document differences to

    Document differences to "PEP: 622 Structural Pattern Matching Version"

    PEP: 622 proposes Structural Pattern Matching for python 3.10. For some users it may be interesting how difficult it would be to port the pampy pattern matching code to native python 3.10 code. (that is if pep 622 gets accepted)
    I couldn't find any posts where differences and overlaps are documented.
    Thank you for this great project!

    opened by v217 1
  • Guard support ?

    Guard support ?

    Hi, Great jobs on pampy ! this is the closest thing I could find to core.match from clojure.

    I'm wondering if we can apply a new guard function in matching pattern ?

    match ( 3,
        (lambda x: x%2==1), print("It is even number"),
        ....
        _, print("not match")
    
    opened by yellowbean 0
  • add scala-like syntax

    add scala-like syntax

    Added a file to improve the syntax (pampy_scala.py). It is just a wrapper around the match function to make it feel more like the Scala pattern matching syntax.

    opened by PyAntony 0
Releases(v0.2.1)
  • v0.2.1(Dec 24, 2018)

  • v0.1.10(Dec 18, 2018)

    Pampy supports Python 3.7 dataclasses. You can pass the operator _ as arguments and it will match those fields.

    @dataclass
    class Pet:
        name: str
        age: int
    
    pet = Pet('rover', 7)
    
    match(pet, Pet('rover', _), lambda age: age)                    # => 7
    match(pet, Pet(_, 7), lambda name: name)                        # => 'rover'
    match(pet, Pet(_, _), lambda name, age: (name, age))            # => ('rover', 7)
    
    Source code(tar.gz)
    Source code(zip)
  • v0.1.9(Dec 11, 2018)

Owner
Claudio Santini
https://twitter.com/hireclaudio
Claudio Santini
A simple python script to generate an iCalendar file for the university classes.

iCal Generator This is a simple python script to generate an iCalendar file for the university classes. Installation Clone the repository git clone ht

Foad Rashidi 2 Sep 01, 2022
A small python library that helps you to generate localization strings for your mobile projects.

LocalizationUtiltiy A small python library that helps you to generate localization strings for your mobile projects. This small script aims to help yo

1 Nov 12, 2021
An okayish python script to generate a random Euler circuit with given number of vertices and edges.

Euler-Circuit-Test-Case-Generator An okayish python script to generate a random Euler circuit with given number of vertices and edges. Executing the S

Alen Antony 1 Nov 13, 2021
A random cats photos python module

A random cats photos python module

Fayas Noushad 6 Dec 01, 2021
This utility synchronises spelling dictionaries from various tools with each other.

This utility synchronises spelling dictionaries from various tools with each other. This way the words that have been trained on MS Office are also correctly checked in vim or Firefox. And vice versa

Patrice Neff 2 Feb 11, 2022
Python Libraries with functions and constants related to electrical engineering.

ElectricPy Electrical-Engineering-for-Python Python Libraries with functions and constants related to electrical engineering. The functions and consta

Joe Stanley 39 Dec 23, 2022
Create C bindings for python automatically with the help of libclang

Python C Import Dynamic library + header + ctypes = Module like object! Create C bindings for python automatically with the help of libclang. Examples

1 Jul 25, 2022
Kanye West Lyrics Generator

aikanye Kanye West Lyrics Generator Python script for generating Kanye West lyrics Put kanye.txt in the same folder as the python script and run "pyth

4 Jan 21, 2022
Python script to launch burp scans automatically

SimpleAutoBurp Python script that takes a config.json file as config and uses Burp Suite Pro to scan a list of websites.

Adan Álvarez 26 Jul 18, 2022
Macro recording and metaprogramming in Python

macro-kit is a package for efficient macro recording and metaprogramming in Python using abstract syntax tree (AST).

8 Aug 31, 2022
Random Number Generator Analysis With Python

Random-Number-Generator-Analysis Governor's Honors Program Project to determine

Jack Prewitt 2 Jan 23, 2022
Script to generate a massive volume of data in sql, csv, json or xml format

DataGenerator Made with Python Open for pull requests 1. Dependencies To install required dependencies run pip install -r requirements.txt 2. Executi

icrescenti 3 Sep 20, 2022
UUID version 7, which are time-sortable (following the Peabody RFC4122 draft)

uuid7 - time-sortable UUIDs This module implements the version 7 UUIDs, proposed by Peabody and Davis in https://www.ietf.org/id/draft-peabody-dispatc

Steve Simmons 22 Dec 20, 2022
A python package containing all the basic functions and classes for python. From simple addition to advanced file encryption.

A python package containing all the basic functions and classes for python. From simple addition to advanced file encryption.

PyBash 11 May 22, 2022
Fraud Multiplication Table Detection in python

Fraud-Multiplication-Table-Detection-in-python In this program, I have detected fraud multiplication table using python without class. Here, I have co

Sachin Vinayak Dabhade 4 Sep 24, 2021
MicroMIUI - Script to optimize miui and not only

MicroMIUI - Script to optimize miui and not only

Groiznyi-Studio 1 Nov 02, 2021
A python module to validate input.

A python module to validate input.

Matthias 6 Sep 13, 2022
SysInfo is an app developed in python which gives Basic System Info , and some detailed graphs of system performance .

SysInfo SysInfo is an app developed in python which gives Basic System Info , and some detailed graphs of system performance . Installation Download t

5 Nov 08, 2021
This is a tool to calculate a resulting color of the alpha blending process.

blec: alpha blending calculator This is a tool to calculate a resulting color of the alpha blending process. A gamma correction is enabled and the def

Igor Mikushkin 12 Sep 07, 2022
ColorController is a Pythonic interface for managing colors by english-language name and various color values.

ColorController.py Table of Contents Encode color data in various formats. 1.1: Create a ColorController object using a familiar, english-language col

Tal Zaken 2 Feb 12, 2022