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.1.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 2 Python 3

File details

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

File metadata

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

File hashes

Hashes for sockless-0.9.1.tar.gz
Algorithm Hash digest
SHA256 64e14d8607fb052479e4a2848ee84fba0d0f0da317672448606f5da38886fc82
MD5 d55def805298f933d36feb7799302493
BLAKE2b-256 314e14ede9ac4543e4bd29570d5d5afb1da0553225f5c0fb555e8898400bce58

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sockless-0.9.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 7fcf71c80b47b7119c71fba0e18b2e942a63835b1c639c5ca85e06e126c45734
MD5 6aa46af8c4b834b36d6b8fdaff3b9e5a
BLAKE2b-256 3a29434a05ac2bd0602e5d4cccb68581540e20559466924f722e905989aac355

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