GithubHelp home page GithubHelp logo

isabella232 / regulations-stub Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cfpb/regulations-stub

0.0 0.0 0.0 520.28 MB

(DEPRECATED) Output from CFPB's regulations-parser

Home Page: http://cfpb.github.io/eRegulations/

License: Creative Commons Zero v1.0 Universal

Python 96.87% Shell 3.13%

regulations-stub's Introduction

regulations-stub

eRegulations is a web-based tool that makes regulations easier to find, read and understand with features such as inline official interpretations, highlighted defined terms, and a revision comparison view.

eRegs is made up of three core components:

This repository contains JSON that corresponds to CFPB regulations that have been parsed by regulations-parser and which can be loaded into regulations-core with the scripts included in this responsitory. This allows a working eRegulations setup to be created without needing to run the parser.

To get the rest of the eRegulations stack up and working, please see the regulations-bootstrap repository.

Requirements

Requirements for the send_to.py script can be satisfied with pip:

$ pip install -r requirements.txt

Usage

This repository includes a send_to.py script which can send the JSON in the stub folder to either a running instance of regulations-core or to an Amazon S3 bucket. It can send either all of the JSON for a particular regulation or a single JSON file.

send_to.py requires one of the following options that specify where the JSON should be sent:

It requires one of the following options that specify what JSON should be sent:

  • -r, --regulation: The specific regulation part number to upload (eg. 1026).
  • -f, --files: Specific JSON files to upload.

If you want to send JSON that does not live in the same directory as the send_to.py script you can specify that:

  • -s, --stub-base: The base filesystem path for the JSON to be sent (default: ./stub).

Sending a regulation to regulations-core

To send a particular regulation to a running regulations-core instance, you can use the send_to.py from the root of regulations-stub like so:

./send_to.py -a http://localhost:7000 -r 1005

This will look in the stub/ subfolder of regulations-stub for all JSON files related to the regulation with part number 1005 (CFPB Regulation E) and upload them to regulations-core running at http://localhost:7000.

Sending a regulation to S3

To send a particular regulation to an Amazon S3 bucket you will need to create the S3 bucket and then set the environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY with the appropriate accesss credentials. Then you can use the send_to.py from the root of regulations-stub like so:

./send_to.py -b a-regulations-bucket -r 1005

This will look in the stub/ subfolder of regulations-stub for all JSON files related to the regulation with part number 1005 (CFPB Regulation E) and upload them to the S3 bucket named a-regulations-bucket.

Sending specific JSON files

To send a specific JSON file or files, you can use send_to.py like so:

./send_to.py -a http://localhost:7000 -f regulation/1005/2011-31725

This will send the file regulation/1005/2011-31725 in the stub/ subfolder of regulations-stub to the regulations-core API running at http://localhost:7000.

Configuring regulations-parser

To write new JSON files to regulations-stub, you'll need to configure regulations-parser accordingly. This is relatively straight-forward; modify API_BASE and OUTPUT_DIR in regulations-parser's local_settings.py file like so:

API_BASE=""
OUTPUT_DIR="../regulations-stub/stub"

With the path to regulations-stub in OUTPUT_DIR reflecting its actual location on the filesystem. API_BASE can also be commented-out entirely by placing a # in front of it.

Open source licensing info

  1. TERMS
  2. LICENSE
  3. CFPB Source Code Policy

regulations-stub's People

Contributors

anselmbradford avatar ascott1 avatar chosak avatar contolini avatar cwdavies avatar grapesmoker avatar hillaryj avatar marcesher avatar scotchester avatar virtix avatar willbarton avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.