Skip to content

Implement "URL fopen"-like behavior. #16

Description

@amcgregor

Implement Basic Socket Streams

  • Raw TCP communication via tcp:// pseudo-protocol; port identification required.
  • Raw UDP communication via udp:// pseudo-protocol; port identification required.

Protocol Layering

SSL or TLS cryptography through addition of +ssl or +tls protocol suffixes.

Specific Protocol Implementations

HTTP

https://docs.python.org/3/library/urllib.request.html
https://docs.python.org/3/library/http.client.html#module-http.client

class HTTPScheme(Scheme):
	def open(self, uri:URI, mode:str='r', buffering=-1, encoding=None, errors=None, newline=None) -> HTTPResponse:
		...

FTP

https://docs.python.org/3/library/ftplib.html

Trivial Example

from uri import URI
from PIL import Image

with URI('https://httpbin.org/image/png').open('rb', True) as fh:
	image = Image.open(fh)
	...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions