OHGO Wrapper
One of the problems I have with a lot of my Open Source projects is the code tends to be difficult to use in other projects because the classes end up blending into each other until it makes zero sense to pull out any of the code. So, for a project I'm working on I made concerted effort to abstract the code enough to be useful to other people.
This is a wrapper for the Ohio Department of Transportation's OHGO API. The API is a JSON REST API that provides access to traffic cameras, weather sensors, incidents, closures, and delays in the state of Ohio. I found a fantastic guidethat goes through the basic process of organizing a wrapper. And I was able to turn it into a useful package that I published on pypi.
Getting started with the wrapper is simple, for example this is how you grab images from a traffic camera (after you install via pip):
from ohgo import OHGOClient
client = OHGOClient('your-api-key')
cameras = client.get_cameras() # -> Returns a list of first 500 cameras in Ohio, pass in a QueryParams object with page_all=True to get all cameras
# Or if you prefer to get a specific group of cameras we can filter it further
from ohgo.models import QueryParams
from ohgo.types import Region
params = QueryParams(region=Region.COLUMBUS) # -> Returns a list of cameras in Columbus
cameras = client.get_cameras(params)
# Now we can get the image from the camera
camera = cameras
[0]image = client.get_images(camera) # -> Returns a list of PIL images from the camera
Something I didn't know before this, is that we can overload functions in python3 (so they behave differently depending on the arguments passed in). So, I used that to make the get_image
and get_images
functions behave differently depending on if you pass in a Camera, CameraView, or a DigitalSign object.
That guide also led me to the Quicktype website which lets you pass in JSON, and it will generate a Python class for you (or nearly any other language) that matches the provided JSON.
I also wanted to build a small demo for the wrapper, so I made a Mastodon api compatible bot that posts a random traffic camera image every hour which you can find here: @ohgo@tomkahe.com
GitHub - TomCasavant/ohgo-mastodon-example: Demo project that utilizes ohgo python wrapper
Demo project that utilizes ohgo python wrapper. Contribute to TomCasavant/ohgo-mastodon-example development by creating an account on GitHub.GitHub
Tom reshared this.
I just released a demo for my game! It's a nuisance-filled wizard sim that can be played single or multiplayer. :) If it looks interesting, feel free to check out the link! Gamer Threads
store.steampowered.com/app/328…
Secret Agent Wizard Boy and the International Crime Syndicate Demo on Steam
Secret Agent Wizard Boy must go undercover to topple Grumblemort's evil crime syndicate, hidden beneath his wizarding school. Learn spells, engage in espionage, and spread utter lore-unfriendly chaos.store.steampowered.com
Tom reshared this.
One of the best aspects of itch.io is the massive library of homebrew games for ancient computers and consoles.
And a lot of these games are free too.
You can find new games for practically everything: NES, C64, CoCo, DOS, GBC. It’s riveting stuff.
Download the latest indie games
itch.io is a simple way to find, download and distribute indie games online. Whether you're a developer looking to upload your game or just someone looking for something new to play itch.io has you covered.itch.io
Echoes of Wisdom started as a Zelda dungeon editor game
A new interview with The Legend of Zelda: Echoes of Wisdom developers revealed that it started as a game with dungeon editing.Ana Diaz (Polygon)
Tom reshared this.