semvec/pypi-packages huggingface dataset:
redwall 0.1.2
A reddit image/post scraper
License: MIT

# RedditBrowser

Scrape subreddits and slideshow through images or posts with a timer.  Images are cached to the temp directory, and removed on close. (Check the temp directory to make sure images are deleted.)

## Requirements
- BeautifulSoup4

## Install

Redwall is available on PyPi. Just run

`pip install redwall`

to get the latest version.

Use cases:

```bash
# For the screensaver version that iterates through images on a time schedule
redwall_screensaver [--subreddit SUBREDDIT] [--previd previd]
                    [--score score] [--nsfwo] [--nsfw] [--title title]
                    [-i INTERVAL] [-v]

# For manual control and more options, use this command
redwall_control [--subreddit SUBREDDIT] [--previd previd]
                [--score score] [--nsfwo] [--nsfw] [--title title] [-v]

```

Each entry point is utilizes the reddit_scraper.RedditScraper iterable class to step through posts and images on the subreddit of your choice.  To use the RedditScraper class in your own project, simply import it with some settings:
```python
from redwall.reddit_scraper import RedditScraper

# initialize the scraper with filters
scraper = RedditScraper(previd='', subreddit='wallpapers', title='', score=100, nsfw=False, sfw=True)

# prescrape posts for speed
scraper.getPosts(5)

# get the next post
post = scraper.next()

#update a filter and get the next post
scraper.update('subreddit', 'wallpaperdump')
post = scraper.next()

# set wallpaper to the first image in the post
from redwall.set_wallpaper import set_wallpaper
image = post.images[0]
image.download()
set_wallpaper(image.path)

# iterate through images
for image in scraper.imageIter():
  # returns None when no more images can be loaded
  if image == None:
    break
  print("Image at %s" % image.url)
```

#### Windowed Branch
The windowed branch is an older version of redwall that runs in a PyQt window.  It is buggy and crashes on occassion, but is useful if you don't want to change your actual wallpaper.  Checkout the branch and run `python main.py` to see it work.
hackgen 1.0.1
HackerRank Test-Case Generator
License: MIT

HackGen: Hackerrank Test-Case Generator
=======================================

Generate test cases for your HackrRank challenge. You need your solution algorithm, input format and constraints only.
Generate the zipped file and upload :)

Installation
------------

::

  $ pip install hackgen



Example usage
-------------

::

  >>> import random
  >>> from hackgen import TestInputFormat, TestGenerator, Language
  >>> class ClockDelayInputFormat(TestInputFormat):
  >>>     """
  >>>     Input format of Clock Delay challenge.
  >>>     https://www.hackerrank.com/contests/hourrank-28/challenges/clock-delay
  >>>     """
  >>>
  >>>     # difficulty levels with test file number
  >>>     # difficulty level is [0-9]
  >>>     __diff = [(5, 10), (10, 30), (50, 100), (100, 300), (100, 300),
  >>>               (300, 600), (600, 900), (800, 1000), (900, 1000), (950, 1000)]
  >>>
  >>>     def inputs(self, difficult_level: int) -> None:
  >>>         q = random.randint(*self.__diff[difficult_level])  # number of test cases
  >>>         print(q)
  >>>         for n in range(q):
  >>>             # constraints for h1 m1 h2 m2 k
  >>>             h1 = random.randint(0, 23)
  >>>             m1 = random.randint(0, 60)
  >>>             h2 = random.randint(h1, 24)
  >>>             k = random.randint(h2 - h1 + 1 if h1 == h2 else h2 - h1, 24 - h1)
  >>>             m2 = random.randint(0, (m1 if h1 + k == h2 else 60))
  >>>             print(h1, m1, h2, m2)
  >>>             print(k)
  >>>
  >>> # input format instance
  >>> input_format = ClockDelayInputFormat()
  >>>
  >>> # try with Language.java('Logic') also
  >>> test_generator = TestGenerator(10, input_format, Language.python('logic'), "ClockDelay")
  >>> test_generator.run()
aws-lambda-handler 0.0.4
Better AWS Lambda handlers.
License: MIT
Requires Python: >=3.6.0


[![CircleCI](https://circleci.com/gh/hmngwy/py-aws-lambda-handler.svg?style=svg)](https://circleci.com/gh/hmngwy/py-aws-lambda-handler) [![codecov](https://codecov.io/gh/hmngwy/py-aws-lambda-handler/branch/develop/graph/badge.svg)](https://codecov.io/gh/hmngwy/py-aws-lambda-handler)

![](https://codecov.io/gh/hmngwy/py-aws-lambda-handler/branch/develop/graphs/tree.svg?height=70&width=898)

## aws-lambda-handlers

Better Python 3 AWS Lambda Handlers.

Currently, your only choice for making Python handlers for AWS Lambda is to create a function like so:

```
def handler(event, context):
    return True
```

This isn't ideal when you start dealing with more than one handler, or if you want to provide a configurable and reusable handler. This package provides three base classes, the `Handler`, the `Request`, and the `Response` handler.

The `Handler` class is a [callable](https://en.wikipedia.org/wiki/Callable_object), you create a subclass off of this, instantiate it, and that's what you configure AWSλ to invoke.

Your `Handler` has to have a `perform(self, request)` method, this houses your handler's business logic, `Handler.__call__` executes this function and expects a `Response` object.

The `Response` object behaves like a dictionary and an object, an attribute called `serialized` is returned to AWSλ.

The `request` argument in `perform(self, request)` is a `Request` object, and it houses the `event` and `context` parameters that AWSλ passes to your handler. Packaging those handler arguments into an object makes them available for transparent mutations, see [`aws_lambda.apig.APIGatewayRequest`](py-aws-lambda-handler/aws_lambda/apig/\_\_init\_\_.py) for reference.

The foundation of this library is tiny, I recommend reviewing the [main classes](py-aws-lambda-handler/aws_lambda/__init__.py) to further understand how to use this package.

### Usage

```
pip install aws-lambda-handler
```

```python
import aws_lambda

class EchoHandler(aws_lambda.Handler):
    """Echo handler."""

    def perform(self, request, **k):
        """Echo perform method."""
        response = aws_lambda.Response()
        response.body = self.request.event
        return response

echo_handler = EchoHandler()

# `echo_handler` is now a callable function you can map your AWS Lambda function to
```

### Develop

Fork this library and send over PRs, I will consider applications for contributors if two of your PRs gets merged and published.

```
pipenv sync --dev # setup
pipenv run pytest # test
```

### Supported Event Sources

- [x] API Gateway `aws_lambda.apig`
- [ ] S3
- [ ] DynamoDB
- [ ] SNS
- [ ] SES
- [ ] SQS
- [ ] Cognito
- [ ] Cloudwatch Logs, Events

#### Help

We want support for more event sources, I am willing to entertain PRs. You can use the `aws_lambda.apig` submodule as an example of implementing more event sources.
imserv 0.1.11.4
Spin an image server, store images from Clipboard in single place, and prevent duplication.
License: MIT

# ImServ

Spin an image server, store images from Clipboard in single place, and prevent duplication.

## Installation

- Clone the project from GitHub
- Navigate to the project folder and [`poetry install`](https://github.com/sdispater/poetry)
- Run a Python script:

```python
from imserv.db import create_all_tables
create_all_tables()
```
The folder `~/Pictures/imserv` will be created, and will be used for storing all images. (Tested only on Mac.)

By default, it uses PostGRESQL of the database named `imserv`, so you have to initialize the database first, before running the script.

The image folder can also be changed in `ImServ(folder=IMG_FOLDER_PATH)`.

## Usage

To run an image server (before running Jupyter Notebook), run in a script:

```python
ImServ().runserver()
```

This will open the server for the website: http://localhost:8000/, which leads to:

![web.png](/screenshots/web.png)

where you can create an image directly from Clipboard. The name of the image will be randomized using UUID.

After that, if you want to use it in Jupyter Notebook:

```python
>>> from imserv import ImServ
>>> ims = ImServ()
>>> ims.last()
'The image accessed last will be shown.'
```

## More screenshots

![jupyter0.png](/screenshots/jupyter0.png)
![jupyter1.png](/screenshots/jupyter1.png)

## Related projects

- [jupyter-flashcard](https://github.com/patarapolw/jupyter-flashcard) - Create a database of Jupyter Notebooks and convert them into flashcards.