Skip to content

Instantly share code, notes, and snippets.

View krummja's full-sized avatar

Jonathan Crum krummja

View GitHub Profile
def inspect_companies(
start: int = 0,
stop: int = 100
) -> Generator[Dict[str, Any]]:
"""Generator function to page through Hubspot contacts.
: param int start : The start page of the
: param int stop :
"""
@krummja
krummja / structural_pattern_matching.py
Created December 9, 2022 15:29
Python 3.10+ Structural Pattern Matching
from __future__ import annotations
from typing import NamedTuple
class Point2D(NamedTuple):
x: int
y: int
class Point3D(NamedTuple):
from __future__ import annotations
from typing import *
from types import TracebackType
if TYPE_CHECKING:
from requests import Request, Response
import json
import requests
from enum import Enum
@krummja
krummja / make_reqs.py
Created March 9, 2023 14:29
Script to execute poetry pyproject.toml to requirements.txt for Heroku deployment
from __future__ import annotations
from beartype.typing import *
if TYPE_CHECKING:
from subprocess import CompletedProcess
import subprocess
def run(cmd: str) -> CompletedProcess[bytes]:
return subprocess.run(