Merge pull request #1 from NoahSaso/add-ts-reagents

Scrape reagent info from TripSit
This commit is contained in:
Noah Saso 2021-06-24 20:19:36 -07:00 committed by GitHub
commit c26210d0bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -11,6 +11,7 @@ Script to merge data from PsychonautWiki API + pages and TripSit factsheets into
| `aliases` | `string[]` | List of aliases (lowercase) | Both | | `aliases` | `string[]` | List of aliases (lowercase) | Both |
| `aliasesStr` | `string` | Comma-separated list of aliases (for fuzzy searching) | Both | | `aliasesStr` | `string` | Comma-separated list of aliases (for fuzzy searching) | Both |
| `summary` | `string` | Substance summary | TripSit | | `summary` | `string` | Substance summary | TripSit |
| `reagents` | `string` | Reagent test kit reactions | TripSit |
| `classes` | `null` \| `Dictionary` | Substance classifications | PsychonautWiki | | `classes` | `null` \| `Dictionary` | Substance classifications | PsychonautWiki |
| `classes.chemical` | `string[]` | Chemical classifications | PsychonautWiki | | `classes.chemical` | `string[]` | Chemical classifications | PsychonautWiki |
| `classes.psychoactive` | `string[]` | Psychoactive classifications | PsychonautWiki | | `classes.psychoactive` | `string[]` | Psychoactive classifications | PsychonautWiki |

View File

@ -375,6 +375,10 @@ for name in all_substance_names:
if not len(summary): if not len(summary):
summary = None summary = None
test_kits = ts_properties.get('test-kits', '').strip()
if not len(test_kits):
test_kits = None
ts_bioavailability_str = ts_properties.get('bioavailability', '').strip() ts_bioavailability_str = ts_properties.get('bioavailability', '').strip()
ts_bioavailability = {} ts_bioavailability = {}
if len(ts_bioavailability_str): if len(ts_bioavailability_str):
@ -486,6 +490,7 @@ for name in all_substance_names:
'aliases': list(aliases), 'aliases': list(aliases),
'aliasesStr': ','.join(aliases), 'aliasesStr': ','.join(aliases),
'summary': summary, 'summary': summary,
'reagents': test_kits,
'classes': classes, 'classes': classes,
'toxicity': toxicity, 'toxicity': toxicity,
'addictionPotential': addiction_potential, 'addictionPotential': addiction_potential,