Skip to main content

Wrangles

Full documentation available at wrangles.io.

Local development

Supported local development uses Python 3.13. On Windows, create or refresh the complete test and tooling environment with one command from the repository root:

.\scripts\bootstrap-dev.ps1

Add -RunTests to run the self-contained local test suite after installation. The script creates .venv, installs requirements-dev.txt and this checkout in editable mode, runs pip check, and verifies representative core and SQL connector imports. It will not replace an existing environment created with another Python version.

If .venv was created with an older Python version and can be discarded, deactivate it and recreate it from the committed declaration:

deactivate
Remove-Item -LiteralPath .\.venv -Recurse -Force
.\scripts\bootstrap-dev.ps1 -RunTests
.\.venv\Scripts\Activate.ps1

Dev Containers and Codespaces use the same Python 3.13 developer declaration automatically. pytest-local.ini is the shared credential-safe test selection. scripts/test-local.ps1 clears credential variables before running it and isolates generated pytest state by Windows identity. The configuration excludes the intentionally live database, AWS, WrangleWorks, AI, and search-provider checks. The complete credentialed suite remains a CI validation and a local dependency/import pass does not claim live-service validation.

Container and deployment ownership

The repository-root dockerfile builds the WranglesPY CI test image published to ghcr.io/wrangleworks/wrangles. It validates the installable package and recipe behavior in a slim Linux environment; it is not the deployed recipe runtime.

The production execute-recipe AWS Lambda image is built, published to ECR, and deployed from the wrangleworks/Lambda-Recipes repository. Its dockerfile is the source of truth for the production Python version. Changing the Python version in this repository's test image does not migrate the production Lambda runtime.

What are Wrangles?

Wrangles are a set of modular transformations for data cleaning and enrichment. Each Wrangle is optimized for a particular job, many of which are backed by sophisticated machine learning models.

With Wrangles, you can:

  • Extract information from a set of messy descriptions.
  • Predict which category items belong to.
  • Standardize text data to a desired format.
  • Move data from one system to another.
  • Much more...

Wrangles are system independent, and allow you to pull data from one system, transform it and push it to another. Wrangles can be incorporated directly into python code, or an automated sequence of wrangles can be run as a recipe.

Installation

The python package can be installed using pip.

pip install wrangles

This installs the core package, which covers the vast majority of use cases: all data wrangles, recipe execution, Excel/CSV/JSON file I/O, HTTP connectors, SQLite, DuckDB, MongoDB, AWS S3, Salesforce, SFTP/SSH, notifications, and the OpenAI/Gemini/SerpAPI integrations.

Full install (adds SQL Server, Access, PostgreSQL, MySQL, and Parquet files)

A handful of connectors depend on heavier, more platform-specific packages (SQL database drivers) and aren't included by default:

Capability Package(s)
Microsoft SQL Server pymssql, sqlalchemy
Microsoft Access pyodbc
PostgreSQL psycopg2-binary, sqlalchemy
MySQL sqlalchemy (pymysql itself is already in the core install)
Parquet files pyarrow

Install just the ones you need (e.g. pip install pyodbc for Access only), or install all of them at once:

pip install sqlalchemy pyodbc pymssql psycopg2-binary pyarrow

If you're working from a clone of this repository (e.g. for local development), pip install -r requirements-full.txt does the same thing, plus everything from the core install.

If a connector is used without its required package installed, Wrangles will raise a clear ImportError with the exact pip install command needed, so there's no harm in starting with the core install and adding packages only as you need them.

Once installed, import the package into your code.

import wrangles

Authentication

Some Wrangles use cloud based machine learning models. To use them a WrangleWorks account is required.

Create a WrangleWorks account: Register

There are two ways to provide the credentials:

Environment Variables

The credentials can be saved as the environment variables:

  • WRANGLES_USER
  • WRANGLES_PASSWORD

Method

The credentials can be provided within the python code using the authenticate method, prior to calling other functions.

wrangles.authenticate('<user>', '<password>')

Usage

Functions

Wrangles can be used as functions, directly incorporated into python code.

Wrangles broadly accept a single input string, or a list of strings. If a list is provided, the results will be returned in an equivalent list in the same order and length as the original.

# Extract alphanumeric codes from a free text strings - e.g. find all part numbers in a set of product description
>>> import wrangles

>>> wrangles.extract.codes('replacement part ABCD1234ZZ')
['ABCD1234ZZ']

>>> wrangles.extract.codes(['replacement part ABCD1234ZZ', 'NNN555BBB this one has two XYZ789'])
[
    ['ABCD1234ZZ'],
    ['NNN555BBB', 'XYZ789']
]

Integrated text cleaning

standardize.clean repairs common mojibake, HTML character references, Unicode inconsistencies, control characters, and whitespace locally. It accepts a string or list and preserves that shape:

>>> wrangles.standardize.clean(["Français", " AT&amp;T "])
['Français', 'AT&T']

In a recipe, one input maps to one output and an omitted output overwrites the input. Multiple inputs map positionally to equally many outputs, or concatenate row values when a single output is given. Wildcard-expanded inputs follow the same rules.

wrangles:
  - standardize.clean:
      input: Description *
      output: Clean Description
      separator: " | "
      normalization: NFKC
      preserve_line_breaks: true

Common options include fix_encoding, unescape_html, normalization, fix_character_width, uncurl_quotes, remove_control_chars, collapse_whitespace, preserve_line_breaks, and trim. Less-common ftfy.fix_text options are forwarded by name. This wrangle does not detect raw byte encodings or remove HTML tags.

The existing model-backed standardize name remains supported and is also available explicitly as standardize.custom.

Recipes

Recipes are written in YAML and allow a series of Wrangles to be run as an automated sequence.

Recipes can be triggered either from python code or a terminal command.

Run

# PYTHON
import wrangles
wrangles.recipe.run('recipe.wrgl.yml')
# TERMINAL
wrangles.recipe recipe.wrgl.yml

Recipe

# file: recipe.wrgl.yml
# ---
# Convert a CSV file to an Excel file
# and change the case of a column.
read:
  - file:
      name: file.csv

wrangles:
  - convert.case:
      input: my column
      case: upper

write:
  - file:
      name: file.xlsx

Metadata

Release files for wrangles 1.20.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wrangles 1.20.2
File Size Uploaded
wrangles-1.20.2.tar.gz 230.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for wrangles 1.20.2
File Interpreter ABI Platform
wrangles-1.20.2-py3-none-any.whl Python 3 none any Details

Total release size: 474.7 kB

Release files / wrangles-1.20.2.tar.gz

Download URL wrangles-1.20.2.tar.gz
Size 230.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7d0ea71dd813d1b7f59c90ebd8106b22d2ac1435f74ab7c85a9102682904097e
BLAKE2b-256 checksum
How to use checksums
437639958025dc4272db922fa68652e5221f7a6eb2800dd460ff0203a4b84810
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 1, 2026.

Transparency log

Release files / wrangles-1.20.2-py3-none-any.whl

Download URL wrangles-1.20.2-py3-none-any.whl
Size 243.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7be173b5d56c4c7a845992cde0a69cac7a8d4aac272b538ae1c4d7cc6ac4c5ff
BLAKE2b-256 checksum
How to use checksums
b0207d19295b3dc27fa48adc6f7c42d6dcbca62a571b475cac91cbb969d608a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 1, 2026.

Transparency log

Release history Release notifications | RSS feed

1.20.5

2 release files

1.20.4

2 release files

This release

1.20.2 This release

2 release files

1.20.0

2 release files

1.19.6

2 release files

1.19.0

2 release files

1.18.0

2 release files

1.16.0

2 release files

1.15.1

2 release files

1.14.0

2 release files

1.13.2

2 release files

1.13.1

2 release files

1.12.0

2 release files

1.10.1

2 release files

1.10.0

2 release files

1.9.0

2 release files

1.8.1

2 release files

1.8.0

2 release files

1.7.3

2 release files

1.7.2

2 release files

1.7.1

2 release files

1.7.0

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0

2 release files

0.5

2 release files

0.4

1 release file

0.3

1 release file

0.2.3

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page