semvec/pypi-packages huggingface dataset:
simp 2.0.0
Sort imports simply
License: MIT
Keywords: documentation

simp.py
-------

Usage
=====

.. code-block:: bash

       simp.py [-h] [--commit] [--dry_run] [--fail] [targets [targets ...]]

Description
===========

Sort the import directives in Python files, excluding __future__.

Positional arguments
====================

``targets``
  One or more Python files or directories with Python files.
  Without arguments, runs simp on the current directory.

Optional arguments
==================

``-h``, ``--help``
  Show this help message and exit

``--commit``, ``-c``
  Git commit the changes

``--dry_run``, ``-d``
  If set, do not make the changes to the Python files, but just
  list the diffs.

``--fail``, ``-f``
  If set, the program fails if any changes need to be made. This
  is useful for a commit hook to check if all imports are sorted.


Comments
========

I wanted to sort my Python includes with no fuss. ``simp`` finds the first block
of unindented import statements, and sorts them. Any comments between import
lines bubble up to the top in their original order.

(automatically generated by `doks <https://github.com/rec/doks/>`_ on 2020-11-01T14:22:18.849238)
fastapi-di 0.0.1
Extracted the dependency injection process from fastapi.
License: MIT
Requires Python: >=3.8,<4.0

# fastapi_di
Extracted the dependency injection process from fastapi.
Dependency injection by fastapi_di is only available in the async environment.

# Requirement

- Python 3.8+

# Installation
``` shell
poetry install fastapi_di
```

# Getting started
Dependency injection is done by decorating the function and calling do as follows.


``` Python
import asyncio
from fastapi import Depends
from fastapi_di import DI

di = DI()


def get_db():
    yield {1: {"id": 1, "name": "bob", "memo": ""}}


@di.task()
async def update_user(db=Depends(get_db), *, user_id: int, memo: str):
    record = db[user_id]
    record["memo"] = memo
    return record


async def main():
    return await update_user.do(user_id=1, memo="test")


result = asyncio.run(main())
print(result)
# => {'id': 1, 'name': 'bob', 'memo': 'test'}}
```

# warning
This library is in the experimental stage.