Skip to content

An NPM package & front-end playground to ingest data from the City of Seattle, typed with TypeScript and available for consumption.

License

Notifications You must be signed in to change notification settings

mikhael28/seattle-open-json

Seattle Open JSON

πŸ™οΈ A community-driven, hopefully one-day comprehensive collection of JSON data about youth initiatives, community resources, and recreational opportunities in the Seattle area.

πŸ“‹ Overview

Seattle Open JSON provides structured, machine-readable information about youth initiatives, community resources, and recreational opportunities in the Seattle area. This package includes both raw data and TypeScript interfaces for type-safe development. If you fork this repository, you will notice a 'react-playground' directory; by running npm install and npm run dev, you can open visual playground to help explore the data we have collected thus far. It is incomplete, and not adequately cleaned up yet, but it is a starting point. I hope that the City of Seattle can take some inspiration towards forking this, or simply looking at it, and putting together their own npm module to enable developers to build on top of their data. In particular, creating a tree view of the structure of government, and it's available resources and programs, would allow developers to adequately present those resources to make them more discoverable to the general public.

Seattle Open JSON

πŸš€ NPM Package Installation

npm install seattle-open-json

πŸ“Š Data Collections

This package contains 11 datasets with detailed information about Seattle's community resources, originally taken from the city of Seattle, the Emerald City Resource Guide, and some scraped data from City of Seattle websites.:

Dataset Records Description
Community Centers 27+ Seattle Parks & Recreation community centers with schedules, amenities, and contact info
Farmers Markets 20+ Local farmers markets with locations, schedules, and vendor information
Parks Catalog 400+ Complete catalog of Seattle parks with facilities and amenities
Mobile Recreation 150+ Mobile recreation programming across Seattle neighborhoods
P-Patch Gardens 90+ Community gardens with plot information and contact details
Picnic Sites 200+ Reservable picnic areas with capacity and amenities
Public Spaces 40+ Privately-owned public spaces available for community use
Youth Programs 1000+ Comprehensive youth programs, activities, and opportunities
Emerald City Guide 1400+ Community resources and services directory
HSDS Example 1 Human Services Data Specification compliant organization data

πŸ”§ Usage

Basic Import

import seattleData from "seattle-open-json";

// Access all data
console.log(seattleData.data);

// Access specific collections
console.log(seattleData.data.communityCenters);
console.log(seattleData.data.youthPrograms);

// Access metadata
console.log(seattleData.metadata);

Named Imports

import {
  communityCenters,
  farmersMarkets,
  youthPrograms,
  packageMetadata,
} from "seattle-open-json";

// Use individual collections
const activeCenters = communityCenters.filter(
  (center) => center["Open Status"] === "Open"
);

const weekendMarkets = farmersMarkets.filter(
  (market) =>
    market.ACTIVEDAY.includes("Saturday") || market.ACTIVEDAY.includes("Sunday")
);

Categorized Access

import { recreationOpportunities, communityResources } from "seattle-open-json";

// Recreation-focused data (community centers, parks, mobile programming)
const recreationData = recreationOpportunities;

// Community resources (farmers markets, P-patches, youth programs, etc.)
const communityData = communityResources;

πŸ“ TypeScript Interfaces

Core Data Types

// Youth Programs
interface YouthProgram {
  id: string;
  organizationName: string;
  programDescription: string;
  activityName: string;
  activityDescription: string;
  location: string;
  ageRange: string;
  dates: string;
  day: string;
  times: string;
  cost: string;
  url: string;
  lastUpdated: string;
}

// Community Centers
interface CommunityCenter {
  OBJECTID: number;
  name: string;
  Address: string;
  "Short Name": string;
  "CC Phone Number": string;
  "Open Status": string;
  "Scheduling Season": string;
  // ... additional schedule and amenity fields
}

// Farmers Markets
interface FarmersMarket {
  OBJECTID: number;
  NAME: string;
  LOCATION: string;
  ORGANIZATI: string;
  ACTIVEDAY: string;
  MONTHS: string;
  HOURS: string;
  WEBSITE: string;
  PHONE: string;
  x: number;
  y: number;
}

// Community Resources
interface EmeraldCityResourceGuide {
  name: string;
  website?: string;
  phone?: string;
  address?: string;
  hours?: string;
  description: string;
  categories: string[];
}

HSDS (Human Services Data Specification) Types

For organizations following the HSDS standard:

import {
  Organization,
  Service,
  Location,
  Contact,
  Program,
  Schedule
} from "seattle-open-json";

// Fully compliant HSDS organization structure
const organization: Organization = {
  id: string;
  name: string;
  description: string;
  email?: string;
  website?: string;
  // ... additional HSDS fields
};

Using HSDS Mock Data

import {
  seattleYouthHSDSExample,
  programs,
  services,
  locations,
  contacts,
} from "seattle-open-json";

// Access complete HSDS dataset
console.log(seattleYouthHSDSExample.organization);
console.log(seattleYouthHSDSExample.services);

// Access individual HSDS collections
const youthPrograms = programs.filter((program) =>
  program.name.toLowerCase().includes("youth")
);

const contactInfo = contacts.find(
  (contact) => contact.name === "Program Director"
);

// Find services by location
const seattleServices = services.filter((service) =>
  locations.some(
    (location) => location.id === service.id && location.city === "Seattle"
  )
);

🎯 Common Use Cases

Finding Youth Programs by Age

import { youth_programs } from "seattle-open-json";

const teenPrograms = youth_programs.filter(
  (program) =>
    program.ageRange.includes("13") ||
    program.ageRange.includes("teen") ||
    program.ageRange.includes("14-18")
);

Finding Open Community Centers

import { communityCenters } from "seattle-open-json";

const openCenters = communityCenters.filter(
  (center) => center["Open Status"] === "Open"
);

const centersWithGyms = communityCenters.filter(
  (center) => center["Gym"] === "Yes"
);

Finding Weekend Activities

import { farmersMarkets, mobileRecreationProgramming } from "seattle-open-json";

const weekendMarkets = farmersMarkets.filter(
  (market) =>
    market.ACTIVEDAY.toLowerCase().includes("saturday") ||
    market.ACTIVEDAY.toLowerCase().includes("sunday")
);

const weekendRecreation = mobileRecreationProgramming.filter(
  (program) =>
    program["Day of Week"].includes("Saturday") ||
    program["Day of Week"].includes("Sunday")
);

Searching Community Resources

import { emeraldCityResourceGuide } from "seattle-open-json";

const mentalHealthResources = emeraldCityResourceGuide.filter((resource) =>
  resource.categories.some(
    (category) =>
      category.toLowerCase().includes("mental health") ||
      category.toLowerCase().includes("counseling")
  )
);

const foodResources = emeraldCityResourceGuide.filter((resource) =>
  resource.categories.some(
    (category) =>
      category.toLowerCase().includes("food") ||
      category.toLowerCase().includes("nutrition")
  )
);

πŸ—‚οΈ Available Exports

Data Collections

  • communityCenters - Seattle community centers
  • farmersMarkets - Local farmers markets
  • parksCatalog - Complete parks catalog
  • mobileRecreationProgramming - Mobile recreation programs
  • pPatch - Community gardens
  • picnicSites - Reservable picnic areas
  • privatelyOwnedPublicSpaces - POPS locations
  • youth_programs - Youth programs and activities
  • emeraldCityResourceGuide - Community resources directory
  • seattleYouthOrganization - HSDS example organization

HSDS Mock Data Collections

Complete HSDS-compliant example data for testing and development:

  • programs - Example youth programs
  • services - Detailed service offerings
  • locations - Physical locations and addresses
  • serviceAtLocations - Service-location relationships
  • contacts - Contact information
  • taxonomyTerms - Service categorization
  • attributes - Additional service attributes
  • costOptions - Pricing information
  • requiredDocuments - Required documentation
  • organizationIdentifiers - Organization IDs
  • serviceCapacities - Capacity information
  • metadataRecords - Data provenance
  • taxonomies - Taxonomy definitions
  • metaTableDescriptions - Schema descriptions
  • phoneNumbers - Phone contact details
  • addresses - Physical addresses
  • schedules - Operating schedules
  • languages - Supported languages
  • accessibilityFeatures - Accessibility information
  • serviceAreas - Geographic coverage
  • additionalUrls - Additional web resources
  • fundingSources - Funding information
  • seattleYouthHSDSExample - Complete HSDS dataset

Aggregated Collections

  • allSeattleData - All datasets combined
  • recreationOpportunities - Recreation-focused data
  • communityResources - Community service data
  • allOpportunities - All opportunities combined

TypeScript Types

All interfaces are exported for type-safe development:

  • Core data types: YouthProgram, CommunityCenter, FarmersMarket, etc.
  • HSDS types: Organization, Service, Location, Contact, etc.

Metadata

  • packageMetadata - Package information and statistics

πŸ“ˆ Package Statistics

import { packageMetadata } from "seattle-open-json";

console.log(packageMetadata.totalRecords);
// {
//   communityCenters: 27,
//   farmersMarkets: 23,
//   parksCatalog: 485,
//   mobileRecreationProgramming: 156,
//   pPatch: 91,
//   picnicSites: 201,
//   privatelyOwnedPublicSpaces: 40,
//   youth_programs: 1105,
//   emeraldCityResourceGuide: 1421,
//   total: 2018
// }

🀝 Contributing

This is a community-driven project! We welcome contributions to:

  • Add new data sources
  • Improve data quality
  • Enhance TypeScript definitions
  • Add utility functions

πŸ“„ License

MIT License - see LICENSE file for details.

πŸ”— Links


Built with ❀️ for the Seattle community by Michael Nightingale

About

An NPM package & front-end playground to ingest data from the City of Seattle, typed with TypeScript and available for consumption.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages