semvec/pypi-packages huggingface dataset:
dategen 1.0.2
A date generator.


# Table of Contents

1.  [Install](#org432e4c0)
2.  [Usage](#orge8bd4cf)
3.  [folder structures](#org5bdbbcc)

Dategen is a python package that yield a generator of dates.


<a id="org432e4c0"></a>

# Install

    $ python3 -m pip install dategen


<a id="orge8bd4cf"></a>

# Usage

    import dategen
    g = dategen.dategen.backward
    help(g)

    x=g()

    # only the last command will be displayed.
    
    # type( x )  # generator
    
    # list( x )  # 5000 datetime, a very long list.
    
    # next( x )  # one datetime form the generator
    
    # len( list(x) )  # 5000


<a id="org5bdbbcc"></a>

# folder structures

    
    date
    
    tree

    Fri Jul 23 17:57:13 CST 2021
     .
     ├── LICENSE
     ├── Pipfile
     ├── Pipfile.lock
     ├── README.md
     ├── Untitled.ipynb
     ├── Untitled1.ipynb
     ├── dategen
     │   ├── __init__.py
     │   └── dategen.py
     ├── log.org
     ├── pyproject.toml
     └── tests
         └── dategen.ipynb
celery-scheduler 0.0.1
动态分布式任务调度框架

b'# \xe5\x8a\xa8\xe6\x80\x81\xe5\x88\x86\xe5\xb8\x83\xe5\xbc\x8f\xe4\xbb\xbb\xe5\x8a\xa1\xe6\xb5\x81'
djangogrpcframework 0.2.1
gRPC for Django.
Requires Python: >=3.6

Django gRPC Framework
=====================

.. image:: https://img.shields.io/pypi/v/djangogrpcframework.svg
   :target: https://img.shields.io/pypi/v/djangogrpcframework.svg

.. image:: https://readthedocs.org/projects/djangogrpcframework/badge/?version=latest
   :target: https://readthedocs.org/projects/djangogrpcframework/badge/?version=latest

.. image:: https://travis-ci.org/fengsp/django-grpc-framework.svg?branch=master
   :target: https://travis-ci.org/fengsp/django-grpc-framework.svg?branch=master

.. image:: https://img.shields.io/pypi/pyversions/djangogrpcframework
   :target: https://img.shields.io/pypi/pyversions/djangogrpcframework

.. image:: https://img.shields.io/pypi/l/djangogrpcframework
   :target: https://img.shields.io/pypi/l/djangogrpcframework

Django gRPC framework is a toolkit for building gRPC services, inspired by
djangorestframework.


Requirements
------------

- Python (3.6, 3.7, 3.8)
- Django (2.2, 3.0), Django REST Framework (3.10.x, 3.11.x)
- gRPC, gRPC tools, proto3


Installation
------------

.. code-block:: bash
    
    $ pip install djangogrpcframework

Add ``django_grpc_framework`` to ``INSTALLED_APPS`` setting:

.. code-block:: python

    INSTALLED_APPS = [
        ...
        'django_grpc_framework',
    ]


Demo
----

Here is a quick example of using gRPC framework to build a simple
model-backed service for accessing users, startup a new project:

.. code-block:: bash
    
    $ django-admin startproject demo
    $ python manage.py migrate

Generate ``.proto`` file demo.proto_:

.. _demo.proto: https://github.com/fengsp/django-grpc-framework/blob/master/examples/demo/demo.proto

.. code-block:: bash

    python manage.py generateproto --model django.contrib.auth.models.User --fields id,username,email --file demo.proto

Generate gRPC code:

.. code-block:: bash

    python -m grpc_tools.protoc --proto_path=./ --python_out=./ --grpc_python_out=./ ./demo.proto

Now edit the ``demo/urls.py`` module:

.. code-block:: python

    from django.contrib.auth.models import User
    from django_grpc_framework import generics, proto_serializers
    import demo_pb2
    import demo_pb2_grpc


    class UserProtoSerializer(proto_serializers.ModelProtoSerializer):
        class Meta:
            model = User
            proto_class = demo_pb2.User
            fields = ['id', 'username', 'email']


    class UserService(generics.ModelService):
        queryset = User.objects.all()
        serializer_class = UserProtoSerializer


    urlpatterns = []
    def grpc_handlers(server):
        demo_pb2_grpc.add_UserControllerServicer_to_server(UserService.as_servicer(), server)

That's it, we're done!

.. code-block:: bash
    
    $ python manage.py grpcrunserver --dev

You can now run a gRPC client to access the service:

.. code-block:: python

    with grpc.insecure_channel('localhost:50051') as channel:
        stub = demo_pb2_grpc.UserControllerStub(channel)
        for user in stub.List(demo_pb2.UserListRequest()):
            print(user, end='')