Skip to main content

DataWhys API wrapper

Project description

DataWhys Python SDK

DataWhys Python SDK is a Python wrapper for the DataWhys API that handles data orchestration, cloud uploads, and solver execution.

Installation

Use the package manager pip to install.

pip install datawhys-sdk

Usage

import datawhys as dw
from datawhys.datasets import load_titanic

# 1. Set your credentials
dw.api_key = "<YOUR_API_KEY>"

# Optional: Set custom API base
# dw.api_base = "https://your-api-server.com/api/v1"

# 2. Load and Upload your data
# DataWhys uses a cloud-first workflow: upload once, solve many times.
dwf = load_titanic()
dwf.upload()

print(f"File ID: {dwf.file_id}")

# 3. Create a solver and fit the data
solver = dw.Solver()

# Pass the DataWhysFrame directly. The solver extracts the cloud file_id automatically.
solver.fit(
    dwf=dwf,
    outcome='survived',
    target='Died',
    features=['sex', 'class', 'age', 'fare']
)

# 4. View results
print(solver.rule)
print('Score:', solver.score)
print('Rule Size:', solver.size)

# Filter the original dataframe using the discovered rule
filtered_df = solver.get_rule_data()

See the SDK Example.ipynb for more in-depth examples and advanced features.

Install from source

git clone https://github.com/datawhys/datawhys-python-sdk.git
cd datawhys-python-sdk
pip install -e .

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Take a look at CONTRIBUTING.md for more info

Please make sure to update tests as appropriate.

License

MIT

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

datawhys_sdk-0.5.5.tar.gz (184.3 kB view details)

Uploaded Source

Built Distribution

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

datawhys_sdk-0.5.5-py3-none-any.whl (195.4 kB view details)

Uploaded Python 3

File details

Details for the file datawhys_sdk-0.5.5.tar.gz.

File metadata

  • Download URL: datawhys_sdk-0.5.5.tar.gz
  • Upload date:
  • Size: 184.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for datawhys_sdk-0.5.5.tar.gz
Algorithm Hash digest
SHA256 b87a9f0494471136cae3ca6a05de2eeb4a11cef0ce3ef55521a7da29917f4cb9
MD5 d2fc63dbaed2f702b073bce8d5832041
BLAKE2b-256 ec399575b2abfde9cd5dbfc33b04a77426a22575a6d0eb7d86e4098da294cf48

See more details on using hashes here.

Provenance

The following attestation bundles were made for datawhys_sdk-0.5.5.tar.gz:

Publisher: publish.yml on datawhys/datawhys-python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file datawhys_sdk-0.5.5-py3-none-any.whl.

File metadata

  • Download URL: datawhys_sdk-0.5.5-py3-none-any.whl
  • Upload date:
  • Size: 195.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for datawhys_sdk-0.5.5-py3-none-any.whl
Algorithm Hash digest
SHA256 60fca6bf5512d5e7c2a2c56f0579c088d75874b0b37c1127f70beaa3db59d806
MD5 424204d996a5ac702298871af61fbf5e
BLAKE2b-256 8580b236f95482494730641fa86767a4c179b1812f840b4df588b38c3a806eb0

See more details on using hashes here.

Provenance

The following attestation bundles were made for datawhys_sdk-0.5.5-py3-none-any.whl:

Publisher: publish.yml on datawhys/datawhys-python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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