semvec/pypi-packages huggingface dataset:
daraja 0.0.4
A simple to use payments module around the Mpesa Daraja API
Requires Python: >=3.7

# Daraja - Easy to use wrapper around M-Pesa Daraja API

[![PyPI version](https://badge.fury.io/py/daraja.svg)](https://badge.fury.io/py/daraja)


This module provides functions around the Mpesa Daraja API to simplify the whole integration process(problem).

This is what you need to do to get things running:

1. Fill out the `config.json` file with your credentials from Daraja dashboard.

2. Install daraja with `pip install daraja`

3. Import the `mpesa` module from `daraja` like so:
```python
from daraja import Mpesa
```

4. Instantiate a Mpesa object with only two parameters, the config.json file and your environment(either "dev" or "prod"); dev being a development environment and prod being a production environment. This value is used to determine the API endpoints that will be used.
```python
...

mpesa = Mpesa(config_file="config.json", env="prod")
```

5. Use the Mpesa object to do stuff, like so:
```python
...
response = mpesa.stk(receiver="254791500264", amount=50)
print(response)
```

I am working on extending this to cover all the remaining features the Daraja API has to offer. If you can help with it, [contact](https://gitahi.me/reach-me) me.
pgsm 0.0.1
A simple state manager for pygame.
Requires Python: >=3.10

# State Manager

A simple pygame state manager with threaded loading using loading screens. 

This means you can use heavy initialization and entry code without having to worry about it. As long as your code needs to finish up, a loading state will be displayed. 

# Set Up

You can choose to install either `pygame` or the community version `pygame-ce`
```shell
pip install pygame
# or
pip install pygame-ce
```

The package is called pgsm (`PyGameStateMachine`)

```shell
pip install pgsm
```

# Usage

You first write the states by inheriting from `State` then you put it all together with the `StateManager`.

Take this as a simple example with a play state and a pause state.

We want to toggle between play and pause state when the user presses "p"

```py
import pygame as pg
from StateManager import State, StateManager

class PlayState(State):
    def on_enter(self):
        print("Playing")

    def update(events, dt):
        # This is an example for handling events
        # and changing states
        for event in events:
            if event.type == pg.KeyDown and event.key == pg.K_p:
                self.exit("pause")

    def draw(self, s):
        """ 
        Whatever you want to draw 
        s is the surface or screen you may draw to
        """

class PauseState(State):
    def on_enter(self, _frm):
        print("Pausing")

    def update(events, dt):
        for event in events:
            if event.type == pg.KEYDOWN and event.key == pg.K_p:
                self.exit("play")

    def draw(self, s):
        """ Whatever you want to draw """

# We use strings as keys to refer to our states
sm = StateManager({
    "play":PlayState(),
    "pause":PauseState()
}, start="play")
```

Now you can use your state machine like this.
The state machine will by default just draw to the main screen. 

```py
SCREEN = pg.display.set_mode((900, 600))

while running:
    dt = clock.tick(60)
    events = pg.event.get()
    for event in events:
        if event.type == pg.QUIT:
            running = False
        if event.type == pg.KEYDOWN and event.key == pg.K_ESCAPE:
            running = False
        # we could also have done the toggle here
    SCREEN.fill("white")
    sm(events, dt)
    pg.display.flip()
```

The default loading state draws a little spinner. If you want to change how that works, simply override the `LoadingState`.

For example:

```py
from StateManager import LoadingState

class BlankLoadingState(LoadingState):
    def __init__(self, color):
        self.color = color

    def update(self, *args):
        pass

    def draw(self, s):
        s.fill(self.color)
```

And use like this

```py
sm = StateManager({
        "play":PlayState(),
        "pause":PauseState()
    }, 
    start="play", 
    loading_state=BlankLoadingState("black")
)
```

# License

MIT License
locute 1.0.0b5
Simple localisation library
Requires Python: >=3.11,<4.0

# locute

A library that simplify i18n.

## Using

`locales/en/main.ftl`

```
hello = Hello from I18N!
```

`main.py`

```python
from pathlib import Path
from locute import FluentCollector

def main():
    locales = Path(__file__).parent / "locales"
    collector = FluentCollector(locales)

    print(collector.get_locale("en").format_value("hello"))


if __name__ == "__main__":
    main()
```

## MIT License
Copyright (c) 2023 Locute Dev

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
pygdshort 1.1.1
A Python wrapper for the is.gd URL shortener
Requires Python: >=3.7

# pygdshort

pygdshort is a python library for shortening URLs using the is.gd API.

## Installation

`pip install pygdshort`

## Usage

For usage see the [wiki](https://github.com/TheOctoGirl/pygdshort/wiki/Usage).