semvec/pypi-packages huggingface dataset:
devRantSimple 2.2
A simple devRant api wrapper for the lazy people
License: MIT

# devRantSimple
A simple devRant api wrapper for the lazy people

## Installation
First, get it from pip
```bash
pip install devRantSimple
```

Then, import the library
```python
import devRantSimple as dRS
```
That's it!

## Usage
These are the avalible functions and vars:
```python
import devRantSimple as dRS

# Rant Types
# These are passed in to some functions to specify what data you want returned
dRS.RantType.algo   # Algo
dRS.RantType.top    # Top
dRS.RantType.recent # Recent

# Invalid Response
# This is a string returned by some functions when something goes wrong.
# It is always a smart idea to check if the thing returned by the function you are using is equal to this
# If it is, you messsed up somewhere. (or the api changed)
dRS.InvalidResponse

# Functions
dRS.getUserId("<username>")   # Get a user id from a username (returns an int)
dRS.userExists("<username>")  # Check to see if a user exists with this username (returns a bool)

dRS.getRant(dRS.RantType.<type>, <n>) # Get the n'th rant from list <type> 
# Example return data for these parameters: (dRS.RantType, 1):
# {'id': 1604103, 'text:': "Oh yeah. Hey guys. 2 things. \nFirst off. Forgot to say. Officially got a job. Finally. So thank you for all the help/advice and patience with my depressive rants!! \n\nI'm in a new chapter of my life now so thanks. \n\nAnd secondly. \n\nI FUCKING HATE MY JOB", 'score': 66, 'username': 'al-m'}

dRS.getUserRant("<username>", <n>)  # Get the n'th most recent rant posted by <username>
# Example return data for these parameters: ("ewpratten", 1):
# {'text': 'I wonder..\n\nDo the new devduck capes say "devrant.com" on the back? Or do they still say "devrant.io"', 'score': 20, 'tags': ['devrant', 'i wonder'], 'id': 1600704}
```
More functions, data, and info will come soon.

## Example
This is an example script that gets every rant posted by a user (one at a time) and prints it to the screen:
```python
import devRantSimple ad dRS

username = "ewpratten

prevdata = ""
i = 0
while prevdata != dRS.InvalidResponse:
	prevdata = dRS.getUserRant(username, i)["text"]
	print(prevdata)
	i+=1
```
ahui_aiohttp_server 0.1.16
Simple aiohttp Server for both static and python/php file
License: MIT
Requires Python: >=3.5.3

# Ahui-aiohttp-server
[![](https://img.shields.io/pypi/pyversions/ahui_aiohttp_server.svg?longCache=True)](https://pypi.org/pypi/ahui_aiohttp_server/)
[![](https://img.shields.io/pypi/v/ahui_aiohttp_server.svg?maxAge=36000)](https://pypi.org/pypi/ahui_aiohttp_server/)

This is a simple http async server which extends `python -m http.server`.\
(WARN: It's not recommended  for production environments, just use it  in development or testing environments only!):
- Support print to http response directly (same as php's echo)
- Support async-await
- Support php, python

## Install

    pip install ahui-aiohttp-server
    pip3 install ahui-aiohttp-server

## Start server

    $ tree .
    ./
        app/
            echo1.py
            echo2.py
            echo.php
            return.py
        js/
            test.js
    $ python -m ahui_aiohttp_server
    $ python -m ahui_aiohttp_server --host 127.0.0.1 --port 5000

## Access server

### Access via echo server(php-like):

    $ cat app/echo1.py
    print('Hello World!')

    $ curl http://127.0.0.1:5000/app/echo1.py
    Hello World!
    $ curl http://127.0.0.1:5000/js/test.js
    <js content>
    $ curl http://127.0.0.1:5000/app/echo.php
    <js content>

If you want to get request data(such as: `get, post, cookie, ...`, use `aiohttp_handler(request)` instead:

    $ cat app/echo2.py
    def aiohttp_handler(request):
        print(request.query)    # use print 

    $ curl http://127.0.0.1:5000/app/echo2.py?var=value
    {'var':'value'}

### Access via normal aiohttp server:

    $ cat app/return.py
    from aiohttp import web
    async def aiohttp_handler(request):
        data = await request.post()
        return web.Response(body=str(data)) # use return

    $ curl http://127.0.0.1:5000/app/return.py?var=value - 'k1=v2'
    {'k1':'v2'}

### Access static file:

    $ curl http://127.0.0.1:5000/js/test.js
    <js content>

## Required
1. aiohttp
2. python>=3.6