semvec/pypi-packages huggingface dataset:
factorygame-dave22153 0.2.0
Python game engine to have a 2d movable "graph".
Requires Python: >=3.2

# FactoryGame

Python game engine to have a 2d movable "graph".

## Overview

### Design

Factorygame is a game engine meant for simple, minimalist games. It supports
a large array of graphical features such as shapes, colors and lines. The
framework is developed with the idea to enable rapid game development and
prototyping, with a robust and extendable toolset.

### Flexibility

The use of the Python scripting language throughout makes this engine highly
flexible. It has an open source policy to support understanding and extending
any part of the engine with ease. By letting users choose their workflow, it
empowers them to use their existing techniques to speed up build times.

### Development Operations

This game engine can cater to many experience levels. Python is already
vastly popular and the number of users is growing. Nothing in the framework
is preventing users from building a game as it's designed to be a streamlined
hassle-free time. Previous users of Godot's scripting language will feel at
home.

## Installation

Just download it and start working straight away. It is recommended to have
some Python knowledge, although this is optional. First take a look at the
included samples by executing `run_test.py`. This will showcase all the current
included features.

## Usage

You are free to use this engine as you wish. We would love to know if you have
made a game with it.
e2fyi-pyspark 0.1.0a1
Productivity functions for common but painful pyspark tasks.
Requires Python: >=3.6
Keywords: util pyspark

# e2fyi-pyspark

[![PyPI version](https://badge.fury.io/py/e2fyi-pyspark.svg)](https://badge.fury.io/py/e2fyi-pyspark)
[![Build Status](https://travis-ci.org/e2fyi/pyspark-utils.svg?branch=master)](https://travis-ci.org/e2fyi/pyspark-utils)
[![Coverage Status](https://coveralls.io/repos/github/e2fyi/pyspark-utils/badge.svg?branch=master)](https://coveralls.io/github/e2fyi/pyspark-utils?branch=master)
[![Documentation Status](https://readthedocs.org/projects/e2fyi-pyspark/badge/?version=latest)](https://e2fyi-pyspark.readthedocs.io/en/latest/?badge=latest)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Downloads](https://pepy.tech/badge/e2fyi-pyspark)](https://pepy.tech/project/e2fyi-pyspark)

`e2fyi-pyspark` is an `e2fyi` namespaced python package with `pyspark` subpackage
(i.e. `e2fyi.pyspark`) which holds a collections of useful functions for common
but painful pyspark tasks.

API documentation can be found at [https://e2fyi-pyspark.readthedocs.io/en/latest/](https://e2fyi-pyspark.readthedocs.io/en/latest/).

Change logs are available in [CHANGELOG.md](./CHANGELOG.md).

> - Python 3.6 and above
> - Licensed under [Apache-2.0](./LICENSE).

## Quickstart

```bash
pip install e2fyi-pyspark
```

### Infer schema for unknown json strings inside a pyspark dataframe

`e2fyi.pyspark.schema.infer_schema_from_rows` is a util function to infer the
schema of unknown json strings inside a pyspark dataframe - i.e. so that the
schema can be subsequently used to parse the json string into a typed data
structure in the dataframe
(see [`pyspark.sql.functions.from_json`](https://spark.apache.org/docs/latest/api/python/pyspark.sql.html#pyspark.sql.functions.from_json)).

```py
import pyspark
from e2fyi.pyspark.schema import infer_schema_from_rows

# get spark session
spark = pyspark.sql.SparkSession.builder.getOrCreate()
# load a parquet (assume the parquet has a column "json_str", which
# contains a json str with unknown schema)
df = spark.read.parquet("s3://some-bucket/some-file.parquet")
# get 10% of the rows as sample (w/o replacement)
sample_rows = df.select("json_str").sample(False, 0.01).collect()
# infer the schema for json str in col "json_str" based on the sample rows
# NOTE: this is run locally (not in spark)
schema = infer_schema_from_rows(sample_rows, col="json_str")
# add a new column "data" which is the parsed json string with a inferred schema
df = df.withColumn("data", pyspark.sql.functions.from_json("json_str", schema))
# should have a column "data" with a proper schema
df.printSchema()
```