=======
-----
.. contents:: **Table of Contents**
:backlinks: none
Installation
------------
selectz is distributed on PyPI_ as a universal wheel and is available on
Linux/macOS and Windows and supports Python 2.7/3.5+ and PyPy.
.. code-block:: bash
$ pip install selectz
Usage
-----
Modified Python 3 selectors example_ using `selectz`.
.. code-block:: python
import selectz
import socket
sel = selectz.Selector()
def accept(sock):
conn, addr = sock.accept() # Should be ready
print('accepted', conn, 'from', addr)
conn.setblocking(False)
sel.register('read', conn, read)
def read(conn):
data = conn.recv(1000) # Should be ready
if data:
print('echoing', repr(data), 'to', conn)
conn.send(data) # Hope it won't block
else:
print('closing', conn)
sel.remove(conn)
conn.close()
sock = socket.socket()
sock.bind(('localhost', 1234))
sock.listen(100)
sock.setblocking(False)
sel.register('read', sock, accept)
while True:
sel.select()
License
-------
selectz is distributed under the terms of both
- MIT_ License
- Apache_ License, Version 2.0
at your option.
.. _PYPI: https://pypi.org
.. _example: https://docs.python.org/3/library/selectors.html
.. _MIT: https://choosealicense.com/licenses/mit
.. _Apache: https://choosealicense.com/licenses/apache-2.0
Metadata
Release files for selectz 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| selectz-1.0.2.tar.gz | 8.2 kB | Without provenance | Details for selectz-1.0.2.tar.gz |
Release files / selectz-1.0.2.tar.gz
| Download URL | selectz-1.0.2.tar.gz |
|---|---|
| Size | 8.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
00f9b5317b2f53a10a6d599dbb130cbffe1fdae50b4332e08d8d6238a56a6bda
|
|
BLAKE2b-256 checksum How to use checksums |
a76444b2a9bc7ae5f7dd18c9ebea4941908100e495839f2be01a9b6ac74f8f8d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for selectz 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.