Giter Site home page Giter Site logo

openreferral / hsds-transformer Goto Github PK

View Code? Open in Web Editor NEW
11.0 7.0 5.0 388 KB

Convert data into valid Human Service Data Specification (HSDS) datapackages. (Produced by the Open Referral Initiative.)

License: MIT License

Ruby 99.20% Dockerfile 0.65% Shell 0.15%
hsds hsds-transformer human-services datapackage openreferral

hsds-transformer's Introduction

Open Referral

hsds-transformer's People

Contributors

abahel2 avatar awang302 avatar fieldbr2 avatar greggish avatar ktjgupta avatar nachiket-ml avatar robredpath avatar switzersc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

hsds-transformer's Issues

Turn into a gem

It would be useful to have this packaged and available as a gem so that it can be used in other projects as a dependency rather than solely as a microservice API or command line tool.

Add ability to append multiple input fields to one output column

We want to use multiple input fields in one output field. For example, in the services model in HSDS, there is an application_process text field. In our fixture input data, the services.csv contains multiple fields that are relevant for the application process: Application form link, Process for applying by email, Process for applying by phone``Process for applying online, Process for walk-ins. We should have a way to append all of these fields into a single output column.

This is what I'm thinking for an addition to services in mapping.yaml:

Process for applying by email
  model: services
  field: application_process
  append: true
Process for applying by phone
  model: services
  field: application_process
  append: true
Process for applying online
  model: services
  field: application_process
  append: true
Process for walk-ins
  model: services
  field: application_process
  append: true

and the append: true field indicates that these should be appended to the output field, so that all the above are added into the same text string in application_process.

Dockerize

Add a Dockerfile with the current ruby version and build steps (bundle install primarily).

Smart phone number creation

When we collect phone data from organizations, services, and locations, we're taking the whole field and putting it in the number column in the output phones.csv. This is a problem because the phone field might actually include extensions or other text. It would be great to at least parse out extensions in the number column and move them to the extension column.

See examples in this fixture: https://github.com/switzersc/open_referral_transformer/blob/master/spec/fixtures/output/resources/phones.csv

Add ability to specific output path

Right now everything gets piped to tmp after being transformed, including the results of the tests. This isn't great because files will get overwritten when tests or new transformations are run. We should give the user the ability to tell the transformer to what path their files should be sent.

Use datapackage-rb gem to infer and generate datapackage.json from transformed data

Right now we do not dynamically generate the datapackage.json file based on the contents of the transformed data directory, but we should. This is because transformed data may not include all HSDS models or fields, and may include additional custom fields, so using a static datapackage.json file would not be capture these idiosyncrasies. We want to use the datapackage-rb gem to do this, but this feature is not supported yet so is dependent on a PR to that gem to add the functionality. Once that's done, we can utilize the gem here to create the JSON file.

Add HTTP API to expose services

This should be a POST request that kicks off the OpenReferralTransformer class to process the provided files. The request can either be a multipart form request that streams that file contents to the API, or the request could reference the web URIs where the files live. If the latter, then the API needs to pass those URIs to the OpenReferralTransformer which should be able to get them during the transform process.

API Not Working (Using the API with Docker)

Using the API with Docker

Hosted the project on Docker & trying API "/transform" method POST from the postman, Getting an error "A mapping file is required".

I have added the
input_path : /spec/fixtures/base_transformer/input
mapping : /spec/fixtures/base_transformer/mapping.yaml

But still getting the error "A mapping file is required".

Fix the build

Build is failing on travis CI (though not locally), due to file reference issues. Should move to using the Fake File System gem for tests anyway, which should resolve the problem.

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.