Skip to content

Repository files navigation

Hackspace API

An external-facing, FastAPI-based front-end for accessing some Leigh Hackspace data.

Settings

Env VarDefault ValueDescription
BASE_URLhttp://localhost:8000URL base where the application will be accessible at
PROMETHEUS_INSTANCEhttp://prometheus:9090Endpoint URL for the Prometheus instance
HOMEASSISTANT_INSTANCEhttp://homeassistant:8123Endpoint URL for the Home Assistant instance
HOMEASSISTANT_TOKENToken used to access the Home Assistant API
HACKSPACE_NAMELeigh HackspaceName of the hackspace
HACKSPACE_LOGO_URLhttps://raw.githubusercontent.com/leigh-hackspace/logos-graphics-assets/master/logo/rose_logo.svgURL to the logo for the hackspace
HACKSPACE_WEBSITE_URLhttps://leighhack.orgURL to the hackspace's website
HACKSPACE_ADDRESSLeigh Hackspace, Unit 3.14, 3rd Floor, Leigh Spinners Mill, Park Lane, Leigh, WN7 2LB, United KingdomFull address to the hackspace
HACKSPACE_OSM_NODE4300807520OpenStreetMap Node ID for the Hackspace's location
HACKSPACE_ADDRESS_LAT53.493497Latitude of the hackspace
HACKSPACE_ADDRESS_LON-2.493479Longitude of the hackspace
HACKSPACE_TIMEZONEEurope/LondonTimezone the hackspace is located in
HACKSPACE_OPEN_ENTITYbinary_sensor.hackspace_open_multiEntity ID of the Home Assistant device to indicate open status
HACKSPACE_PUBLIC_CALENDARcalendar.public_eventsThe entity ID of the Home Assistant public calendar
HACKSPACE_MEMBER_CALENDARcalendar.member_eventsThe entity ID of the Home Assistant member calendar
SENSORS_PRESSURE_ENABLEDFalseEnable pressure sensors
SENSOR_CONFIG_FILEsensors.yamlPath to the sensors configuration

Sensor Config File

An example can be found in sensors.yaml, and the details of the schema they're using can be found in hackspaceapi.models.sensors.

Endpoints

Hackspace API responds to Swagger docs requests at /docs.

/health

Simple health endpoint.

/space.json

Outputs a standard SpaceAPI endpoint.

/events

Dumps a JSON format list of events upcoming in the next 30 days.

/events.ics

Dumps a iCal format list of events upcoming in the next 30 days.

About

A FastAPI based public API for providing hackspace information

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages