Skip to main content

Utilities for DataFrames, Google Sheets, fuzzy string matching, GPG-encrypted credentials, and other little hacks.

Project description

LigonLibrary

A Python utility library for working with DataFrames, Google Sheets, fuzzy string matching, and more.

Installation

From PyPI:

pip install ligonlibrary

Or pin in your project's dependencies (e.g. in pyproject.toml):

dependencies = [
    "ligonlibrary>=0.2.1",
]

To install the development version straight from GitHub:

pip install git+https://github.com/ligon/LigonLibrary.git

Requires Python 3.11+.

What's included

DataFrame utilities

  • get_dataframe(f) — Read a DataFrame from nearly any file: CSV, Excel, Parquet, Feather, Stata (.dta), SPSS, fixed-width, org-tables, and GPG-encrypted variants of all of the above.
  • df_to_orgtbl(df) — Render a DataFrame as an Emacs org-mode table, with optional standard errors, confidence intervals, and significance stars.
  • orgtbl_to_df(table) — Parse an org-mode table back into a DataFrame.
  • df_from_orgfile(path) — Read named tables from .org files.
  • from_dta(fn) — Read Stata .dta files with automatic label decoding.
  • normalize_strings(df, ...) — Normalize string columns in a DataFrame.
  • find_similar_pairs(s1, s2) — Find fuzzy-matching pairs between two Series.

Google Sheets

  • read_sheets(key, ...) / read_public_sheet(key) — Read a Google Sheet into a DataFrame.
  • write_sheet(df, key, ...) — Write a DataFrame to a Google Sheet.
  • delete_sheet(key) — Delete a Google Sheet.
  • get_credentials(...) — Load Google service-account credentials (supports GPG-encrypted JSON).

String matching

  • normalized(s) — Normalize a string (case, whitespace, hyphens).
  • similar(a, b) — Check whether two strings are fuzzy-similar.
  • most_similar(s, candidates) — Find the best fuzzy match from a list.

Other

  • email_from_ligon(...) — Send email via the Gmail API.
  • get_password_for_machine(host) — Look up a password in a GPG-encrypted ~/.authinfo.gpg file, with fallback to pass (password-store).

License

BSD 3-Clause. See LICENSE.

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

ligonlibrary-0.2.1.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

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

ligonlibrary-0.2.1-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

Details for the file ligonlibrary-0.2.1.tar.gz.

File metadata

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

File hashes

Hashes for ligonlibrary-0.2.1.tar.gz
Algorithm Hash digest
SHA256 671a149e8f10193e34d136666714a12d2f7cc864d76d43ae893a0e23df5e444d
MD5 c33254a0e1956fb67e000e2188bc4661
BLAKE2b-256 cdf5bbcb5240b8d21ef08df01b7d4c7537538495da62dc392994d4668069992e

See more details on using hashes here.

Provenance

The following attestation bundles were made for ligonlibrary-0.2.1.tar.gz:

Publisher: release.yml on ligon/LigonLibrary

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

File details

Details for the file ligonlibrary-0.2.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for ligonlibrary-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3561b9f80aa65b897daa5adf636d8a4f7f52f0d0b345331ffc1901db3aafb397
MD5 25fb9c2db9b04426b2f0fa6d8e72dfee
BLAKE2b-256 3798c235aa7822cc90534e94f6a88deb201d5d4f6d5e393b86692355086e9903

See more details on using hashes here.

Provenance

The following attestation bundles were made for ligonlibrary-0.2.1-py3-none-any.whl:

Publisher: release.yml on ligon/LigonLibrary

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