Skip to main content

This project provides a collection of utilities for doing lightweight data wrangling.

Project description

datashaper

This project provides a collection of utilities for doing lightweight data wrangling.

There are two goals of the project:

  1. Create a shareable client/server schema for serialized wrangling instructions
  2. Maintain an implementation of a basic wrangling engine (based on Arquero) and in the case of python implemented in Pandas

Building

  • You need to install poetry python package manager.
  • Run: poetry install

Usage

This project is intended to be used as a library for lightweight data wrangling. In the examples folder there is a Notebook which provides several examples of how to create data wrangling pipelines and how to read json specifications that can be generated by the js implementation.

Example of joining two tables:

from datashaper.pipeline import Pipeline
import datashaper.types as types
import pandas as pd

# id   name
# 1    bob
# 2    joe
# 3    jane
parents = pd.DataFrame({
    "id": [1, 2, 3],
    "name": ['bob', 'joe', 'jane']
})

# id   kid
# 1    billy
# 1    jill
# 2    kaden
# 2    kyle
# 3    moe
kids = pd.DataFrame({
    "id": [1, 1, 2, 2, 3],
    "kid": ['billy', 'jill', 'kaden', 'kyle', 'moe']
})

pipeline = Pipeline()

pipeline.add_dataset('parents', parents)
pipeline.add_dataset('kids', kids)

pipeline.add(Step(
    verb=Verb.join,
    input="parents",
    output="output",
    args={
        "other": "kids",
        "on":["id"]
    }
))

# id   name    kid
# 1    bob     billy
# 1    bob     jill
# 2    joe     kaden
# 2    joe     kyle
# 3    jane    moe
result = pipeline.run()

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

datashaper-0.0.40.tar.gz (35.8 kB view details)

Uploaded Source

Built Distribution

datashaper-0.0.40-py3-none-any.whl (71.1 kB view details)

Uploaded Python 3

File details

Details for the file datashaper-0.0.40.tar.gz.

File metadata

  • Download URL: datashaper-0.0.40.tar.gz
  • Upload date:
  • Size: 35.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for datashaper-0.0.40.tar.gz
Algorithm Hash digest
SHA256 97ce8f21cf5b0ae2c4f2f95f3797d6f73e38a214c57319ba2ed8d6b6890e749b
MD5 fa328f4d178f1d95b425efe409279f05
BLAKE2b-256 b2103db40a4ce4092ec5f640eaa811138d6248796c49a7d982cd042dd78e8b00

See more details on using hashes here.

File details

Details for the file datashaper-0.0.40-py3-none-any.whl.

File metadata

  • Download URL: datashaper-0.0.40-py3-none-any.whl
  • Upload date:
  • Size: 71.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for datashaper-0.0.40-py3-none-any.whl
Algorithm Hash digest
SHA256 6488a8837f0d965d83cc27498ffcb18d8e6aabbc62c814c5e864dfe1cf5c0af1
MD5 3c759eb7b20ae86b4f24ea04ff2a8f96
BLAKE2b-256 d4341e4f70bc76e18bfa29c53bed65a2443f08e9c9e79526587fd86ae25f7f76

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page