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
Data Utilities e.g. for importing files to onetask

Use this repository to easily convert your source files (csv, txt, excel, json, html) into record-oriented JSON files that can be uploaded into onetask.

onetask.ai 1 Jul 18, 2022
Python type-checker written in Rust

pravda Python type-checker written in Rust Features Fully typed with annotations and checked with mypy, PEP561 compatible Add yours! Installation pip

wemake.services 31 Oct 21, 2022
Bounding Boxes Python Utils

Bounding Boxes Python Utils

Vadim 4 May 01, 2022
This tool lets you perform some quick tasks for CTFs and Pentesting.

This tool lets you convert strings and numbers between number bases (2, 8, 10 and 16) as well as ASCII text. You can use the IP address analyzer to find out details on IPv4 and perform abbreviation a

Ayomide Ayodele-Soyebo 1 Jul 16, 2022
Playing with python imports and inducing those pesky errors.

super-duper-python-imports In this repository we are playing with python imports and inducing those pesky ImportErrors. File Organization project │

James Kelsey 2 Oct 14, 2021
Python USD rate in RUB parser

Python EUR and USD rate parser. Python USD and EUR rate in RUB parser. Parsing i

Andrew 2 Feb 17, 2022
Retrying is an Apache 2.0 licensed general-purpose retrying library, written in Python, to simplify the task of adding retry behavior to just about anything.

Retrying Retrying is an Apache 2.0 licensed general-purpose retrying library, written in Python, to simplify the task of adding retry behavior to just

Ray Holder 1.9k Dec 29, 2022
Small Python script to parse endlessh's output and print some neat statistics

endlessh_parser endlessh_parser is a small Python script that parses endlessh's output and prints some neat statistics about it Usage Install all the

ManicRobot 1 Oct 18, 2021
kawadi is a versatile tool that used as a form of weapon and is used to cut, shape and split wood.

kawadi kawadi (કવાડિ in Gujarati) (Axe in English) is a versatile tool that used as a form of weapon and is used to cut, shape and split wood. kawadi

Jay Vala 2 Jan 10, 2022
Dynamic key remapper for Wayland Window System, especially for Sway

wayremap Dynamic keyboard remapper for Wayland. It works on both X Window Manager and Wayland, but focused on Wayland as it intercepts evdev input and

Kay Gosho 50 Nov 29, 2022
A Python library for reading, writing and visualizing the OMEGA Format

A Python library for reading, writing and visualizing the OMEGA Format, targeted towards storing reference and perception data in the automotive context on an object list basis with a focus on an urb

Institut für Kraftfahrzeuge, RWTH Aachen, ika 12 Sep 01, 2022
Daiho Tool is a Script Gathering for Windows/Linux systems written in Python.

Daiho is a Script Developed with Python3. It gathers a total of 22 Discord tools (including a RAT, a Raid Tool, a Nuker Tool, a Token Grabberr, etc). It has a pleasant and intuitive interface to faci

AstraaDev 32 Jan 05, 2023
A sys-botbase client for remote control automation of Nintendo Switch consoles. Based on SysBot.NET, written in python.

SysBot.py A sys-botbase client for remote control automation of Nintendo Switch consoles. Based on SysBot.NET, written in python. Setup: Download the

7 Dec 16, 2022
Install, run, and update apps without root and only in your home directory

Qube Apps Install, run, and update apps in the private storage of a Qube. Build and install in Qubes Get the code: git clone https://github.com/micahf

Micah Lee 26 Dec 27, 2022
A python module to update the console without flashing.

A python module to update the console without flashing.

Matthias 112 Dec 19, 2022
A simple and easy to use collection of random python functions.

A simple and easy to use collection of random python functions.

Diwan Mohamed Faheer 1 Nov 17, 2021
Pampy: The Pattern Matching for Python you always dreamed of.

Pampy: Pattern Matching for Python Pampy is pretty small (150 lines), reasonably fast, and often makes your code more readable and hence easier to rea

Claudio Santini 3.5k Jan 06, 2023
Search, generate & deliver Msfvenom payloads in an quick and easy way

Goal Search, generate & deliver payloads in an quick and easy way Be as simple as possible BUT with all msfvenom payloads. Ever lost time searching th

2 Mar 03, 2022
Etherium unit conversation and arithmetic library

etherunit Etherium unit conversation and arithmetic library Install pip install -u etherunit Usage from etherunit import Ether, Gwei, Wei, E Creat

Yasin Özel 1 Nov 10, 2021
A python program to find binary, octal and hexadecimal of a decimal.

decimal-converter This little python program can convert a decimal in to, Binary Octal Hexadecimal Needed Python 3 or later or a online python compile

Chandula Janith 0 Nov 27, 2021