The project is in a healthy, maintained state
Importer for BIPM CGPM and CIPM content
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 13.0
~> 3.0
~> 1.21
>= 0
>= 0

Runtime

>= 0
~> 1.1
 Project Readme

BIPM data importer for CIPM and CGPM outcomes

Purpose

Provides a single executable, bipm-fetch, that fetches BIPM committee outcomes (CIPM, CGPM, and the consultative committees) from the official BIPM website into a local YAML tree.

The gem also exposes a Ruby library API for programmatic use.

Command-line usage

Fetch every body, every language:

$ bipm-fetch

Fetch a single body (any of: ccauv, ccem, ccl, ccm, ccpr, ccqm, ccri, cct, cctf, ccu, cgpm, cipm, jcgm, jcrb):

$ bipm-fetch --body=cgpm

Restrict to one language (en or fr):

$ bipm-fetch --body=cgpm --language=fr

Run each body in a forked child process (parallel):

$ bipm-fetch --fork

Show help:

$ bipm-fetch --help

The default output directory is ./data. Each body writes a data/<body>/meetings-{en,fr}/meeting-<id>.yml tree.

Library usage

require "bipm/data/importer"

agent = Mechanize.new
Bipm::Data::Importer.fetch(:cgpm).call(agent:, base_dir: "data")
Bipm::Data::Importer.fetch(:cipm, languages: %w[en]).call(agent:, base_dir: "data")

# All bodies:
Bipm::Data::Importer.fetch_all.each { |f| f.call(agent:, base_dir: "data") }

To read produced outcomes back:

require "bipm/data/outcomes"

Bipm::Data::Outcomes[:cgpm][:en].meetings.first.resolutions.values.first.actions

Cassettes (test fixtures)

Network requests are replayed from cassettes/ (VCR). The CGPM scraper hits post-SPA URLs that have no cassettes and runs against the live site.

To refresh cassettes:

$ BIPM_VCR_RECORD=all bundle exec rspec
$ BIPM_VCR_RECORD=new_episodes bundle exec rspec

License

Copyright Ribose. MIT license.