Skip to main content

Dataprep: Data Preparation in Python

Project description


Documentation | Discord | Forum

DataPrep lets you prepare your data using a single library with a few lines of code.

Currently, you can use DataPrep to:

Releases

Repo Version Downloads
PyPI
conda-forge

Installation

pip install -U dataprep

Connector

Connector is an intuitive, open-source API wrapper that speeds up development by standardizing calls to multiple APIs as a simple workflow.

Connector provides a simple wrapper to collect structured data from different Web APIs (e.g., Twitter, Spotify), making web data collection easy and efficient, without requiring advanced programming skills.

Do you want to leverage the growing number of websites that are opening their data through public APIs? Connector is for you!

Let's check out the several benefits that Connector offers:

  • A unified API: You can fetch data using one or two lines of code to get data from tens of popular websites.
  • Auto Pagination: Do you want to invoke a Web API that could return a large result set and need to handle it through pagination? Connector automatically does the pagination for you! Just specify the desired number of returned results (argument _count) without getting into unnecessary detail about a specific pagination scheme.
  • Smart API request strategy: Do you want to fetch results more quickly by making concurrent requests to Web APIs? Through the _concurrency argument, Connector simplifies concurrency, issuing API requests in parallel while respecting the API's rate limit policy.

How to fetch all publications of Andrew Y. Ng?

from dataprep.connector import connect
conn_dblp = connect("dblp", _concurrency = 5)
df = await conn_dblp.query("publication", author = "Andrew Y. Ng", _count = 2000)

Here, you can find detailed Examples.

Connector is designed to be easy to extend. If you want to connect with your own web API, you just have to write a simple configuration file to support it. This configuration file describes the API's main attributes like the URL, query parameters, authorization method, pagination properties, etc.

EDA

DataPrep.EDA is the fastest and the easiest EDA (Exploratory Data Analysis) tool in Python. It allows you to understand a Pandas/Dask DataFrame with a few lines of code in seconds.

Create Profile Reports, Fast

You can create a beautiful profile report from a Pandas/Dask DataFrame with the create_report function. DataPrep.EDA has the following advantages compared to other tools:

  • 10-100X Faster: DataPrep.EDA is 10-100X faster than Pandas-based profiling tools due to its highly optimized Dask-based computing module.
  • Interactive Visualization: DataPrep.EDA generates interactive visualizations in a report, which makes the report look more appealing to end users.
  • Big Data Support: DataPrep.EDA naturally supports big data stored in a Dask cluster by accepting a Dask dataframe as input.

The following code demonstrates how to use DataPrep.EDA to create a profile report for the titanic dataset.

from dataprep.datasets import load_dataset
from dataprep.eda import create_report
df = load_dataset("titanic")
create_report(df).show_browser()

Click here to see the generated report of the above code.

Innovative System Design

DataPrep.EDA is the only task-centric EDA system in Python. It is carefully designed to improve usability.

  • Task-Centric API Design: You can declaratively specify a wide range of EDA tasks in different granularities with a single function call. All needed visualizations will be automatically and intelligently generated for you.
  • Auto-Insights: DataPrep.EDA automatically detects and highlights the insights (e.g., a column has many outliers) to facilitate pattern discovery about the data.
  • How-to Guide : A how-to guide is provided to show the configuration of each plot function. With this feature, you can easily customize the generated visualizations.

Understand the Titanic dataset with Task-Centric API:

Click here to check all the supported tasks.

Check plot, plot_correlation, plot_missing and create_report to see how each function works.

Clean

DataPrep.Clean contains simple functions designed for cleaning and validating data in a DataFrame. It provides

  • A Unified API: each function follows the syntax clean_{type}(df, 'column name') (see an example below).
  • Speed: the computations are parallelized using Dask. It can clean 50K rows per second on a dual-core laptop (that means cleaning 1 million rows in only 20 seconds).
  • Transparency: a report is generated that summarizes the alterations to the data that occured during cleaning.

The following example shows how to clean and standardize a column of country names.

from dataprep.clean import clean_country
import pandas as pd
df = pd.DataFrame({'country': ['USA', 'country: Canada', '233', ' tr ', 'NA']})
df2 = clean_country(df, 'country')
df2
           country  country_clean
0              USA  United States
1  country: Canada         Canada
2              233        Estonia
3              tr          Turkey
4               NA            NaN

Type validation is also supported:

from dataprep.clean import validate_country
series = validate_country(df['country'])
series
0     True
1    False
2     True
3     True
4    False
Name: country, dtype: bool

Currently supports functions for: Column Headers | Country Names | Dates and Times | Duplicate Strings | Email Addresses | Geographic Coordinates | IP Addresses | Phone Numbers | URLs | US Street Addresses

Documentation

The following documentation can give you an impression of what DataPrep can do:

Contribute

There are many ways to contribute to DataPrep.

  • Submit bugs and help us verify fixes as they are checked in.
  • Review the source code changes.
  • Engage with other DataPrep users and developers on StackOverflow.
  • Help each other in the DataPrep Community Discord and Forum.
  • Twitter
  • Contribute bug fixes.
  • Providing use cases and writing down your user experience.

Please take a look at our wiki for development documentations!

Acknowledgement

Some functionalities of DataPrep are inspired by the following packages.

  • Pandas Profiling

    Inspired the report functionality and insights provided in dataprep.eda.

  • missingno

    Inspired the missing value analysis in dataprep.eda.

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

dataprep-0.3.0a1.tar.gz (1.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dataprep-0.3.0a1-py3-none-any.whl (1.7 MB view details)

Uploaded Python 3

File details

Details for the file dataprep-0.3.0a1.tar.gz.

File metadata

  • Download URL: dataprep-0.3.0a1.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.5 CPython/3.8.6 Linux/5.4.0-70-generic

File hashes

Hashes for dataprep-0.3.0a1.tar.gz
Algorithm Hash digest
SHA256 c93fbede0b1a9a85759f65c22436b340d2fa25339a88b61648650f8146029617
MD5 cc04c45f8c780d7496b768e581c5d74e
BLAKE2b-256 bafdbdb8565608b14beb2fa9469a705fc92f6efa7891837e2037ec6e7d858918

See more details on using hashes here.

File details

Details for the file dataprep-0.3.0a1-py3-none-any.whl.

File metadata

  • Download URL: dataprep-0.3.0a1-py3-none-any.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.5 CPython/3.8.6 Linux/5.4.0-70-generic

File hashes

Hashes for dataprep-0.3.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 038c37d5f0e469e2db24903ccd18647613b9ebbfffbdd78a58769a846fbb1d48
MD5 aad889ab4d1b1f28c6b42ae6ee1fb6e2
BLAKE2b-256 e0ba7d9c9acb6de971a1fcf96ffcf43e51bbc23d0fc22ac149691e928c3e1e82

See more details on using hashes here.

Supported by

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