Skip to content

Instantly share code, notes, and snippets.

@bmaggard
bmaggard / myurlparse.py
Created June 24, 2024 20:10 — forked from alexwlchan/myurlparse.py
Helper functions for dealing with query strings in URLs
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Utility functions for dealing with URL query strings in Python,
i.e., URLs of the form
http://example.net?field1=value1&field2=value2
This module includes a pair of helper functions: one for getting the values
associated with a particular field; another for setting the query string
@bmaggard
bmaggard / literal_string.py
Created February 12, 2023 00:40 — forked from paulkernstock/literal_string.py
Literal block scalars with PyYAML's dump
import yaml
from yaml.representer import SafeRepresenter
class LiteralString(str):
pass
def change_style(style, representer):
def new_representer(dumper, data):
scalar = representer(dumper, data)
@bmaggard
bmaggard / get lastrowid with petl.ipynb
Last active May 29, 2021 19:32
getting lastrowid when executing todb()
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Keybase proof

I hereby claim:

  • I am bmaggard on github.
  • I am maggardb (https://keybase.io/maggardb) on keybase.
  • I have a public key ASANJPFD17fy3bJKrfnDhby3ZvrFZcTk7Rsz8KM9dX0V_go

To claim this, I am signing this object: