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()

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

Uploaded Source

Built Distribution

sockless-0.8.0-py2.py3-none-any.whl (4.3 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

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

File hashes

Hashes for sockless-0.8.0.tar.gz
Algorithm Hash digest
SHA256 5e18c3b89cfe4786af7062bb1420866555147180dde3b4fa239a824377c36742
MD5 607b63ec9e4ec0e9acb3a1d493920dff
BLAKE2b-256 a6d6a98f0491b548bf0f64436d208e64354739b2ca2033b3899a330aa770fc83

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sockless-0.8.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 dbdbbc54ebec756d9d37dd00ebec49505bbc708f30fac2ecc44fabebfa0f9d81
MD5 4df00cbe2c5b77cba7c36b35e2adfd7f
BLAKE2b-256 dbb8468b1c5c9223ae3c10735d146d1f283678f4f41ce5c6af35f541809a6fe9

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