Wolpie
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
Metadata
Release files for wolpie 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| wolpie-0.5.0.tar.gz | 79.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| wolpie-0.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 160.7 kB
Release files / wolpie-0.5.0.tar.gz
| Download URL | wolpie-0.5.0.tar.gz |
|---|---|
| Size | 79.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
963a7f98bec136d59d79590635d6165c18c0343d16fdaa781de27e839031065b
|
|
BLAKE2b-256 checksum How to use checksums |
3e09c29fab6156204c57aa37495e2623c72ce94248d2dc8afc12b566b67c21a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|
Release files / wolpie-0.5.0-py3-none-any.whl
| Download URL | wolpie-0.5.0-py3-none-any.whl |
|---|---|
| Size | 80.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ae63ea50cb7e7c1d599c7f9c70dfbc6c98ca295ac7161935c0d857cf2567b14d
|
|
BLAKE2b-256 checksum How to use checksums |
2d79244ac4088e760f86c57910c2895067bd31fbaef3d05090544f769c44bc07
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|