bdheath / Big-Cases

The basic code behind the @big_cases Twitter bot
107 stars 20 forks source link

JSON plz #5

Closed knowtheory closed 6 years ago

knowtheory commented 6 years ago

produce a JSON list of all the cases so that i can use and abuse the list for other nefarious purposes.

eyeseast commented 6 years ago

Might be useful to store cases as a CSV, for easier editing (and diffing), and then turn that into JSON or whatever else.

knowtheory commented 6 years ago

@eyeseast yeah, that's a change that will require semantic decision making, so we should just harass @bdheath about it.

The case numbers for SCOTUS and the other courts appear to be different (which is why i presume they're in separate lists). I assume there's a reason that they're kept in separate dicts, so i wouldn't want to just jam them all in the same CSV. I don't know if keeping them in two CSVs would be better.

Otherwise, yeah!

johnhawkinson commented 6 years ago

Format wars!

Because this data can contain commas

  { "name": "@CNN, @USATODAY et al. v. FBI (Comey memos)",
  "case_number":"1:17-cv-01167",
  "court":"D.D.C." }

CSV is probably not the optimal format (although it can work). I'd suggest TSV, e.g.:

D.D.C.  1:17-cv-01167   @CNN, @USATODAY et al. v. FBI (Comey memos)

But your milage may vary.

The case numbers for SCOTUS and the other courts appear to be different (which is why i presume they're in separate lists). I assume there's a reason that they're kept in separate dicts, so i wouldn't want to just jam them all in the same CSV. I don't know if keeping them in two CSVs would be better.

Well, the code currently doesn't do anything with the SCOTUS cases after loading them into cases_sct, and I've never seen @Big_Cases tweet a SCOTUS case, and the SCOTUS RSS implementation (if we can call it that) is structured totally differently. So in part they're probably in a different dict because they don't work :)