Drafts

Draft and unpublished posts

0 posts simple view

Patagonia

Steam achievements and progress for Patagonia - 2.7% complete with 1/37 achievements unlocked.

4 min

Hosted Platform Brainstorm

shots shots templates gradient backgrounds premium feature upload your own background ogs scrape og info, generate og image og’s build on shots, they are just hosted template endpoints that get a screenshots potentially auto approve og’s from rss drops drop a file to share limited size, limited upload MB’s / month archives deep permalink a website https://pypi.org/project/pywebcopy/ og-links ai-covers give me an url, and a selector, I will read your article and give you an ai generated cover image ai-summaries give me an url, and a selector, I will read your article and give you an ai generated summary ai-voice - voices give me an url, and a selector, I will read your article and give you an ai generated voice image-optimization use the image optimization pipelie for shots to give you an optimized image blur ups Community # host it yourself reader markata Limits # cloudflare file size 100mb https://developers.cloudflare.com/cache/concepts/default-cache-behavior/ Free Tier # 100 shots 1…
1 min read

There Is No Game: Wrong Dimension

Steam achievements and progress for There Is No Game: Wrong Dimension - 11.76% complete with 4/34 achievements unlocked.

5 min

Core Keeper

Steam achievements and progress for Core Keeper - 0.0% complete with 0/51 achievements unlocked.

5 min

Starbound - Unstable

Steam achievements and progress for Starbound - Unstable - 9.8% complete with 5/51 achievements unlocked.

4 min

Colossal Order Game

Steam achievements and progress for Colossal Order Game - 3.94% complete with 5/127 achievements unlocked.

10 min

Poly Bridge 2

Steam achievements and progress for Poly Bridge 2 - 9.09% complete with 2/22 achievements unlocked.

4 min

Mimpi Dreams

Steam achievements and progress for Mimpi Dreams - 17.54% complete with 10/57 achievements unlocked.

6 min

Pycon 2023

Keynote Speaker - James Powell # I don’t want to be an expert python developer. https://www.youtube.com/watch?v=iKzOBWOHGFE usage of keyword only arguments to prevent pain for users of libraries # In an alternate timeline the maintainer of newton could have chose to use keyword only arguments to prevent pain for users of libraries, or poor api design due to fear of changing api on users.
1 min read

Craftopia

Steam achievements and progress for Craftopia - 0.0% complete with 0/50 achievements unlocked.

5 min
global Field
global BaseModel
from pydantic import BaseModel
from pydantic import Field

Pydantic is a Python library for serializing data into models that can be validated with a deep set of built in valitators or your own custom validators, and deserialize back to JSON or dictionary.

Installation #

To install pydantic you will first need python and pip. Once you have pip installed you can install pydantic with pip.

pip install pydantic

Always install in a virtual environment

Creating a Pydantic model #

To get started with pydantic you will first need to create a Pydantic model. This is a python class that inherits from pydantic.BaseModel.

from pydantic import BaseModel
from pydantic import Field
from typing import Optional

class Person(BaseModel):
    name: str = Field(...)
    age: int

parsing an object #

person = Person(name="John Doe", age=30)
print(person)
name='John Doe' age=30

data serialization #

Pydantic has some very robust serialization methods that will automatically coherse your data into the type specified by the type-hint in the model if it can.

person = Person(name=12, age="30")
print(f'name: {person.name}, type: {type(person.name)}')
print(f'age: {person.age}, type: {type(person.age)}')
1 validation error for Person
name
  Input should be a valid string [type=string_type, input_value=12, input_type=int]
    For further information visit https://errors.pydantic.dev/2.3/v/string_type
person = Person(name="John Doe", age='thirty')
print(f'name: {person.name}, type: {type(person.name)}')
print(f'age: {person.age}, type: {type(person.age)}')
1 validation error for Person
age
  Input should be a valid integer, unable to parse string as an integer [type=int_parsing, input_value='thirty', input_type=str]
    For further information visit https://errors.pydantic.dev/2.3/v/int_parsing

loading from json #

serializing to json #

validation #

Knockout City™

Steam achievements and progress for Knockout City™ - 2.0% complete with 1/50 achievements unlocked.

5 min

Badger

Steam achievements and progress for Badger - 12.5% complete with 5/40 achievements unlocked.

6 min

Frozen Flame

Steam achievements and progress for Frozen Flame - 6.25% complete with 2/32 achievements unlocked.

4 min

MultiVersus

Steam achievements and progress for MultiVersus - 53.57% complete with 15/28 achievements unlocked.

5 min

useful btrfs tools

disk usage # Looking at disk usage on any of these must be done using a tool built for it if you want an accurate measurement. General purpose tools like du will be inaccurate as they do not count things like duplicate copies in snapshots. -T for tabular format mounting the drive # mounting a snapshot # snapper # btdu # btrfs-assistant #
1 min read

Subnautica

Steam achievements and progress for Subnautica - 5.88% complete with 1/17 achievements unlocked.

4 min

Poly Bridge

Steam achievements and progress for Poly Bridge - 9.09% complete with 2/22 achievements unlocked.

4 min

devops philosophy

How to keep a secret - https://changelog.com/shipit/58 Kelsey Heightower Fundamentals - https://changelog.com/shipit/44 What does good devops look like - https://changelog.com/shipit/28 Docs are not optional - https://changelog.com/shipit/17 Dave Farley the foundations of Continuous Delivery - https://changelog.com/shipit/5

Steep

Steam achievements and progress for Steep - 0.0% complete with 0/41 achievements unlocked.

5 min