{"id":13719465,"url":"https://github.com/peterhellberg/scb","last_synced_at":"2026-05-13T02:06:35.744Z","repository":{"id":8158917,"uuid":"9580105","full_name":"peterhellberg/scb","owner":"peterhellberg","description":"A small API client for the SCB API.","archived":false,"fork":false,"pushed_at":"2013-05-13T07:24:06.000Z","size":136,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-25T11:09:19.645Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/peterhellberg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-04-21T13:56:34.000Z","updated_at":"2022-07-14T07:19:22.000Z","dependencies_parsed_at":"2022-09-14T13:31:30.012Z","dependency_job_id":null,"html_url":"https://github.com/peterhellberg/scb","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/peterhellberg/scb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterhellberg%2Fscb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterhellberg%2Fscb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterhellberg%2Fscb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterhellberg%2Fscb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peterhellberg","download_url":"https://codeload.github.com/peterhellberg/scb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterhellberg%2Fscb/sbom","scorecard":{"id":728899,"data":{"date":"2025-08-11","repo":{"name":"github.com/peterhellberg/scb","commit":"35e0df8c9bcf9c2dccd92b762f37c431b39a38b6"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/12 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-22T13:48:57.009Z","repository_id":8158917,"created_at":"2025-08-22T13:48:57.009Z","updated_at":"2025-08-22T13:48:57.009Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32964445,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-12T23:30:32.555Z","status":"online","status_checked_at":"2026-05-13T02:00:07.132Z","response_time":115,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T01:00:49.316Z","updated_at":"2026-05-13T02:06:35.699Z","avatar_url":"https://github.com/peterhellberg.png","language":"Ruby","funding_links":[],"categories":["Misc"],"sub_categories":[],"readme":"# SCB\n\nA small API client for the SCB API.\n\nYou probably want to read the [API\\_beskrivning.pdf](http://www.scb.se/Grupp/OmSCB/Dokument/API-beskrivning.pdf) (in Swedish)\n\n[![Build Status](https://travis-ci.org/peterhellberg/scb.png?branch=master)](https://travis-ci.org/peterhellberg/scb)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'scb'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install scb\n\n## Usage\n\nIt is probably a good idea to take a look in `specs`\n\nConfiguration of the API client is done automatically, but it is also possible to manually compose the objects:\n\n```ruby\n# Manual composition\nconfig = SCB::API.config.new\napi    = SCB::API.new(config)\ndb     = SCB::DB.new(api)\ntable  = db.table('ProdbrEl')\n\n# Short form\ntable = SCB.table('ProdbrEl')\n\n# Liquid renewable energy in 2009\ntable.query Bransle: 925, Tid: 2009\n```\n\n### Configuration\n\nNothing needs to be configured out of the box, but you can change the\n`api_host`, `api_name`, `api_version`, `language`, `database`, \n`http_client` and `json_parser` settings like this:\n\n```ruby\n# English config\nconfig = SCB::API::Config.new do |c|\n  c.language = 'en'\nend\n\n# You can also pass a block straight to SCB.api\nSCB.api { |c| c.api_host = 'scb.test' } \n```\n\n### Database\n\nThe database is divided into levels/sub-levels and tables.\n\nThe default language is 'sv' but there is also some data unde 'en'\n\n```ruby\ndb = SCB.db\n\n# The names of All the top levels\ndb.levels.map(\u0026:name)\n\n# The English title of LonArb07Privat\nSCB.db.en.table('LonArb07Privat').title\n```\n\n### Level\n\nThe database levels can contain sub-levels or tables. You are probably\nmore interested in the actual tables and their data. \n\n```ruby\n# All the levels below BO\nSCB.level('BO').levels\n\n# All the tables below HE0110A\nSCB.level('HE0110A').tables\n```\n\n### Table\n\nThis is probably where you want to spend most of your time.\n\nYou can ask the table for possible variables in order to construct your query. I’ve implemented a simplified query format along the lines: `Key: value` where value is automatically turned into an Array if you only want a single value.\n\n*Note:* Each value is also turned into a string.\n\n```ruby\n# Database table containing data on electricity production\ntable = SCB.table('EltillfM')\n\n# URI to the API endpoint for the table\ntable.uri\n\n# The variable codes for the table\ntable.variables.map(\u0026:code)\n\n# Query: Wind production in January and February of 2013\ntable.query Prodslag: \"Vind\", Tid: [\"2013M01\", \"2013M02\"]\n\n# Usage of the Internet\ntable = SCB.table('LE0108T05')\n\ntable.query Tid: 2012, Dem: \"25-34\"\n\n# You can also get the result as a png\nfilename = '/tmp/internet_usage_2011.png'\nquery    = { AnvOmr: 80, Tid: 2011, ContentsCode: \"LE0108A2\" }\n\ntable.write_png_query(filename, query)\n```\n*Note:* `write_png_query` will not overwrite existing files.\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterhellberg%2Fscb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeterhellberg%2Fscb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterhellberg%2Fscb/lists"}