GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - devmaximilian/Statistics: A wrapper for Statistics Sweden's Open Data API in Swift.

This repository was archived by the owner on Jul 19, 2023. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

98 Commits
98 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
Sources/Statistics
Sources/Statistics
 
 
Tests/StatisticsTests
Tests/StatisticsTests
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
Package.swift
Package.swift
 
 
README.md
README.md
 
 

Repository files navigation

Statistics

Statistics is a Swift package for interacting with Statistics Sweden's Open Data API.

Swift


Installation

Statistics is available through Swift Package Manager. To install it, simply include it in your package dependency list:

dependencies: [
    .package(url: "https://github.com/devmaximilian/Statistics.git", from: "1.0.0"),
]

– alternatively using Xcode via File > Swift Packages > Add Package Dependency...

Usage

Fetch topics by subject area 🗃

let client = Statistics.defaultClient

// Get root navigation structure
client.navigationPublisher(for: .root)
    .assertNoFailure()
    .map(\.text)
    .sink { links in {
        print(links) // -> ["Labour market", "Population", ...]
    }

Retrieve filtered statistics by a given subject 📊

// Get table (population by region, only total population)
client.tablePublisher(for: "BE0101A", subject: "BefolkningNy")
    .configureRequest { builder in
        builder.select("BE0101N1")
            .filter("Region", by: "00")
    }
    .assertNoFailure()
    .sink { table in {
        print(table) // -> Table...
    }

Only want/need data within a given interval? 📅

// Get table (population by region, only total population between 1970 – 1980)
client.tablePublisher(for: "BE0101A", subject: "BefolkningNy")
    .configureRequest { builder in
        builder.select("BE0101N1")
            .filter("Region", by: "00")
            .between("1970", "1980")
    }
    .assertNoFailure()
    .sink { table in {
        print(table) // -> Table...
    }

Legal disclaimer

The developer and this package are not affiliated with or endorsed by Statistics Sweden. Any products and services provided through this package are not supported or warrantied by Statistics Sweden.

License

See LICENSE for license details concerning this package. Read more about using Statistics Sweden's Open Data API here for details concerning the data provided by their API and license information.

About

A wrapper for Statistics Sweden's Open Data API in Swift.

Topics

combineiosscbstatisticsstatistics-swedenswiftswiftpmwrapper

Resources

Readme
MIT license
Activity

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.