Skip to main content

A nicer API around sockets.

Project description

A friendlier interface to socket.

Emulates file-like objects.

import sockless


with sockless.open('irc.freenode.net:6665', mode='rw') as sock:
    # Writing.
    sock.write('NICK atestbot\r\n')
    sock.write('USER atestbot bot@aserver.com unused :atestbot\r\n')
    sock.write('JOIN #testbot\r\n')

    # Reading lines from a socket.
    for line in sock:
        if not line:
            break

        if 'End of /NAMES list' in line:
            print "Successfully connected & joined. Quitting."
            break

        print line.strip()

TODO

  • Tests

  • Docs

  • Python 3 support

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sockless-0.9.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

sockless-0.9.0-py2.py3-none-any.whl (5.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file sockless-0.9.0.tar.gz.

File metadata

  • Download URL: sockless-0.9.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for sockless-0.9.0.tar.gz
Algorithm Hash digest
SHA256 0b4514dfbbb794c73c9a2f05a0ad2773f93b1f234c198d1e67625fe368676ff6
MD5 83e0aa877ca145616213a92f3a905dd4
BLAKE2b-256 59ede5d0eb9d4f3d1c55abf132e9a554c65dd71d8938c085b4c335890bfc86cc

See more details on using hashes here.

File details

Details for the file sockless-0.9.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for sockless-0.9.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c1868af0f8c5987fc0a6ff113b478e8f71b6917a2497d9b636f14c912c1d6802
MD5 010a1749ce0d3aed9137ada9dcc16875
BLAKE2b-256 35abee916c314a3a4c7488a1cef3094da90151b16e68eed8cf7127a812b15b49

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page