An open API service indexing awesome lists of open source software.

https://github.com/asukaminato0721/python-www

Inspired by proxy-www
https://github.com/asukaminato0721/python-www

Last synced: 2 months ago
JSON representation

Inspired by proxy-www

Awesome Lists containing this project

README

        

# python-www

Inspired by [justjavac/proxy-www](https://github.com/justjavac/proxy-www)

```py
from typing import Callable
import requests

class WWW:
def __init__(self, name: str = "http://www"):
self.name = name

def __repr__(self):
return repr(self.name)

def get(self, *args: Callable):
res = requests.get(self.name)
for f in args:
f(res)

def __getattr__(self, name):
return WWW(f"{self.name}.{name}")

www = WWW()
www.example.com.get(
lambda x: print(x.status_code),
lambda x: print(x.headers["content-type"]),
)
```

Just for fun😉