PySpark Helpers
A collection of tools to help when developing PySpark applications
Installation
With pip
pip install pyspark_helpers
With poetry
poetry add pyspark_helpers
Usage
Auto Generate PySpark Schemas from JSON examples
Through cli:
python -m pyspark_helpers.schema
# OR with script
psh-schema-from-json --path ./tests/data/schema/array.json --output ./results/array_schema.json
Or programatically
from pyspark_helpers.schema import schema_from_json, bulk_schema_from_jsom
from pathlib import Path
data_dir = "data/json"
## One file
schema = schema_from_json(f"{data_dir}/file.json")
print(schema)
## A whole directory
files = [Path(f) for f in Path.glob(f"{data_dir}/*.json")]
schemas = bulk_schema_from_jsom(files)
for _file, schema in zip(files, schemas):
print(_file.name, schema)
Guidelies for Contributing
Use Conventional Commit messages.
To help with this, I encourage you to use commitizen when making your commits. The process for this is straight forward:
# Checkout a new branch
git checkout -b <my-new-branch>
# Make changes to the code....
# Add your changes
git add <changed-file-1> <changed-file-2> ...
# Run commitizen commit and follow prompts
commitizen commit # `cz c` in short
# Push branch
git push
# Open a Pull Request
## This is done in Github
Metadata
Release files for pyspark-helpers 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyspark_helpers-0.2.1.tar.gz | 5.1 kB | Without provenance | Details for pyspark_helpers-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyspark_helpers-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for pyspark_helpers-0.2.1-py3-none-any.whl |
Total release size: 10.9 kB
Release files / pyspark_helpers-0.2.1.tar.gz
| Download URL | pyspark_helpers-0.2.1.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e510bf3e93c8a49203705af95ad0b2ab7f6236ce2044cbc3b9a6ae84fdc7b05a
|
|
BLAKE2b-256 checksum How to use checksums |
7ae6bc3ef7719d4db9a1cbdb1a47cd5d69334fa87c02e06dd5f61a875ecb8bf7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.0 CPython/3.8.10 Darwin/22.3.0
|
Release files / pyspark_helpers-0.2.1-py3-none-any.whl
| Download URL | pyspark_helpers-0.2.1-py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
340c21e3cdb1441f496bba049163a38d6dee19007e441259109ce9d55b69ab6d
|
|
BLAKE2b-256 checksum How to use checksums |
ce51b807c8adfb493833603fe7a107bb852e0ca7f067971911f0953156ae8f88
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.0 CPython/3.8.10 Darwin/22.3.0
|
Security for pyspark-helpers 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.