semvec/pypi-packages huggingface dataset:
enum-switch 0.1.0
An Enum-based implementation of switch for Python.
License: MIT
Requires Python: >=3.4

# Enum-based Switch for Python

This is an attempt at creating a way to do a reliable, not-bug-prone 
implementation, for Python, of a `switch` thing like other languages 
have.

## How it works

Suppose you have an enum, like this:

```
class Color(Enum):
    RED = 1
    GREEN = 2
    BLUE = 3
```

And you want to implement logic which branches based on a value which is of type `Color`.
You can do it by subclassing the `Switch` class. The syntax should be obvious, but:

* Inherit from Switch
* Implement a method for each value of the Enum
* If you are not implementing them all: add a `default` method.
* If you leave any Enum value unaccounted for: it will raise an exception when you
  instantiate your class.

Then:

* Instantiate your class
* Call it as a function passing it a value from the Enum
* The respective method will be executed and its return value returned

```
from enum_switch import Switch

class MySwitch(Switch):
    def RED(self):
        return "Apple"

    def GREEN(self):
        return "Kiwi"

    def BLUE(self):
        return "Sky"

switch = MySwitch()

print(switch(Color.RED))

Apple
```

And that's it.

Some additional notes:

* Passing it something that is not a value of the correct Enum type will raise ValueError
* `default` is optional

Hope someone finds it useful!
multiflash 0.4.0
study aid
License: MIT
Requires Python: >=3.7

multiflash
============

Install
-------

multiflash requires Python 3.7 or newer.
You can install it from PyPI:

    $ pip install multiflash


License
-------

multiflash is copyright [John Reese](https://jreese.sh), and licensed under
the MIT license.  I am providing code in this repository to you under an open
source license.  This is my personal repository; the license you receive to
my code is from me and not from my employer. See the `LICENSE` file for details.
cipher-tools 0.0.3
A python library to assist in the creation of ciphers
License: MIT
Requires Python: >=3.8,<4.0

# Cipher Tools
This is a python library that contains some tools for making ciphers.
In was originaly made of use at a childrens workshop at PyCon UK 2019.

[![pipeline status](https://gitlab.com/mokytis/cipher-tools/badges/master/pipeline.svg)](https://gitlab.com/mokytis/cipher-tools/commits/master)


## Installation
Run the following to install:
```python
pip install cipher-tools
```

## Usage
### Shift
Shift some text by an arbitrary amount. Text case is preserved.

Code:
```python
from cipher_tools import shift

shifted_text = shift("AbCdEfgYZ", 2)
print(shifted_text)
```
Output:
```
CdEfGhiAB
```
### Rot13
You can encrypt / decrypt text using rot13.

Code:
```python
from cipher_tools import rot13

# Apply Rot13 to a phrase
cipher_text = rot13("Hello, World!")
print(cipher_text)
```
Output:
```
Uryyb, Jbeyq!
```

Code:
```python
from cipher_tools import rot13

# Decrtpt the text
plain_text = rot13("Uryyb, Jbeyq!")
print(plain_text)
```
Output:
```
Hello, World!
```