open-demographics
open-demographics copied to clipboard
Machine readable format
In addition to standardized field names ( #1 ), it would be great if all of the questions/answers were in an easily parsable format. I have some ideas for gathering demographics in a secure way, and would much prefer to be able to just slurp up everything already defined here, rather than having to manage that myself.
Since everything else is JSON these days, maybe it could be in a form such as:
age.json
{ "id": "age", "title": "Age", "description": "The age of the person", "options": [ {"id": "0to14", "title": "0 to 14"}, {"id": "15to19", "title": "15 to 19"}, { "id": "20to60", "title": "20 to 60", "options": [ {"id": "20to39", "title": "20 to 39"}, {"id": "40to60", "title": "40 to 60"} ] } ] }
This structure allows for different levels of granularity. One potential use is allowing people to broadly identify with a group without having to identify with a specific sub-group. When consuming the results, it would make it easy to roll up the stats without having to separately define a connection between values.
I'm exhausted from the end of a convention, so half of what I said may make no sense ;)
Hi @rwohleb yes, this is great, thank you!! There have been some discussions of this offline - how can we enable form authors (who are also programmers) to just consume a json feed of the questions and then, theoretically, also stay up to date as questions evolve.
JSON is definitely what we'll end up using. As a first pass, can you suggest a way to structure this initiative in the issue queue?
I've started looking at what it would take to setup a PR for demonstration purposes. I'm currently trying to figure out how you are handling things between docs, doc-source, and gh-pages. Is there a README that I just happened to miss?
@rwohleb nope - you caught me not documenting. :)
pip install sphinx
pip install sphinxcontrib-bibtex
pip install guzzle_sphinx_theme
sphinx-build -b html doc-source docs
it's sphinx-build
that generates docs
from doc-source
I can add this to a readme if you can confirm that those steps work. :) that's all of the instances of sphinx
that I could find in my bash history.
Just wanted to chime in with a +1 for this issue. At DrupalCon Nashville I discussed this same idea briefly in the hallway with @drnikki and @sparklingrobots. Providing the questions and answers in JSON format would be incredibly helpful, and then my team over at Drupal.org can work on building a module to consume that for Drupal sites (and I can totally imagine other open source projects wanting to do the same).
Thanks for proposing this/moving it forward @rwohleb
Just a note to say that the DDI Contrib Team has been working on getting Gender Field module up for D8, which we are tying to OpenDemographics. Right now the module has a manually created version of the OpenDemographics data, but our goal is to build the module to consume this data.
We're quite close to getting this module out into beta and I think it would be swell if we could work together with you & the OpenDemographics folks to get this work done. I confess we already registered the namespace on d.o for OpenDemographics in anticipation of this work. :)
Posted this on the d.o issue queue as well.
Thanks for the update @sparklingrobots! I'll get caught up on the Gender Field module work and start following the OpenDemographics project queue on D.O.
I love the idea of there being a machine readable format.
I wonder if the full JSON response couldn't just be an endpoint of an HTTP request that is the latest released version on a static github pages URL, perhaps with a custom domain? That way, it would be easy to make that list available to anything that speaks HTTP (including mobile phone apps) while including versioning as well. Might be a good idea to have a separate repo for that? Perhaps even something that is owned by an open-demographics org? There's lots to unpack here... and maybe brainstorming it here is the wrong place, so I'm happy to do it elsewhere too.
Hi all,
First, as always, thank you for participating in this! I think what makes the most sense as a next step is to agree on a data structure that would account for all questions and be extensible for the future. I've started a ticket for that here: https://github.com/drnikki/open-demographics/issues/38
@rwohleb (can't tag you in #38 for some reason), but I did a pass on this and would love your feedback since you kicked it off (others too - @ivanstegic, @sparklingrobots <3 ) Thanks, all, for your continued help with this.