semvec/pypi-packages huggingface dataset:
jsonablr 2.0.1
Serialize Pydantic models and non-JSONable types into a JSONable variable.
Requires Python: >=3.8,<4.0

# JsonAblr

JsonAblr is a Python library that allows you to encode variables into a format that represents a JSON object. It provides a simple and intuitive way to convert variables into a JSON-like structure, making it easier to store and transmit data.

This was heavily inspired by FastAPI's `jsonable_encoder`.

- JsonAblr now requires Pydantic 2.0 or above. If you are using Pydantic 1.x, please use JsonAblr 1.1.1.

## Features

- Encode variables into a JSON-like format
- Supports various data types including strings, numbers, lists, dictionaries, dates, Pydantic models, dataclasses and more
- Easy to use
- Customizable for your own types

## Installation

You can install Jsonablr using pip:

```shell
pip install jsonablr
```

## Usage

### `encode` helper function:

```python
from jsonablr import encode
from datetime import datetime, timezone

my_date = datetime.now(tz=timezone.utc)

print(encode(my_date))
```

#### Output:

```
2023-06-26T12:30:00.000Z
```

### `JsonAblr` class:

```python
from typing import Set
from datetime import datetime
from jsonablr import JsonAblr
from pydantic import BaseModel

class DynamoDbItem(BaseModel):
    partition_key: str
    sort_key: str
    games: Set[str]
    when: datetime

encoder = JsonAblr(
    encoders={
        datetime: lambda x: x.isoformat(sep=' ', timespec='seconds')
    },
    preserve_set=True
)

item = DynamoDbItem(
    partition_key='foo',
    sort_key='bar',
    games=['minecraft', 'terraria'],
    when=datetime.now()
)

print(encoder.encode(item))

```

This example demonstrates using a Pydantic model to be used as AWS DynamoDB item and not to be used as JSON. The `games` attribute is returned as a set (when using the `preserve_set=True` option) to support the DynamoDB SET type.
Serialising a set with `json.dumps` will cause an error.

#### Output:

```
{
    'partition_key': 'foo',
    'sort_key': 'bar',
    'games': {'minecraft', 'terraria'},
    'when': '2023-06-26 12:30:00'
}
```
exchangecurrency 0.10.0
cli tool to convert currencies and get rates
Requires Python: >=3.10,<4.0

# exchangeCLI

this project offers a CLI for converting currencies


## Usage
Get an API key from [here](https://openexchangerates.org/account/app-ids) and put it inside a config.py file.
Then call the rates.py script via the CLI and provide your base and the target currency

For example, for finding the exchange rate between USD and ZWL you can do the following:

```
python src/rates.py --base USD --target ZWL
```
kivy-pinview 0.0.1
This is an android pinview implementation for kivy
Requires Python: >=3.7

# kivy-pinview
This is an android pinview implementation for kivy 
You can use [this platform](https://github.com/Alchemist-T-N/kivy-pinview/issues) to write your content.

#      installation:
        pip install kivy-pinview

#       uninstall:
        pip uninstall kivy-pinview

#       kivy-pinview
        This module is built using some ready to use kivy widgets like Label, TextInput, BoxLayout, FloatLayout etc.
        Structure:
                FloatLayout:
                  -> TextInput:
                  -> BoxLayout:
                      -> Labels:
        Working:
                On touching the view, TextInput takes focus and text entered in that is rendered to the Labels and on fully entering data into labels, on_otp(self, caller_obj, otp) is fired which can be overridden.
        Use:
                can be used to take otp(one time password) inputs...

#       Example:

        from kivy.lang import Builder
        from kivy.app import App

        kv = """
        #:import PinView kivy-pinview.PinView

        PinView:
                size_hint_x:.8
                pos_hint:{'center_x':.5,'center_y':.5}
            #Box Related:
                box_spacing:10
                box_radius:[5, 5]
                box_count:5

            #Text Related:
                text_color:[0,.4,1,1]
                default_text:'-'
                #font_name:'your_font_name.ttf'
                font_size:50
                markup:True
                on_otp:print(self.otp)

             #Box Canvas related:
                box_bg_color:[1,.4,1,1]
                #box_bg_image:'your_bg_image.jpg'
        """

        class MyApp(App):
            def build(self):
                return Builder.load_string(kv)
mccalcy 0.0.15
A small test package with calculator module.
Requires Python: >=3.7

# McCalcy Package

The McCalcy package provides a Calculator class that allows you to perform basic arithmetic operations and manipulate a memory value.

## Installation

To install the McCalcy package, you can use pip:

```
pip install mccalcy
```

## Usage

First, import the package:

```python
from mccalcy import mccalcy
```

Create a Calculator instance:

```python
calc = mccalcy.Calculator()
```

Perform calculations using the available methods:

```python
calc.add(5)
calc.subtract(2)
calc.multiply(3)
calc.divide(2)
calc.root(2)
```

Access the current memory value:

```python
print("Memory:", calc.memory)
```

Reset the memory:

```python
calc.reset_memory()
print("Memory after reset:", calc.memory)
```

Refer to the docstrings in the source code for detailed information on each method.

## Contributing

Contributions are welcome! If you find any issues or have suggestions for improvement, please open an issue or submit a pull request on the [GitHub repository](https://github.com/VitalijusKiubis/mccalcy).

## License

This package is licensed under the [MIT License](LICENSE).