Skip to main content

I got tired of copy-pasting the same blocks of code from project to project. So I decided to create Wolpie as my own personal swiss army knife for Python development. The one package to rule them all... for my needs at least...

Project description

Wolpie

Wolpie

Docs License Python Version Python Version PyPI Version codecov Known Vulnerabilities

Welcome to Wolpie! Like the banner says, I got tired of copy-pasting the same blocks of code from project to project. I already figured out how to do something the way I like, but now I have to do it all over again in a new project. I also frequently found myself installing packages that did one small thing I needed, but then I had to install a whole package just for that one thing. So I decided to create Wolpie as my own personal swiss army knife for Python development. The one package to rule them all... for my needs at least.

Over time, it will grow to include various utilities and tools that I find useful in my projects. Stay tuned!

Installation

You can install Wolpie from PyPI:

pip install wolpie

Quick Start

Step 1: Identify something that frustrates you.

Step 2: Check if Wolpie has a solution for it.

Step 3: Import and use it.

from wolpie import pretty_str, ding
import time

result = pretty_str("Hello world!", max_chars=10)
print(result)  # Output: 'Hello w...'

# plays the default "ding" sound after the block finishes
with ding():
    time.sleep(10)  # Simulate some long running function

Step 4: Enjoy your newfound productivity!

GSheets

We have our own Google Sheets Client!

from wolpie import GAuth, GSheets, gt, CredentialsInfo

# Authenticate using CredentialsInfo
auth = GAuth(
    credentials_info=CredentialsInfo(
        type="service_account",
        project_id="your-project-id",
        private_key_id="your-private-key-id",
        private_key="your-private-key",
        client_email="your-client-email",
        client_id="your-client-id",
        auth_uri="https://accounts.google.com/o/oauth2/auth",
        token_uri="https://oauth2.googleapis.com/token",
        auth_provider_x509_cert_url="https://www.googleapis.com/oauth2/v1/certs",
        client_x509_cert_url="your-client-cert-url",
        universe_domain="googleapis.com",
    ),
    scopes=["https://www.googleapis.com/auth/spreadsheets"],
)

# Create a sheets client
sheets = GSheets(
    g_auth=auth,
    spreadsheet_id="your-spreadsheet-id",
)

# Access spreadsheet metadata
print(sheets.metadata["properties"]["title"])
print(sheets.metadata["properties"]["locale"])
print(sheets.metadata["properties"]["autoRecalc"])  # Should be ON_CHANGE

# Read a single cell
cell_value = sheets.read_cells(
    sheet="Sheet1",
    cell_range="A1",
)
print(cell_value["values"][0][0])

# Read a range of cells
values = sheets.read_cells(
    sheet="Sheet1",
    cell_range="A1:B10",
)
print(values["values"])

# Update a cell
sheets.update_cells(
    sheet="Sheet1",
    cell_range="A1",
    body={
        "values": [["new_value"]],
        "majorDimension": gt.Dimension.ROWS,
    },
)

# Update multiple cells
sheets.update_cells(
    sheet="Sheet1",
    cell_range="A1:B2",
    body={
        "values": [[1, 2], [3, 4]],
        "majorDimension": gt.Dimension.ROWS,
    },
)

# Use gt for type-safe Google Sheets API types
sheets.read_cells(
    sheet="Sheet1",
    cell_range="A1",
    value_renderer_option=gt.ValueRenderOption.FORMATTED_VALUE,
    date_time_render_option=gt.DateTimeRenderOption.SERIAL_NUMBER,
)

Made with ♥ by Johandielangman

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

wolpie-0.5.0.tar.gz (79.8 kB view details)

Uploaded Source

Built Distribution

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

wolpie-0.5.0-py3-none-any.whl (80.8 kB view details)

Uploaded Python 3

File details

Details for the file wolpie-0.5.0.tar.gz.

File metadata

  • Download URL: wolpie-0.5.0.tar.gz
  • Upload date:
  • Size: 79.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for wolpie-0.5.0.tar.gz
Algorithm Hash digest
SHA256 963a7f98bec136d59d79590635d6165c18c0343d16fdaa781de27e839031065b
MD5 4ba298aa0086671653cc23d78426af12
BLAKE2b-256 3e09c29fab6156204c57aa37495e2623c72ce94248d2dc8afc12b566b67c21a7

See more details on using hashes here.

File details

Details for the file wolpie-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: wolpie-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 80.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for wolpie-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ae63ea50cb7e7c1d599c7f9c70dfbc6c98ca295ac7161935c0d857cf2567b14d
MD5 0998a61d51abed668895a156319df8bf
BLAKE2b-256 2d79244ac4088e760f86c57910c2895067bd31fbaef3d05090544f769c44bc07

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