semvec/pypi-packages huggingface dataset:
easydatamodel 0.3.2
The easiest way to create type-safe dataclasses in Python.
License: MIT
Requires Python: <4.0,>=3.11
Keywords: data validation, dataclasses, validation, models, meta-programming


# `easydatamodel` - The easiest way to create type-safe dataclasses in Python


Just annotate your fields and you're good to go.

```python
from easydatamodel import Model

class Person(Model):
    name: str
    age: int
```

Now you have a completely type-safe model that will validate your data for you, every time.

```python
Person(name="John Doe", age=1)  # ✅ OK
Person(name="John Doe", age="timeless")  # ❌ InvalidModelError

# easydatamodel also validates new value assignments
person = Person(name="John Doe", age=1)
person.age = "is but a number" # ❌ raises a TypeError
```
## Install

```
pip install easydatamodel
```


## Requirements
* Python 3.11+

## `easydatamodel` vs. `pydantic` and `dataclasses`

| Feature                                | `easydatamodel` | `pydantic`     | `dataclasses` |
| -------------------------------------- | --------------- | -------------- | ------------- |
| **Validates data on instantiation**    | ✅               | ✅              | ❌             |
| **Validates data on assignment**       | ✅               | Off by default | ❌             |
| **`ClassVar` validation**              | ✅               | ❌              | ❌             |
| **Automagic type coercion by default** | ❌               | ✅              | ❌             |

### Should you use `easydatamodel`?

`easydatamodel` is perfect for simple, type-safe dataclasses with minimal effort and low overhead.

However, you should consider using [`pydantic`](https://docs.pydantic.dev/) if you need more advanced features.


### `easydatamodel` as a meta-programming resource

Given the size of the `easydatamodel` codebase, **`easydatamodel` is a fantastic resource for intermediate and advanced Python developers looking to learn how Python metaprogramming works.** 

This codebase demonstrates how only a few files of Python code can create a powerful library with an ergonomic syntax.
flask-websockets 0.1.2
A WebSockets and channels implementation for Flask
License: MIT
Requires Python: >=3.10

# flask-websockets
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/ch-iv/flask-websockets/ci.yml?style=flat&logo=github&label=Tests%20%26%20Linting)
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/ch-iv/flask-websockets/publish.yml?style=flat&logo=github&label=Latest%20Release)
[![Documentation Status](https://readthedocs.org/projects/flaskwebsockets/badge/?version=latest)](https://flaskwebsockets.readthedocs.io/en/latest/?badge=latest)
![PyPI - Downloads](https://img.shields.io/pypi/dm/flask-websockets)
[![linting - Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json&labelColor=202235)](https://github.com/astral-sh/ruff)
[![code style - Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/format.json&labelColor=202235)](https://github.com/astral-sh/ruff)

flask-websockets is an extension library for Flask, a popular web micro-framework. It adds real-time communication capabilities to your Flask application. flask-websockets implements the WebSocket protocol and allows for low-level control over the connections, as well as a high-level API for subscribing connections to rooms.

flask-websockets supports most popular HTTP WSGI servers such as Werkzeug, Gunicorn, Eventlet and Gevent.

## Example Usage
```python
import time
from threading import Thread
from flask import Flask
from flask_websockets import WebSocket, WebSockets

app = Flask(__name__)
websockets = WebSockets(app)


@websockets.route("/ws")
def websocket_route(ws: WebSocket) -> None:
    with websockets.subscribe(ws, ["server_time"]):
        for data in ws.iter_data():    # keep listening to the websocket so it doesn't disconnect
            pass


def publish_server_time() -> None:
    while True:
        websockets.publish(str(time.time()), ["server_time"])
        time.sleep(1)


Thread(target=publish_server_time).start()
app.run(host="localhost", port=6969)
```
django-mail-viewer 2.2.0
View emails in development without actually sending them.
License: MIT
Keywords: django-mail-viewer, django, email

=============================
Django Mail Viewer
=============================

.. image:: https://badge.fury.io/py/django-mail-viewer.png
    :target: https://badge.fury.io/py/django-mail-viewer

.. image:: https://github.com/jmichalicek/django-mail-viewer/workflows/Python%20package/badge.svg
    :target: https://github.com/jmichalicek/django-mail-viewer/actions?query=workflow%3A%22Python+package%22

View emails in development without actually sending them.

Documentation
-------------

The full documentation is at https://django-mail-viewer.readthedocs.io.

Quickstart
----------

Install Django Mail Viewer::

    pip install django-mail-viewer

Add it to your `INSTALLED_APPS`:

.. code-block:: python

    INSTALLED_APPS = (
        ...
        'django_mail_viewer',
        ...
    )

Add Django Mail Viewer's URL patterns:

.. code-block:: python

    # You may want to only include this in development environments

    urlpatterns = [
        ...
        path('', include('django_mail_viewer.urls')),
        ...
    ]

Set your `EMAIL_BACKEND` in settings.py:

.. code-block:: python

    EMAIL_BACKEND = 'django_mail_viewer.backends.locmem.EmailBackend'

Features
--------

* TODO

Running Tests
-------------

Does the code actually work?

::

    source <YOURVIRTUALENV>/bin/activate
    (myenv) $ pip install tox
    (myenv) $ tox


TODO
-----

* Passthrough backend - store the email for display in the views but also pass to another backend which may actually send
* Redis backend using Redis specific functionality for cleaner code and less risk of bugs vs the django cache backend
* Memcached backend
* File based backend - store each email as its own file
* Other backends?  ElasticSearch?  MongoDB?
* Separate views for each of html, plaintext, attachements, etc. to allow for more customization of display?

Credits
-------

Tools used in rendering this package:

*  Cookiecutter_
*  `cookiecutter-djangopackage`_

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`cookiecutter-djangopackage`: https://github.com/pydanny/cookiecutter-djangopackage