semvec/pypi-packages huggingface dataset:
typingplus 2.2.3
An enhanced typing library with casting and validation.
License: MIT
Keywords: typing

typingplus
==========

|PyPI| |Python Versions| |Build Status| |Coverage Status| |Code Quality|

*An enhanced version of the Python typing library that always uses the latest
version of typing available, regardless of which version of Python is in
use.*


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

Install it using pip:

::

    pip install typingplus


Features
--------

- Contains all of the typing library, and is guaranteed to use the latest
  installed version of the ``typing`` library, even if the version of Python in
  use has an older version of ``typing``.
- ``typing_extensions`` is integrated to be as compatible with the future of the
  ``typing`` module as possible.
- Support for comment type hints.
- A functional cast function, including to the abstract types defined in the
  ``typing`` module.
- An is_instance function that works with the abstract types defined in the
  ``typing`` module.
- An upgrade_typing function that will replace the stdlib version of ``typing``
  with the latest version from either the stdlib or the backport.


Usage
-----

See `PEP 484`_.


.. _PEP 484: https://www.python.org/dev/peps/pep-0484/

.. |Build Status| image:: https://travis-ci.org/contains-io/typingplus.svg?branch=development
   :target: https://travis-ci.org/contains-io/typingplus
.. |Coverage Status| image:: https://coveralls.io/repos/github/contains-io/typingplus/badge.svg?branch=development
   :target: https://coveralls.io/github/contains-io/typingplus?branch=development
.. |PyPI| image:: https://img.shields.io/pypi/v/typingplus.svg
   :target: https://pypi.python.org/pypi/typingplus/
.. |Python Versions| image:: https://img.shields.io/pypi/pyversions/typingplus.svg
   :target: https://pypi.python.org/pypi/typingplus/
.. |Code Quality| image:: https://api.codacy.com/project/badge/Grade/ccf7fb925d32499f80a1cfb8a640436b
   :target: https://www.codacy.com/app/contains-io/typingplus?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=contains-io/typingplus&amp;utm_campaign=Badge_Grade
asyncpipe 0.0.1
An async-compatible library for composing Python shell pipelines
License: MIT
Requires Python: ~=3.5

## asyncpipe

This is a little module to help you chain together subprocess pipelines, a bit
more nicely than python natively lets you. The key element here is the support
for asyncio.

### OS Compatibility

This will only work on versions of python that support async/await syntax
I've only tested this on Linux. I don't see any reason why it wouldn't work on
OSX/BSD, but it's possible. I doubt this works on Windows at all.

### Python compatibility

This requires 'async' and 'await' keywords, so Python 3.5+ only.

#### Motivation

When you use a `PIPE` for stdout in the native asyncio.subprocess module, you
don't get back a value that can be passed to another Popen like you do in the
subprocess module. Instead you get a wrapper. Sometimes you can resolve that by
just using the 'shell' execution model, but sometimes that's not a great fit.

The solution is to do an error-prone set of operations with os.pipe and linking
up various subprocesses stdin/stdout. This gets especially ugly when you've got
a chain of 3+ shell commands.


### Use

#### Synchronous

The synchronous form is pretty straightforward:

	import asyncpipe
	pipe = asyncpipe.PipeBuilder('ls')
	# you can chain it
	pipe.chain('grep', '^S')
	# or use the 'or' operator
	pipe | 'wc -l'
	results = pipe.call()
	matches = int(results[-1].stdout.strip())

All of those return the underlying object, and the starting arguments are
optional, so this is equivalent:

	import asyncpipe
	pipe = asyncpipe.PipeBuilder().chain('ls') | 'grep ^s' | ['wc' '-l']
	results = pipe.call()
	matches = int(results[-1].stdout.strip())


#### Asyncronous

Async code is similar, except you need to pass the event loop as the 'loop'
value to the PipeBuilder, or set it any time before calling `call_async()`:

	import asyncpipe
	import asyncio
    loop = asyncio.new_event_loop()
    # if you don't do this, you will get errors from asyncio 
    asyncio.set_event_loop(loop)
	pipe = asyncpipe.PipeBuilder(loop=loop)
	pipe.chain('ls') | 'grep ^s' | ['wc' '-l']
	results = loop.run_until_complete(pipe.call_async())
	matches = int(results[-1].stdout.strip())

If you were doing more in your event loop, you would of course just
`await pipe.call_async()`!