From b0294633bb4566f29a3b75b9a25fcd6476794fe9 Mon Sep 17 00:00:00 2001 From: jarbasal Date: Thu, 18 Jun 2020 22:07:50 +0100 Subject: [PATCH] . --- examples/catterpillar.py | 8 --- pysychonaut/__init__.py | 117 ++++++++----------------------------- readme.md | 123 +++++++++++++++++++++++++++++++++++---- requirements.txt | 3 + setup.py | 4 +- 5 files changed, 140 insertions(+), 115 deletions(-) delete mode 100644 examples/catterpillar.py create mode 100644 requirements.txt diff --git a/examples/catterpillar.py b/examples/catterpillar.py deleted file mode 100644 index 4918de4..0000000 --- a/examples/catterpillar.py +++ /dev/null @@ -1,8 +0,0 @@ - -from pysychonaut import AskTheCaterpillar - -print(AskTheCaterpillar.ask_the_caterpillar("what are the effects of lsd")) - -""" -Effects reported for Lsd are: visual distortions, a sense of childlike wonder, brightening of colors,racing thoughts, hue shifts, euphoria, anxiety, and confusion -""" \ No newline at end of file diff --git a/pysychonaut/__init__.py b/pysychonaut/__init__.py index 77e2c8b..a3a0c61 100644 --- a/pysychonaut/__init__.py +++ b/pysychonaut/__init__.py @@ -1,13 +1,14 @@ -import requests from bs4 import BeautifulSoup import random import json - - -__author__ = "jarbasAI" +from requests_cache import CachedSession +from datetime import timedelta class Erowid: + session = CachedSession(backend='memory', + expire_after=timedelta(hours=24)) + drug_slang = { 'marijuana': "thc", 'hashish': "thc", 'hash': "thc", 'weed': "thc", 'marijjuana': "thc", 'cannabis': "thc", 'benzo fury': '6-apb', 'l': 'lsd', @@ -62,8 +63,8 @@ class Erowid: @staticmethod def _extract_list(base_url): - response = requests.get(base_url).text - soup = BeautifulSoup(response, "lxml") + response = Erowid.session.get(base_url).text + soup = BeautifulSoup(response, "html.parser") table = soup.find('table', {'class': 'topic-chart-surround'}) categories = table.find_all("tr", {'class': 'topic-surround'})[1:] fields = [] @@ -84,10 +85,10 @@ class Erowid: data = {"exp_id": exp_id, "url": url} try: - response = requests.get(url).text + response = Erowid.session.get(url).text experience = Erowid.extract_experience_text(response) - soup = BeautifulSoup(response, "lxml") + soup = BeautifulSoup(response, "html.parser") name = soup.find('div', {'class': 'title'}).getText().strip() author = soup.find('div', {'class': 'author'}).getText().strip() drug = soup.find('div', {'class': 'substance'}).getText().strip().lower().replace("/", ", ") @@ -123,7 +124,7 @@ class Erowid: @staticmethod def get_categories(): base_url = 'https://erowid.org/experiences/exp_list.shtml' - response = requests.get(base_url).text + response = Erowid.session.get(base_url).text categories = [] for sub in response.split("")] @@ -166,8 +167,8 @@ class Erowid: if ".shtml" in base_url: base_url = "/".join(base_url.split("/")[:-1]) + "/" data = {"url": base_url} - response = requests.get(url).text - soup = BeautifulSoup(response, "lxml") + response = Erowid.session.get(url).text + soup = BeautifulSoup(response, "html.parser") data["name"] = soup.find('div', {'class': 'title-section'}).getText().strip().lower() picture = soup.find('div', {'class': "summary-card-topic-image"}).find("img") if picture: @@ -225,8 +226,8 @@ class Erowid: elif order is not None: url += "&OldSort=" + order - response = requests.get(url).text - soup = BeautifulSoup(response, "lxml") + response = Erowid.session.get(url).text + soup = BeautifulSoup(response, "html.parser") table = soup.find('table', {'class': "exp-list-table"}) table = table.find_all("tr", {'class': ""})[2:] reports = [] @@ -244,6 +245,8 @@ class Erowid: class PsychonautWiki: + session = CachedSession(backend='memory', + expire_after=timedelta(hours=24)) drug_slang = { 'marijuana': "thc", 'hashish': "thc", 'hash': "thc", 'weed': "thc", 'marijjuana': "thc", 'cannabis': "thc", 'benzo fury': '6-apb', 'l': 'lsd', @@ -328,13 +331,13 @@ class PsychonautWiki: substance = s url = "https://api.psychonautwiki.org/?query=%7B%0A%20%20%20%20substances(query%3A%20%22" + substance + "%22)%20%7B%0A%20%20%20%20%20%20%20%20name%0A%0A%20%20%20%20%20%20%20%20%23%20routes%20of%20administration%0A%20%20%20%20%20%20%20%20roas%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20name%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20dose%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20units%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20threshold%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20heavy%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20common%20%7B%20min%20max%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20light%20%7B%20min%20max%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20strong%20%7B%20min%20max%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20duration%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20afterglow%20%7B%20min%20max%20units%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20comeup%20%7B%20min%20max%20units%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20duration%20%7B%20min%20max%20units%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20offset%20%7B%20min%20max%20units%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20onset%20%7B%20min%20max%20units%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20peak%20%7B%20min%20max%20units%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20total%20%7B%20min%20max%20units%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20bioavailability%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20min%20max%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20%20%23%20subjective%20effects%0A%20%20%20%20%20%20%20%20effects%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20name%20url%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%7D" - return json.loads(requests.get(url).text)["data"] + return json.loads(PsychonautWiki.session.get(url).text)["data"] @staticmethod def get_substance_list(): base_url = "https://psychonautwiki.org/wiki/Summary_index" - response = requests.get(base_url).text - soup = BeautifulSoup(response, "lxml") + response = PsychonautWiki.session.get(base_url).text + soup = BeautifulSoup(response, "html.parser") table = soup.findAll('div', {'class': 'panel radius'}) substances = [] @@ -356,8 +359,8 @@ class PsychonautWiki: @staticmethod def get_substance_data(): base_url = "https://psychonautwiki.org/wiki/Summary_index" - response = requests.get(base_url).text - soup = BeautifulSoup(response, "lxml") + response = PsychonautWiki.session.get(base_url).text + soup = BeautifulSoup(response, "html.parser") table = soup.findAll('div', {'class': 'panel radius'}) substances = {} @@ -396,80 +399,6 @@ class PsychonautWiki: class AskTheCaterpillar: - drug_slang = { - 'marijuana': "thc", 'hashish': "thc", 'hash': "thc", 'weed': "thc", - 'marijjuana': "thc", 'cannabis': "thc", 'benzo fury': '6-apb', 'l': 'lsd', - 'x': 'mdma', 'speed': 'amphetamine', 'pepper oil': 'capsaicin', 'cpp': 'piperazines', - 'blow': 'cocaine', 'foxy': '5-meo-dipt', 'symmetry': 'salvinorin b ethoxymethyl ether', - 'nexus': '2c-b', 'tea': 'caffeine', 'robo': 'dxm', ' tussin': 'dxm', - 'methylethyltryptamine': 'met', 'it-290': 'amt', 'jwh-018': 'cannabinoids', - 'coffee': 'caffeine', 'mpa': 'methiopropamine', 'ergine': 'lsa', - 'harmine': 'harmala', 'mxe': 'methoxetamine', - '4-ho-met; metocin; methylcybin': '4-hydroxy-met', 'mdea': 'mde', - 'elavil': 'amitriptyline', 'bk-mdma': 'methylone', 'eve': 'mde', - 'a2': 'piperazines', 'dimitri': 'dmt', 'plant food': 'mdpv', 'dr. bob': 'dob', - 'doctor bob': 'dob', - 'mini thins': 'ephedrine', 'meth': 'methamphetamines', 'acid': 'lsd', - 'etc.': 'nbome', ' wine': 'alcohol', 'toad venom': 'bufotenin', ' methyl-j': 'mbdb', - 'krokodil': 'desomorphine', ' 5-hydroxy-dmt': 'bufotenin', ' 3-cpp': 'mcpp', - 'special k': 'ketamine', 'ice': 'methamphetamines', - 'nrg-1': 'mdpv', ' gravel': 'alpha-pvp', 'whippits': 'nitrous', 'g': 'ghb', - 'k': 'ketamine', ' harmaline': 'harmala', 'bob': 'dob', '4-ace': '4-acetoxy-dipt', - 'quaaludes': 'methaqualone', ' opium': 'opiates', 'u4ea': '4-methylaminorex', - 'meopp': 'piperazines', 'methcathinone': 'cathinone', 'horse': 'heroin', - 'haoma': 'harmala', 'unknown': '"spice" product', '4-b': '1,4-butanediol', - 'naptha': 'petroleum ether', 'beer': 'alcohol', 'bees': '2c-b', - '2c-bromo-fly': '2c-b-fly', 'flatliner': '4-mta', 'orexins': 'hypocretin', - "meduna's mixture": 'carbogen', 'bdo': '1,4-butanediol', - 'fatal meperedine-analog contaminant': 'mptp', 'piperazine': 'bzp', '4-ma': 'pma', - 'paramethoxyamphetamine': 'pma', 'eden': 'mbdb', 'theobromine': 'chocolate', - 'la-111': 'lsa', 'lysergamide': 'lsa', 'yaba': 'methamphetamines', - 'ethyl cat': 'ethylcathinone', 'stp': 'dom', '2c-c-nbome': 'nbome', - 'morphine': 'opiates', 'flakka': 'alpha-pvp', 'yage': 'ayahuasca', - 'ecstasy': 'mdma', 'ludes': 'methaqualone', 'golden eagle': '4-mta', - '4-mma': 'pmma', 'o-dms': '5-meo-amt', 'liquor': 'alcohol', - 'mephedrone': '4-methylmethcathinone', '1': '1,4-butanediol', 'phencyclidine': 'pcp', - 'crystal': 'methamphetamines', 'pink adrenaline': 'adrenochrome', - '4-mec': '4-methylethcathinone', 'green fairy': 'absinthe', 'laa': 'lsa', - 'cp 47': 'cannabinoids', 'paramethoxymethylamphetamine': 'pmma', - '5-meo': '5-meo-dmt', 'alpha': '5-meo-amt', 'mescaline-nbome': 'nbome', - '25c-nbome': '2c-c-nbome', 'flephedrone': '4-fluoromethcathinone', - 'bzp': 'piperazines', 'codeine': 'opiates', 'foxy methoxy': '5-meo-dipt', - '25i-nbome': '2c-i-nbome', '3c-bromo-dragonfly': 'bromo-dragonfly', 'mdai': 'mdai', - 'tfmpp': 'piperazines'} - def __init__(self): - self.substance_list = PsychonautWiki.get_substance_list() - - def fix_substance_names(self, sentence): - - words = sentence.lower().split(" ") - found = False - # check for drug slang names - for substance in self.drug_slang: - substance = substance.lower() - name = self.drug_slang[substance].strip() - for idx, word in enumerate(words): - if substance == word: - words[idx] = name - found = True - - # check substance list - for substance in self.substance_list: - substance = substance.lower() - for idx, word in enumerate(words): - if substance == word: - words[idx] = substance - found = True - - if found: - return " ".join(words) - # probably not talking about drugs - return found - - @staticmethod - def ask_the_caterpillar(query): - data = requests.post('https://www.askthecaterpillar.com/query', {"query": query}) - data = json.loads(data.text) - return data["data"]["messages"][0]["content"] - + raise RuntimeError("AskTheCaterpillar chatbot is no longer " + "maintained") diff --git a/readme.md b/readme.md index 0918104..c8cfdec 100644 --- a/readme.md +++ b/readme.md @@ -1,21 +1,122 @@ ## PySychonaut -Unofficial python api for [Erowid](http://erowid.org/), [PsychonautWiki](http://psychonautwiki.org/) and [AskTheCaterpillar](http://askthecaterpillar.com/) +Unofficial python api for [Erowid](http://erowid.org/) and [PsychonautWiki](http://psychonautwiki.org/) If you plan on scrapping erowid please read [How to Spider Erowid](https://erowid.org/general/about/about_archives1.shtml#howtospider) -only python3 is supported starting from version 0.5 - - -only python2 is supported previous to version 0.5 - - ## install - pip install pysychonaut - - +```bash +pip install pysychonaut +``` + ## usage -see examples folder \ No newline at end of file +#### PsychonautWiki + +```python +from pysychonaut import PsychonautWiki + +wiki = PsychonautWiki() + +print(wiki.search_psychonaut_wiki("lsd")) + +print(wiki.search_psychonaut_wiki("speed")) + +print(wiki.search_psychonaut_wiki("nfajsbguiajshb")) +""" +{u'substances': [{u'roas': [{u'duration': {u'comeup': {u'units': u'minutes', u'max': 90, u'min': 45}, u'onset': {u'units': u'minutes', u'max': 30, u'min': 15}, u'afterglow': {u'units': u'hours', u'max': 48, u'min': 12}, u'peak': {u'units': u'hours', u'max': 5, u'min': 3}, u'offset': {u'units': u'hours', u'max': 5, u'min': 3}, u'duration': None, u'total': {u'units': u'hours', u'max': 12, u'min': 8}}, u'bioavailability': {u'max': 71, u'min': 71}, u'name': u'sublingual', u'dose': {u'heavy': 300, u'light': {u'max': 75, u'min': 25}, u'units': u'\xb5g', u'common': {u'max': 150, u'min': 75}, u'threshold': 25, u'strong': {u'max': 300, u'min': 150}}}], u'effects': [{u'url': u'https://psychonautwiki.org/wiki/Spontaneous_physical_sensations', u'name': u'Spontaneous physical sensations'}, {u'url': u'https://psychonautwiki.org/wiki/Stimulation', u'name': u'Stimulation'}, {u'url': u'https://psychonautwiki.org/wiki/Nausea', u'name': u'Nausea'}, {u'url': u'https://psychonautwiki.org/wiki/Muscle_twitching', u'name': u'Muscle twitching'}, {u'url': u'https://psychonautwiki.org/wiki/Tactile_enhancement', u'name': u'Tactile enhancement'}, {u'url': u'https://psychonautwiki.org/wiki/Bodily_control_enhancement', u'name': u'Bodily control enhancement'}, {u'url': u'https://psychonautwiki.org/wiki/Difficulty_urinating', u'name': u'Difficulty urinating'}, {u'url': u'https://psychonautwiki.org/wiki/Increased_blood_pressure', u'name': u'Increased blood pressure'}, {u'url': u'https://psychonautwiki.org/wiki/Increased_heart_rate', u'name': u'Increased heart rate'}, {u'url': u'https://psychonautwiki.org/wiki/Perception_of_bodily_lightness', u'name': u'Perception of bodily lightness'}, {u'url': u'https://psychonautwiki.org/wiki/Physical_euphoria', u'name': u'Physical euphoria'}, {u'url': u'https://psychonautwiki.org/wiki/Pupil_dilation', u'name': u'Pupil dilation'}, {u'url': u'https://psychonautwiki.org/wiki/Addiction_suppression', u'name': u'Addiction suppression'}, {u'url': u'https://psychonautwiki.org/wiki/Analysis_enhancement', u'name': u'Analysis enhancement'}, {u'url': u'https://psychonautwiki.org/wiki/Anxiety', u'name': u'Anxiety'}, {u'url': u'https://psychonautwiki.org/wiki/Conceptual_thinking', u'name': u'Conceptual thinking'}, {u'url': u'https://psychonautwiki.org/wiki/Creativity_enhancement', u'name': u'Creativity enhancement'}, {u'url': u'https://psychonautwiki.org/wiki/Delusions', u'name': u'Delusions'}, {u'url': u'https://psychonautwiki.org/wiki/D%C3%A9j%C3%A0_vu', u'name': u'D\xe9j\xe0 vu'}, {u'url': u'https://psychonautwiki.org/wiki/Ego_replacement', u'name': u'Ego replacement'}, {u'url': u'https://psychonautwiki.org/wiki/Emotion_enhancement', u'name': u'Emotion enhancement'}, {u'url': u'https://psychonautwiki.org/wiki/Focus_enhancement', u'name': u'Focus enhancement'}, {u'url': u'https://psychonautwiki.org/wiki/Immersion_enhancement', u'name': u'Immersion enhancement'}, {u'url': u'https://psychonautwiki.org/wiki/Increased_libido', u'name': u'Increased libido'}, {u'url': u'https://psychonautwiki.org/wiki/Increased_music_appreciation', u'name': u'Increased music appreciation'}, {u'url': u'https://psychonautwiki.org/wiki/Laughter_fits', u'name': u'Laughter fits'}, {u'url': u'https://psychonautwiki.org/wiki/Memory_suppression', u'name': u'Memory suppression'}, {u'url': u'https://psychonautwiki.org/wiki/Multiple_thought_streams', u'name': u'Multiple thought streams'}, {u'url': u'https://psychonautwiki.org/wiki/Novelty_enhancement', u'name': u'Novelty enhancement'}, {u'url': u'https://psychonautwiki.org/wiki/Personal_bias_suppression', u'name': u'Personal bias suppression'}, {u'url': u'https://psychonautwiki.org/wiki/Personal_meaning_enhancement', u'name': u'Personal meaning enhancement'}, {u'url': u'https://psychonautwiki.org/wiki/Personality_regression', u'name': u'Personality regression'}, {u'url': u'https://psychonautwiki.org/wiki/Simultaneous_emotions', u'name': u'Simultaneous emotions'}, {u'url': u'https://psychonautwiki.org/wiki/Suggestibility_enhancement', u'name': u'Suggestibility enhancement'}, {u'url': u'https://psychonautwiki.org/wiki/Thought_acceleration', u'name': u'Thought acceleration'}, {u'url': u'https://psychonautwiki.org/wiki/Thought_loops', u'name': u'Thought loops'}, {u'url': u'https://psychonautwiki.org/wiki/Time_distortion', u'name': u'Time distortion'}, {u'url': u'https://psychonautwiki.org/wiki/Unity_and_interconnectedness', u'name': u'Unity and interconnectedness'}, {u'url': u'https://psychonautwiki.org/wiki/Wakefulness', u'name': u'Wakefulness'}, {u'url': u'https://psychonautwiki.org/wiki/Colour_enhancement', u'name': u'Colour enhancement'}, {u'url': u'https://psychonautwiki.org/wiki/Pattern_recognition_enhancement', u'name': u'Pattern recognition enhancement'}, {u'url': u'https://psychonautwiki.org/wiki/Acuity_enhancement', u'name': u'Acuity enhancement'}, {u'url': u'https://psychonautwiki.org/wiki/Drifting', u'name': u'Drifting'}, {u'url': u'https://psychonautwiki.org/wiki/After_images', u'name': u'After images'}, {u'url': u'https://psychonautwiki.org/wiki/Colour_shifting', u'name': u'Colour shifting'}, {u'url': u'https://psychonautwiki.org/wiki/Depth_perception_distortions', u'name': u'Depth perception distortions'}, {u'url': u'https://psychonautwiki.org/wiki/Perspective_distortions', u'name': u'Perspective distortions'}, {u'url': u'https://psychonautwiki.org/wiki/Recursion', u'name': u'Recursion'}, {u'url': u'https://psychonautwiki.org/wiki/Scenery_slicing', u'name': u'Scenery slicing'}, {u'url': u'https://psychonautwiki.org/wiki/Symmetrical_texture_repetition', u'name': u'Symmetrical texture repetition'}, {u'url': u'https://psychonautwiki.org/wiki/Tracers', u'name': u'Tracers'}, {u'url': u'https://psychonautwiki.org/wiki/Geometry', u'name': u'Geometry'}, {u'url': u'https://psychonautwiki.org/wiki/Transformations', u'name': u'Transformations'}, {u'url': u'https://psychonautwiki.org/wiki/Internal_hallucinations', u'name': u'Internal hallucinations'}, {u'url': u'https://psychonautwiki.org/wiki/Autonomous_entities', u'name': u'Autonomous entities'}, {u'url': u'https://psychonautwiki.org/wiki/Settings,_sceneries,_and_landscapes', u'name': u'Settings, sceneries, and landscapes'}, {u'url': u'https://psychonautwiki.org/wiki/Perspective_hallucinations', u'name': u'Perspective hallucinations'}, {u'url': u'https://psychonautwiki.org/wiki/Scenarios_and_plots', u'name': u'Scenarios and plots'}, {u'url': u'https://psychonautwiki.org/wiki/External_hallucinations', u'name': u'External hallucinations'}, {u'url': u'https://psychonautwiki.org/wiki/Auditory_enhancement', u'name': u'Auditory enhancement'}, {u'url': u'https://psychonautwiki.org/wiki/Auditory_distortion', u'name': u'Auditory distortion'}, {u'url': u'https://psychonautwiki.org/wiki/Auditory_hallucinations', u'name': u'Auditory hallucinations'}, {u'url': u'https://psychonautwiki.org/wiki/Synaesthesia', u'name': u'Synaesthesia'}, {u'url': u'https://psychonautwiki.org/wiki/Stamina_enhancement', u'name': u'Stamina enhancement'}, {u'url': u'https://psychonautwiki.org/wiki/Appetite_suppression', u'name': u'Appetite suppression'}, {u'url': u'https://psychonautwiki.org/wiki/Excessive_yawning', u'name': u'Excessive yawning'}, {u'url': u'https://psychonautwiki.org/wiki/Increased_salivation', u'name': u'Increased salivation'}, {u'url': u'https://psychonautwiki.org/wiki/Seizure', u'name': u'Seizure'}, {u'url': u'https://psychonautwiki.org/wiki/Cognitive_euphoria', u'name': u'Cognitive euphoria'}, {u'url': u'https://psychonautwiki.org/wiki/Increased_perspiration', u'name': u'Increased perspiration'}, {u'url': u'https://psychonautwiki.org/wiki/Spirituality_enhancement', u'name': u'Spirituality enhancement'}, {u'url': u'https://psychonautwiki.org/wiki/Existential_self-realization', u'name': u'Existential self-realization'}, {u'url': u'https://psychonautwiki.org/wiki/Perception_of_eternalism', u'name': u'Perception of eternalism'}, {u'url': u'https://psychonautwiki.org/wiki/Perception_of_self-design', u'name': u'Perception of self-design'}, {u'url': u'https://psychonautwiki.org/wiki/Perception_of_predeterminism', u'name': u'Perception of predeterminism'}, {u'url': u'https://psychonautwiki.org/wiki/Perception_of_interdependent_opposites', u'name': u'Perception of interdependent opposites'}, {u'url': u'https://psychonautwiki.org/wiki/Muscle_contractions', u'name': u'Muscle contractions'}, {u'url': u'https://psychonautwiki.org/wiki/Increased_sense_of_humor', u'name': u'Increased sense of humor'}, {u'url': u'https://psychonautwiki.org/wiki/Machinescapes', u'name': u'Machinescapes'}, {u'url': u'https://psychonautwiki.org/wiki/Thought_connectivity', u'name': u'Thought connectivity'}, {u'url': u'https://psychonautwiki.org/wiki/Magnification', u'name': u'Magnification'}, {u'url': u'https://psychonautwiki.org/wiki/Changes_in_felt_bodily_form', u'name': u'Changes in felt bodily form'}, {u'url': u'https://psychonautwiki.org/wiki/Paranoia', u'name': u'Paranoia'}, {u'url': u'https://psychonautwiki.org/wiki/Environmental_patterning', u'name': u'Environmental patterning'}, {u'url': u'https://psychonautwiki.org/wiki/Dehydration', u'name': u'Dehydration'}, {u'url': u'https://psychonautwiki.org/wiki/Temperature_regulation_suppression', u'name': u'Temperature regulation suppression'}, {u'url': u'https://psychonautwiki.org/wiki/Increased_bodily_temperature', u'name': u'Increased bodily temperature'}, {u'url': u'https://psychonautwiki.org/wiki/8A_Geometry_-_Perceived_exposure_to_semantic_concept_network', u'name': u'8A Geometry - Perceived exposure to semantic concept network'}, {u'url': u'https://psychonautwiki.org/wiki/Frame_rate_enhancement', u'name': u'Frame rate enhancement'}, {u'url': u'https://psychonautwiki.org/wiki/Introspection', u'name': u'Introspection'}], u'name': u'LSD'}]} + +{u'substances': [{u'roas': [{u'duration': {u'comeup': None, u'onset': {u'units': u'minutes', u'max': 5, u'min': 1}, u'afterglow': None, u'peak': {u'units': u'hours', u'max': 2, u'min': 1}, u'offset': None, u'duration': None, u'total': {u'units': u'hours', u'max': 6, u'min': 3}}, u'bioavailability': None, u'name': u'insufflated', u'dose': {u'heavy': 75, u'light': {u'max': 25, u'min': 15}, u'units': u'mg', u'common': {u'max': 40, u'min': 25}, u'threshold': 5, u'strong': {u'max': 75, u'min': 40}}}, {u'duration': {u'comeup': None, u'onset': {u'units': u'minutes', u'max': 30, u'min': 15}, u'afterglow': {u'units': u'hours', u'max': 10, u'min': 5}, u'peak': {u'units': u'hours', u'max': 4, u'min': 2.5}, u'offset': {u'units': u'hours', u'max': 3, u'min': 2}, u'duration': None, u'total': {u'units': u'hours', u'max': 8, u'min': 6}}, u'bioavailability': None, u'name': u'oral', u'dose': {u'heavy': 50, u'light': {u'max': 15, u'min': 5}, u'units': u'mg', u'common': {u'max': 30, u'min': 15}, u'threshold': 5, u'strong': {u'max': 50, u'min': 30}}}], u'effects': [{u'url': u'https://psychonautwiki.org/wiki/Spontaneous_physical_sensations', u'name': u'Spontaneous physical sensations'}, {u'url': u'https://psychonautwiki.org/wiki/Stimulation', u'name': u'Stimulation'}, {u'url': u'https://psychonautwiki.org/wiki/Abnormal_heartbeat', u'name': u'Abnormal heartbeat'}, {u'url': u'https://psychonautwiki.org/wiki/Appetite_suppression', u'name': u'Appetite suppression'}, {u'url': u'https://psychonautwiki.org/wiki/Bronchodilation', u'name': u'Bronchodilation'}, {u'url': u'https://psychonautwiki.org/wiki/Dehydration', u'name': u'Dehydration'}, {u'url': u'https://psychonautwiki.org/wiki/Frequent_urination', u'name': u'Frequent urination'}, {u'url': u'https://psychonautwiki.org/wiki/Increased_bodily_temperature', u'name': u'Increased bodily temperature'}, {u'url': u'https://psychonautwiki.org/wiki/Increased_blood_pressure', u'name': u'Increased blood pressure'}, {u'url': u'https://psychonautwiki.org/wiki/Increased_perspiration', u'name': u'Increased perspiration'}, {u'url': u'https://psychonautwiki.org/wiki/Nausea', u'name': u'Nausea'}, {u'url': u'https://psychonautwiki.org/wiki/Perception_of_bodily_lightness', u'name': u'Perception of bodily lightness'}, {u'url': u'https://psychonautwiki.org/wiki/Pupil_dilation', u'name': u'Pupil dilation'}, {u'url': u'https://psychonautwiki.org/wiki/Stamina_enhancement', u'name': u'Stamina enhancement'}, {u'url': u'https://psychonautwiki.org/wiki/Teeth_grinding', u'name': u'Teeth grinding'}, {u'url': u'https://psychonautwiki.org/wiki/Temporary_erectile_dysfunction', u'name': u'Temporary erectile dysfunction'}, {u'url': u'https://psychonautwiki.org/wiki/Vasoconstriction', u'name': u'Vasoconstriction'}, {u'url': u'https://psychonautwiki.org/wiki/Analysis_enhancement', u'name': u'Analysis enhancement'}, {u'url': u'https://psychonautwiki.org/wiki/Cognitive_euphoria', u'name': u'Cognitive euphoria'}, {u'url': u'https://psychonautwiki.org/wiki/Compulsive_redosing', u'name': u'Compulsive redosing'}, {u'url': u'https://psychonautwiki.org/wiki/Dream_suppression', u'name': u'Dream suppression'}, {u'url': u'https://psychonautwiki.org/wiki/Ego_inflation', u'name': u'Ego inflation'}, {u'url': u'https://psychonautwiki.org/wiki/Focus_enhancement', u'name': u'Focus enhancement'}, {u'url': u'https://psychonautwiki.org/wiki/Increased_libido', u'name': u'Increased libido'}, {u'url': u'https://psychonautwiki.org/wiki/Increased_music_appreciation', u'name': u'Increased music appreciation'}, {u'url': u'https://psychonautwiki.org/wiki/Memory_enhancement', u'name': u'Memory enhancement'}, {u'url': u'https://psychonautwiki.org/wiki/Motivation_enhancement', u'name': u'Motivation enhancement'}, {u'url': u'https://psychonautwiki.org/wiki/Thought_acceleration', u'name': u'Thought acceleration'}, {u'url': u'https://psychonautwiki.org/wiki/Thought_organization', u'name': u'Thought organization'}, {u'url': u'https://psychonautwiki.org/wiki/Wakefulness', u'name': u'Wakefulness'}, {u'url': u'https://psychonautwiki.org/wiki/Drifting', u'name': u'Drifting'}, {u'url': u'https://psychonautwiki.org/wiki/Brightness_alteration', u'name': u'Brightness alteration'}, {u'url': u'https://psychonautwiki.org/wiki/Transformations', u'name': u'Transformations'}, {u'url': u'https://psychonautwiki.org/wiki/Anxiety', u'name': u'Anxiety'}, {u'url': u'https://psychonautwiki.org/wiki/Cognitive_fatigue', u'name': u'Cognitive fatigue'}, {u'url': u'https://psychonautwiki.org/wiki/Depression', u'name': u'Depression'}, {u'url': u'https://psychonautwiki.org/wiki/Irritability', u'name': u'Irritability'}, {u'url': u'https://psychonautwiki.org/wiki/Motivation_suppression', u'name': u'Motivation suppression'}, {u'url': u'https://psychonautwiki.org/wiki/Thought_deceleration', u'name': u'Thought deceleration'}, {u'url': u'https://psychonautwiki.org/wiki/Time_distortion', u'name': u'Time distortion'}, {u'url': u'https://psychonautwiki.org/wiki/Increased_heart_rate', u'name': u'Increased heart rate'}, {u'url': u'https://psychonautwiki.org/wiki/Dry_mouth', u'name': u'Dry mouth'}], u'name': u'Amphetamine'}]} + +Warning, this query does not seem to contain a valid substance name +{u'substances': []} +""" + +print(wiki.substances) +""" +{'Psychedelics': {u'25x-NBOMes': {u'25C-NBOMe': 'https://psychonautwiki.org//wiki/25C-NBOMe/Summary', 'url': 'https://psychonautwiki.org//wiki/25x-NBOMe', u'25I-NBOMe': 'https://psychonautwiki.org//wiki/25I-NBOMe/Summary', u'25B-NBOMe': 'https://psychonautwiki.org//wiki/25B-NBOMe/Summary', u'25N-NBOMe': 'https://psychonautwiki.org//wiki/25N-NBOMe/Summary', u'25D-NBOMe': 'https://psychonautwiki.org//wiki/25D-NBOMe/Summary'}, u'DOx series': {u'DOI': 'https://psychonautwiki.org//wiki/DOI/Summary', u'DOM': 'https://psychonautwiki.org//wiki/DOM/Summary', u'DOB': 'https://psychonautwiki.org//wiki/DOB/Summary', u'DOC': 'https://psychonautwiki.org//wiki/DOC/Summary', u'DOx': 'https://psychonautwiki.org//wiki/DOx', u'DOET': 'https://psychonautwiki.org//w/index.php?title=DOET/Summary&action=edit&redlink=1'}, 'url': 'https://psychonautwiki.org//wiki/Psychedelics', u'Lysergamides': {u'LSD': 'https://psychonautwiki.org//wiki/LSD/Summary', u'LSA': 'https://psychonautwiki.org//wiki/LSA/Summary', 'url': 'https://psychonautwiki.org//wiki/Lysergamides', u'AL-LAD': 'https://psychonautwiki.org//wiki/AL-LAD/Summary', u'PRO-LAD': 'https://psychonautwiki.org//wiki/PRO-LAD/Summary', u'ALD-52': 'https://psychonautwiki.org//wiki/ALD-52/Summary', u'ETH-LAD': 'https://psychonautwiki.org//wiki/ETH-LAD/Summary', u'1P-ETH-LAD': 'https://psychonautwiki.org//wiki/1P-ETH-LAD/Summary', u'1P-LSD': 'https://psychonautwiki.org//wiki/1P-LSD/Summary', u'LSZ': 'https://psychonautwiki.org//wiki/LSZ/Summary'}, u'2C-x series': {u'2C-T-7': 'https://psychonautwiki.org//wiki/2C-T-7/Summary', u'2C-P': 'https://psychonautwiki.org//wiki/2C-P/Summary', u'2C-x': 'https://psychonautwiki.org//wiki/2C-x', u'2C-B': 'https://psychonautwiki.org//wiki/2C-B/Summary', u'2C-C': 'https://psychonautwiki.org//wiki/2C-C/Summary', u'2C-T-2': 'https://psychonautwiki.org//wiki/2C-T-2/Summary', u'2C-D': 'https://psychonautwiki.org//wiki/2C-D/Summary', u'2C-E': 'https://psychonautwiki.org//wiki/2C-E/Summary', u'2C-H': 'https://psychonautwiki.org//wiki/2C-H/Summary', u'2C-I': 'https://psychonautwiki.org//wiki/2C-I/Summary'}, u'Others': {u'TMA-6': 'https://psychonautwiki.org//wiki/TMA-6/Summary', u'TMA-2': 'https://psychonautwiki.org//wiki/TMA-2/Summary', u'2C-B-FLY': 'https://psychonautwiki.org//wiki/2C-B-FLY/Summary', u'Bromo-DragonFLY': 'https://psychonautwiki.org//wiki/Bromo-DragonFLY/Summary', u'5-MeO-DiBF': 'https://psychonautwiki.org//wiki/5-MeO-DiBF/Summary', u'2C-B-5EtO': 'https://psychonautwiki.org//w/index.php?title=2C-B-5EtO/Summary&action=edit&redlink=1', u'Efavirenz': 'https://psychonautwiki.org//wiki/Efavirenz/Summary', u'\u03b2k-2C-B': 'https://psychonautwiki.org//wiki/Bk-2C-B/Summary'}, u'Phenethylamines': {u'Proscaline': 'https://psychonautwiki.org//wiki/Proscaline/Summary', 'url': 'https://psychonautwiki.org//wiki/Phenethylamines', u'Allylescaline': 'https://psychonautwiki.org//wiki/Allylescaline/Summary', u'Methallylescaline': 'https://psychonautwiki.org//wiki/Methallylescaline/Summary', u'Escaline': 'https://psychonautwiki.org//wiki/Escaline/Summary', u'Mescaline': 'https://psychonautwiki.org//wiki/Mescaline/Summary'}, u'Base Tryptamines': {u'DPT': 'https://psychonautwiki.org//wiki/DPT/Summary', 'url': 'https://psychonautwiki.org//wiki/Tryptamine', u'EPT': 'https://psychonautwiki.org//wiki/EPT/Summary', u'DET': 'https://psychonautwiki.org//wiki/DET/Summary', u'DiPT': 'https://psychonautwiki.org//wiki/DiPT/Summary', u'MET': 'https://psychonautwiki.org//wiki/MET/Summary', u'MPT': 'https://psychonautwiki.org//wiki/MPT/Summary', u'DMT': 'https://psychonautwiki.org//wiki/DMT/Summary', u'AMT': 'https://psychonautwiki.org//wiki/AMT/Summary', u'MiPT': 'https://psychonautwiki.org//wiki/MiPT/Summary'}, u'Tryptamines': {u'4-AcO-DMT': 'https://psychonautwiki.org//wiki/4-AcO-DMT/Summary', u'4-HO-MET': 'https://psychonautwiki.org//wiki/4-HO-MET/Summary', u'5-MeO-MiPT': 'https://psychonautwiki.org//wiki/5-MeO-MiPT/Summary', u'4-HO-DPT': 'https://psychonautwiki.org//wiki/4-HO-DPT/Summary', u'5-MeO-DiPT': 'https://psychonautwiki.org//wiki/5-MeO-DiPT/Summary', 'url': 'https://psychonautwiki.org//wiki/Tryptamine', u'Psilocin': 'https://psychonautwiki.org//wiki/Psilocin/Summary', u'4-HO-EPT': 'https://psychonautwiki.org//wiki/4-HO-EPT/Summary', u'5-HO-DMT': 'https://psychonautwiki.org//wiki/Bufotenin/Summary', u'4-HO-DET': 'https://psychonautwiki.org//wiki/4-HO-DET/Summary', u'4-AcO-MiPT': 'https://psychonautwiki.org//wiki/4-AcO-MiPT/Summary', u'5-MeO-DMT': 'https://psychonautwiki.org//wiki/5-MeO-DMT/Summary', u'Ibogaine': 'https://psychonautwiki.org//wiki/Ibogaine/Summary', u'4-HO-MiPT': 'https://psychonautwiki.org//wiki/4-HO-MiPT/Summary', u'4-HO-DiPT': 'https://psychonautwiki.org//wiki/4-HO-DiPT/Summary', u'Psilocybin': 'https://psychonautwiki.org//wiki/Psilocin/Summary', u'5-MeO-DALT': 'https://psychonautwiki.org//wiki/5-MeO-DALT/Summary', u'4-AcO-MET': 'https://psychonautwiki.org//wiki/4-AcO-MET/Summary', u'4-AcO-DiPT': 'https://psychonautwiki.org//wiki/4-AcO-DiPT/Summary'}}, 'Deliriants': {'url': 'https://psychonautwiki.org//wiki/Deliriant', u'Tropane alkaloids': {'url': 'https://psychonautwiki.org//wiki/Tropane_alkaloid', u'Atropine': 'https://psychonautwiki.org//wiki/Datura/Summary', u'Hyoscyamine': 'https://psychonautwiki.org//wiki/Datura/Summary', u'Scopolamine': 'https://psychonautwiki.org//wiki/Datura/Summary'}, u'Others': {u'Benzydamine': 'https://psychonautwiki.org//wiki/Benzydamine/Summary', u'Myristicin': 'https://psychonautwiki.org//wiki/Myristicin/Summary', u'Mirtazapine': 'https://psychonautwiki.org//wiki/Mirtazapine/Summary'}, u'Antihistamines': {'url': 'https://psychonautwiki.org//wiki/Antihistamine', u'Diphenhydramine': 'https://psychonautwiki.org//wiki/Diphenhydramine/Summary'}}, 'Nootropics': {'url': 'https://psychonautwiki.org//wiki/Nootropics', u'Nutrients': {u'Choline bitartrate': 'https://psychonautwiki.org//wiki/Choline_bitartrate/Summary', u'Creatine': 'https://psychonautwiki.org//wiki/Creatine/Summary', u'S-Adenosyl methionine': 'https://psychonautwiki.org//wiki/S-Adenosyl_methionine/Summary', u'Citicoline': 'https://psychonautwiki.org//wiki/Citicoline/Summary', u'Alpha-GPC': 'https://psychonautwiki.org//wiki/Alpha-GPC/Summary', u'Tyrosine': 'https://psychonautwiki.org//wiki/Tyrosine/Summary'}, u'Racetams': {u'Piracetam': 'https://psychonautwiki.org//wiki/Piracetam/Summary', 'url': 'https://psychonautwiki.org//wiki/Racetam', u'Oxiracetam': 'https://psychonautwiki.org//wiki/Oxiracetam/Summary', u'Pramiracetam': 'https://psychonautwiki.org//wiki/Pramiracetam/Summary', u'Aniracetam': 'https://psychonautwiki.org//wiki/Aniracetam/Summary', u'Coluracetam': 'https://psychonautwiki.org//wiki/Coluracetam/Summary'}, u'Afinils': {'url': 'https://psychonautwiki.org//w/index.php?title=Afinil&action=edit&redlink=1', u'Armodafinil': 'https://psychonautwiki.org//wiki/Armodafinil/Summary', u'Adrafinil': 'https://psychonautwiki.org//w/index.php?title=Adrafinil/Summary&action=edit&redlink=1', u'Modafinil': 'https://psychonautwiki.org//wiki/Modafinil/Summary', u'Dehydroxyfluorafinil': 'https://psychonautwiki.org//wiki/Dehydroxyfluorafinil/Summary'}, u'Others': {u'Bromantane': 'https://psychonautwiki.org//wiki/Bromantane/Summary', u'N-Acetylcysteine': 'https://psychonautwiki.org//wiki/N-Acetylcysteine/Summary', u'L-Theanine': 'https://psychonautwiki.org//wiki/Theanine/Summary', u'Tianeptine': 'https://psychonautwiki.org//wiki/Tianeptine/Summary', u'Noopept': 'https://psychonautwiki.org//wiki/Noopept/Summary', u'5-HTP': 'https://psychonautwiki.org//wiki/5-HTP/Summary'}}, 'Depressants': {u'GABAergics': {u'Carisoprodol': 'https://psychonautwiki.org//wiki/Carisoprodol/Summary', u'Alcohol': 'https://psychonautwiki.org//wiki/Alcohol/Summary', u'Phenibut': 'https://psychonautwiki.org//wiki/Phenibut/Summary', 'url': 'https://psychonautwiki.org//wiki/GABA', u'1,4-Butanediol': 'https://psychonautwiki.org//wiki/1,4-Butanediol/Summary', u'GBL': 'https://psychonautwiki.org//wiki/GBL/Summary', u'2-methyl-2-butanol': 'https://psychonautwiki.org//w/index.php?title=2-methyl-2-butanol/Summary&action=edit&redlink=1', u'Methaqualone': 'https://psychonautwiki.org//wiki/Methaqualone/Summary', u'GHB': 'https://psychonautwiki.org//wiki/GHB/Summary', u'Baclofen': 'https://psychonautwiki.org//w/index.php?title=Baclofen/Summary&action=edit&redlink=1', u'Gabapentin': 'https://psychonautwiki.org//wiki/Gabapentin/Summary'}, u'Thienodiazepines': {'url': 'https://psychonautwiki.org//wiki/Substituted_thienodiazepine', u'Etizolam': 'https://psychonautwiki.org//wiki/Etizolam/Summary', u'Metizolam': 'https://psychonautwiki.org//wiki/Metizolam/Summary', u'Deschloroetizolam': 'https://psychonautwiki.org//wiki/Deschloroetizolam/Summary'}, u'Opioids': {u'Fentanyl': 'https://psychonautwiki.org//wiki/Fentanyl/Summary', u'Diacetylmorphine': 'https://psychonautwiki.org//wiki/Heroin/Summary', u'Sufentanil': 'https://psychonautwiki.org//wiki/Sufentanil/Summary', u'Tapentadol': 'https://psychonautwiki.org//wiki/Tapentadol/Summary', u'Oxymorphone': 'https://psychonautwiki.org//wiki/Oxymorphone/Summary', u'Dihydrocodeine': 'https://psychonautwiki.org//wiki/Dihydrocodeine/Summary', u'Desomorphine': 'https://psychonautwiki.org//wiki/Desomorphine/Summary', u'O-Desmethyltramadol': 'https://psychonautwiki.org//wiki/O-Desmethyltramadol/Summary', u'Acetylfentanyl': 'https://psychonautwiki.org//wiki/Acetylfentanyl/Summary', u'Buprenorphine': 'https://psychonautwiki.org//wiki/Buprenorphine/Summary', u'Morphine': 'https://psychonautwiki.org//wiki/Morphine/Summary', u'Dextropropoxyphene': 'https://psychonautwiki.org//wiki/Dextropropoxyphene/Summary', u'Codeine': 'https://psychonautwiki.org//wiki/Codeine/Summary', u'Methadone': 'https://psychonautwiki.org//wiki/Methadone/Summary', u'U-47700': 'https://psychonautwiki.org//wiki/U-47700/Summary', 'url': 'https://psychonautwiki.org//wiki/Opioids', u'Tramadol': 'https://psychonautwiki.org//wiki/Tramadol/Summary', u'Ethylmorphine': 'https://psychonautwiki.org//wiki/Ethylmorphine/Summary', u'Hydrocodone': 'https://psychonautwiki.org//wiki/Hydrocodone/Summary', u'Oxycodone': 'https://psychonautwiki.org//wiki/Oxycodone/Summary', u'Hydromorphone': 'https://psychonautwiki.org//wiki/Hydromorphone/Summary', u'Kratom': 'https://psychonautwiki.org//wiki/Kratom/Summary'}, u'Benzodiazepines': {u'Diazepam': 'https://psychonautwiki.org//wiki/Diazepam/Summary', u'Diclazepam': 'https://psychonautwiki.org//wiki/Diclazepam/Summary', u'Flubromazepam': 'https://psychonautwiki.org//wiki/Flubromazepam/Summary', u'Oxazepam': 'https://psychonautwiki.org//w/index.php?title=Oxazepam/Summary&action=edit&redlink=1', 'url': 'https://psychonautwiki.org//wiki/Benzodiazepine', u'Flunitrazolam': 'https://psychonautwiki.org//w/index.php?title=Flunitrazolam/Summary&action=edit&redlink=1', u'Lorazepam': 'https://psychonautwiki.org//wiki/Lorazepam/Summary', u'Midazolam': 'https://psychonautwiki.org//w/index.php?title=Midazolam/Summary&action=edit&redlink=1', u'Clonazolam': 'https://psychonautwiki.org//wiki/Clonazolam/Summary', u'Flunitrazepam': 'https://psychonautwiki.org//w/index.php?title=Flunitrazepam/Summary&action=edit&redlink=1', u'Alprazolam': 'https://psychonautwiki.org//wiki/Alprazolam/Summary', u'Temazepam': 'https://psychonautwiki.org//wiki/Temazepam/Summary', u'Flubromazolam': 'https://psychonautwiki.org//wiki/Flubromazolam/Summary', u'Phenazepam': 'https://psychonautwiki.org//w/index.php?title=Phenazepam/Summary&action=edit&redlink=1', u'Nifoxipam': 'https://psychonautwiki.org//wiki/Nifoxipam/Summary', u'Pyrazolam': 'https://psychonautwiki.org//wiki/Pyrazolam/Summary', u'Clonazepam': 'https://psychonautwiki.org//wiki/Clonazepam/Summary'}, 'url': 'https://psychonautwiki.org//wiki/Depressant', u'Barbiturates': {'url': 'https://psychonautwiki.org//wiki/Barbiturate', u'Amobarbital': 'https://psychonautwiki.org//w/index.php?title=Amobarbital/Summary&action=edit&redlink=1', u'Pentobarbital': 'https://psychonautwiki.org//wiki/Pentobarbital/Summary', u'Phenobarbital': 'https://psychonautwiki.org//wiki/Phenobarbital/Summary', u'Secobarbital': 'https://psychonautwiki.org//wiki/Secobarbital/Summary'}, u'Others': {u'Zolpidem': 'https://psychonautwiki.org//wiki/Zolpidem/Summary', u'Pregabalin': 'https://psychonautwiki.org//wiki/Pregabalin/Summary', u'Naloxone': 'https://psychonautwiki.org//wiki/Naloxone/Summary', u'Zopiclone': 'https://psychonautwiki.org//wiki/Zopiclone/Summary', u'Gabapentin': 'https://psychonautwiki.org//wiki/Gabapentin/Summary'}, u'Antipsychotics': {'url': 'https://psychonautwiki.org//wiki/Antipsychotic', u'Haloperidol': 'https://psychonautwiki.org//wiki/Haloperidol/Summary', u'Risperidone': 'https://psychonautwiki.org//wiki/Risperidone/Summary', u'Prochlorperazine': 'https://psychonautwiki.org//wiki/Prochlorperazine/Summary', u'Quetiapine': 'https://psychonautwiki.org//wiki/Quetiapine/Summary'}}, 'Miscellaneous': {u'k-opioid receptor agonists': {'url': 'https://psychonautwiki.org//wiki/K-opioid_receptor_agonist', u'Salvinorin A': 'https://psychonautwiki.org//wiki/Salvinorin_A/Summary', u'Salvinorin B methoxymethyl ether': 'https://psychonautwiki.org//wiki/Salvinorin_B_methoxymethyl_ether/Summary', u'Muscimol': 'https://psychonautwiki.org//wiki/Ibogaine/Summary'}, 'url': None, u'Others': {u'Domperidone': 'https://psychonautwiki.org//wiki/Domperidone/Summary'}, u'GABA-A receptor agonists': {'url': 'https://psychonautwiki.org//w/index.php?title=GABAA_receptor&action=edit&redlink=1', u'Zolpidem': 'https://psychonautwiki.org//wiki/Zolpidem/Summary', u'Ibotenic acid': 'https://psychonautwiki.org//w/index.php?title=Ibotenic_acid/Summary&action=edit&redlink=1', u'Zopiclone': 'https://psychonautwiki.org//wiki/Zopiclone/Summary', u'Muscimol': 'https://psychonautwiki.org//w/index.php?title=Muscimol/Summary&action=edit&redlink=1'}, u'Opioid antagonists': {u'Opioid': 'https://psychonautwiki.org//wiki/Opioid', u'Naloxone': 'https://psychonautwiki.org//wiki/Naloxone/Summary', u'Naltrexone': 'https://psychonautwiki.org//w/index.php?title=Naltrexone/Summary&action=edit&redlink=1', u'antagonists': 'https://psychonautwiki.org//wiki/Antagonist'}, u'Combinations': {u'DXM & DPH': 'https://psychonautwiki.org//wiki/DXM_%26_DPH/Summary', u'Ayahuasca': 'https://psychonautwiki.org//wiki/Ayahuasca/Summary'}, u'Sigmaergics': {'url': 'https://psychonautwiki.org//w/index.php?title=Sigma_receptors&action=edit&redlink=1', u'Dextromethorphan': 'https://psychonautwiki.org//wiki/Dextromethorphan/Summary', u'W-18': 'https://psychonautwiki.org//w/index.php?title=W-18/Summary&action=edit&redlink=1'}}, 'Entheogens': {u'Salvia divinorum': 'https://psychonautwiki.org//w/index.php?title=Salvia_divinorum/Summary&action=edit&redlink=1', u'Ayahuasca': 'https://psychonautwiki.org//wiki/Ayahuasca/Summary', u'Amanita muscaria': 'https://psychonautwiki.org//w/index.php?title=Amanita_muscaria/Summary&action=edit&redlink=1', u'Datura': 'https://psychonautwiki.org//wiki/Datura/Summary', 'url': 'https://psychonautwiki.org//wiki/Entheogen', u'Hawaiian Baby Woodrose': 'https://psychonautwiki.org//w/index.php?title=Hawaiian_Baby_Woodrose/Summary&action=edit&redlink=1', u'Yopo': 'https://psychonautwiki.org//w/index.php?title=Yopo/Summary&action=edit&redlink=1', u'Cannabis': 'https://psychonautwiki.org//wiki/Cannabis/Summary', u'Psilocybe mushroom': 'https://psychonautwiki.org//wiki/Psilocin/Summary', u'Morning Glory': 'https://psychonautwiki.org//w/index.php?title=Morning_Glory/Summary&action=edit&redlink=1', u'Syrian Rue': 'https://psychonautwiki.org//w/index.php?title=Peganum_harmala/Summary&action=edit&redlink=1', u'Mimosa hostilis': 'https://psychonautwiki.org//w/index.php?title=Mimosa_hostilis/Summary&action=edit&redlink=1', u'Iboga': 'https://psychonautwiki.org//w/index.php?title=Iboga/Summary&action=edit&redlink=1', u'Changa': 'https://psychonautwiki.org//w/index.php?title=Changa/Summary&action=edit&redlink=1', u'Acacia confusa': 'https://psychonautwiki.org//w/index.php?title=Acacia_confusa/Summary&action=edit&redlink=1', u'Banisteriopsis caapi': 'https://psychonautwiki.org//w/index.php?title=Banisteriopsis_caapi/Summary&action=edit&redlink=1'}, 'Cannabinoids': {'url': 'https://psychonautwiki.org//wiki/Cannabinoid', u'Phytocannabinoids': {'url': 'https://psychonautwiki.org//wiki/Cannabinoid#Phytocannabinoids', u'Tetrahydrocannabinol': 'https://psychonautwiki.org//wiki/Cannabis/Summary', u'Cannabidiol': 'https://psychonautwiki.org//wiki/Cannabis/Summary', u'Cannabinol': 'https://psychonautwiki.org//wiki/Cannabis/Summary'}, u'Synthetic cannabinoids': {u'JWH-018': 'https://psychonautwiki.org//wiki/JWH-018/Summary', 'url': 'https://psychonautwiki.org//wiki/Synthetic_cannabinoid', u'5F-PB-22': 'https://psychonautwiki.org//wiki/5F-PB-22/Summary', u'AB-FUBINACA': 'https://psychonautwiki.org//wiki/AB-FUBINACA/Summary', u'STS-135': 'https://psychonautwiki.org//wiki/STS-135/Summary', u'THJ-2201': 'https://psychonautwiki.org//wiki/THJ-2201/Summary', u'THJ-018': 'https://psychonautwiki.org//wiki/THJ-018/Summary', u'5F-AKB48': 'https://psychonautwiki.org//wiki/5F-AKB48/Summary'}}, 'Dissociatives': {'url': 'https://psychonautwiki.org//wiki/Dissociative', u'Diarylethylamines': {'url': 'https://psychonautwiki.org//wiki/Diarylethylamine', u'Ephenidine': 'https://psychonautwiki.org//wiki/Ephenidine/Summary', u'Diphenidine': 'https://psychonautwiki.org//wiki/Diphenidine/Summary', u'Methoxphenidine': 'https://psychonautwiki.org//wiki/Methoxphenidine/Summary'}, u'Morphinans': {'url': 'https://psychonautwiki.org//wiki/Morphinan', u'Dextromethorphan': 'https://psychonautwiki.org//wiki/Dextromethorphan/Summary'}, u'Arylcyclohexylamines': {u'Ketamine': 'https://psychonautwiki.org//wiki/Ketamine/Summary', u'3-MeO-PCP': 'https://psychonautwiki.org//wiki/3-MeO-PCP/Summary', u'Methoxyketamine': 'https://psychonautwiki.org//w/index.php?title=Methoxyketamine/Summary&action=edit&redlink=1', u'3-MeO-PCMo': 'https://psychonautwiki.org//wiki/3-MeO-PCMo/Summary', 'url': 'https://psychonautwiki.org//wiki/Arylcyclohexylamine', u'Methoxetamine': 'https://psychonautwiki.org//wiki/Methoxetamine/Summary', u'3-MeO-PCE': 'https://psychonautwiki.org//wiki/3-MeO-PCE/Summary', u'Phencyclidine': 'https://psychonautwiki.org//wiki/PCP/Summary', u'2-Oxo-PCE': 'https://psychonautwiki.org//wiki/2-Oxo-PCE/Summary', u'Trifluoroketamine': 'https://psychonautwiki.org//w/index.php?title=Trifluoroketamine/Summary&action=edit&redlink=1', u'4-MeO-PCP': 'https://psychonautwiki.org//wiki/4-MeO-PCP/Summary', u'2-Fluorodeschloroketamine': 'https://psychonautwiki.org//wiki/2-Fluorodeschloroketamine/Summary', u'2-Oxo-PCM': 'https://psychonautwiki.org//wiki/Deschloroketamine/Summary', u'Eticyclidine': 'https://psychonautwiki.org//w/index.php?title=Eticyclidine/Summary&action=edit&redlink=1', u'Tiletamine': 'https://psychonautwiki.org//w/index.php?title=Tiletamine/Summary&action=edit&redlink=1'}, u'Others': {u'Salvinorin A': 'https://psychonautwiki.org//wiki/Salvinorin_A/Summary', u'Memantine': 'https://psychonautwiki.org//wiki/Memantine/Summary', u'Ibogaine': 'https://psychonautwiki.org//wiki/Ibogaine/Summary', u'Nitrous oxide': 'https://psychonautwiki.org//wiki/Nitrous_Oxide/Summary', u'Xenon': 'https://psychonautwiki.org//w/index.php?title=Xenon/Summary&action=edit&redlink=1', u'Salvinorin B methoxylmethyl ether': 'https://psychonautwiki.org//wiki/Salvinorin_B_methoxymethyl_ether/Summary', u'Ether': 'https://psychonautwiki.org//w/index.php?title=Ether/Summary&action=edit&redlink=1'}}, 'Stimulants': {u'Cathinones': {u'Ethcathinone': 'https://psychonautwiki.org//wiki/Ethylcathinone/Summary', u'Methylone': 'https://psychonautwiki.org//wiki/Methylone/Summary', u'Hexedrone': 'https://psychonautwiki.org//wiki/Hexedrone/Summary', 'url': 'https://psychonautwiki.org//wiki/Substituted_cathinone', u'Ethyl-Pentedrone': 'https://psychonautwiki.org//wiki/Ethyl-Pentedrone/Summary', u'Ethylone': 'https://psychonautwiki.org//wiki/Ethylone/Summary', u'Pentedrone': 'https://psychonautwiki.org//wiki/Pentedrone/Summary', u'\u03b1-PVP': 'https://psychonautwiki.org//wiki/A-PVP/Summary', u'Mephedrone': 'https://psychonautwiki.org//wiki/Mephedrone/Summary', u'Methcathinone': 'https://psychonautwiki.org//w/index.php?title=Methcathinone/Summary&action=edit&redlink=1', u'Ethyl-Hexedrone': 'https://psychonautwiki.org//wiki/Ethyl-Hexedrone/Summary', u'Butylone': 'https://psychonautwiki.org//wiki/Butylone/Summary', u'\u03b1-PHP': 'https://psychonautwiki.org//wiki/A-PHP/Summary', u'MDPV': 'https://psychonautwiki.org//wiki/MDPV/Summary', u'Cathinone': 'https://psychonautwiki.org//w/index.php?title=Cathinone/Summary&action=edit&redlink=1', u'4-MEC': 'https://psychonautwiki.org//w/index.php?title=4-MEC/Summary&action=edit&redlink=1', u'3-MMC': 'https://psychonautwiki.org//wiki/3-MMC/Summary'}, u'Tropanes': {'url': 'https://psychonautwiki.org//wiki/Tropane', u'RTI-111': 'https://psychonautwiki.org//wiki/Dichloropane/Summary', u'Cocaine': 'https://psychonautwiki.org//wiki/Cocaine/Summary'}, 'url': 'https://psychonautwiki.org//wiki/Stimulants', u'Xanthines': {'url': 'https://psychonautwiki.org//wiki/Substituted_xanthine', u'Caffeine': 'https://psychonautwiki.org//wiki/Caffeine/Summary'}, u'Others': {u'Bromantane': 'https://psychonautwiki.org//wiki/Bromantane/Summary', u'Poppers': 'https://psychonautwiki.org//wiki/Poppers/Summary', u'Nicotine': 'https://psychonautwiki.org//wiki/Nicotine/Summary', u'Methiopropamine': 'https://psychonautwiki.org//wiki/Methiopropamine/Summary', u'Propylhexedrine': 'https://psychonautwiki.org//wiki/Propylhexedrine/Summary', u'NM-2-AI': 'https://psychonautwiki.org//wiki/NM-2-AI/Summary', u'2C-H': 'https://psychonautwiki.org//wiki/2C-H/Summary', u'2-AI': 'https://psychonautwiki.org//wiki/2-Aminoindane/Summary'}, u'Amphetamines': {u'2-FA': 'https://psychonautwiki.org//wiki/2-FA/Summary', u'Lisdexamfetamine': 'https://psychonautwiki.org//wiki/Lisdexamfetamine/Summary', 'url': 'https://psychonautwiki.org//wiki/Substituted_amphetamine', u'Amphetamine': 'https://psychonautwiki.org//wiki/Amphetamine/Summary', u'3-FA': 'https://psychonautwiki.org//wiki/3-FA/Summary', u'4-FMA': 'https://psychonautwiki.org//wiki/4-FMA/Summary', u'Methamphetamine': 'https://psychonautwiki.org//wiki/Methamphetamine/Summary', u'3-FPM': 'https://psychonautwiki.org//wiki/3-FPM/Summary', u'4-FA': 'https://psychonautwiki.org//wiki/4-FA/Summary', u'2-FMA': 'https://psychonautwiki.org//wiki/2-FMA/Summary'}, u'Phenidates': {'url': 'https://psychonautwiki.org//wiki/Substituted_phenidate', u'Methylphenidate': 'https://psychonautwiki.org//wiki/Methylphenidate/Summary', u'4F-EPH': 'https://psychonautwiki.org//wiki/4F-EPH/Summary', u'Ethylphenidate': 'https://psychonautwiki.org//wiki/Ethylphenidate/Summary', u'3,4-CTMP': 'https://psychonautwiki.org//wiki/3,4-CTMP/Summary', u'Methylnaphthidate': 'https://psychonautwiki.org//wiki/Methylnaphthidate/Summary', u'4F-MPH': 'https://psychonautwiki.org//wiki/4F-MPH/Summary', u'Isopropylphenidate': 'https://psychonautwiki.org//wiki/Isopropylphenidate/Summary'}, u'Piperazines': {'url': 'https://psychonautwiki.org//wiki/Substituted_piperazine', u'mCPP': 'https://psychonautwiki.org//wiki/MCPP/Summary', u'TFMPP': 'https://psychonautwiki.org//w/index.php?title=TFMPP/Summary&action=edit&redlink=1', u'BZP': 'https://psychonautwiki.org//w/index.php?title=BZP/Summary&action=edit&redlink=1'}}, 'Entactogens': {u'MDEA': 'https://psychonautwiki.org//wiki/MDEA/Summary', u'MMDA': 'https://psychonautwiki.org//w/index.php?title=MMDA/Summary&action=edit&redlink=1', u'5-MAPB': 'https://psychonautwiki.org//wiki/5-MAPB/Summary', u'Methylone': 'https://psychonautwiki.org//wiki/Methylone/Summary', 'url': 'https://psychonautwiki.org//wiki/Entactogens', u'MDMA': 'https://psychonautwiki.org//wiki/MDMA/Summary', u'MDA': 'https://psychonautwiki.org//wiki/MDA/Summary', u'6-APDB': 'https://psychonautwiki.org//wiki/6-APDB/Summary', u'PMMA': 'https://psychonautwiki.org//wiki/PMMA/Summary', u'5-APDB': 'https://psychonautwiki.org//w/index.php?title=5-APDB/Summary&action=edit&redlink=1', u'5-APB': 'https://psychonautwiki.org//wiki/5-APB/Summary', u'PMA': 'https://psychonautwiki.org//wiki/PMA/Summary', u'6-APB': 'https://psychonautwiki.org//wiki/6-APB/Summary', u'MDAI': 'https://psychonautwiki.org//wiki/MDAI/Summary'}} + +""" + +print(wiki.substance_list) +""" +[u'1P-ETH-LAD', u'1P-LSD', u'AL-LAD', u'ALD-52', u'ETH-LAD', u'LSA', u'LSD', u'LSZ', u'PRO-LAD', u'AMT', u'DET', u'DMT', u'DPT', u'DiPT', u'EPT', u'MET', u'MPT', u'MiPT', u'4-AcO-DMT', u'4-AcO-DiPT', u'4-AcO-MET', u'4-AcO-MiPT', u'4-HO-DET', u'4-HO-DPT', u'4-HO-DiPT', u'Psilocin', u'Psilocybin', u'4-HO-EPT', u'4-HO-MET', u'4-HO-MiPT', u'5-MeO-DALT', u'5-MeO-DMT', u'5-MeO-DiPT', u'5-MeO-MiPT', u'5-HO-DMT', u'Ibogaine', u'Allylescaline', u'Escaline', u'Mescaline', u'Methallylescaline', u'Proscaline', u'2C-x', u'2C-B', u'2C-C', u'2C-D', u'2C-E', u'2C-H', u'2C-I', u'2C-P', u'2C-T-2', u'2C-T-7', u'DOx', u'DOB', u'DOC', u'DOET', u'DOI', u'DOM', u'25B-NBOMe', u'25C-NBOMe', u'25D-NBOMe', u'25I-NBOMe', u'25N-NBOMe', u'2C-B-5EtO', u'2C-B-FLY', u'5-MeO-DiBF', u'\u03b2k-2C-B', u'Bromo-DragonFLY', u'Efavirenz', u'TMA-2', u'TMA-6', u'Acacia confusa', u'Amanita muscaria', u'Ayahuasca', u'Banisteriopsis caapi', u'Cannabis', u'Changa', u'Datura', u'Hawaiian Baby Woodrose', u'Iboga', u'Mimosa hostilis', u'Morning Glory', u'Psilocybe mushroom', u'Salvia divinorum', u'Yopo', u'Syrian Rue', u'Phencyclidine', u'Ketamine', u'Methoxetamine', u'Methoxyketamine', u'2-Fluorodeschloroketamine', u'Trifluoroketamine', u'2-Oxo-PCE', u'2-Oxo-PCM', u'Eticyclidine', u'Tiletamine', u'3-MeO-PCE', u'3-MeO-PCMo', u'3-MeO-PCP', u'4-MeO-PCP', u'Dextromethorphan', u'Ephenidine', u'Diphenidine', u'Methoxphenidine', u'Ether', u'Ibogaine', u'Memantine', u'Nitrous oxide', u'Salvinorin A', u'Salvinorin B methoxylmethyl ether', u'Xenon', u'Atropine', u'Hyoscyamine', u'Scopolamine', u'Diphenhydramine', u'Benzydamine', u'Mirtazapine', u'Myristicin', u'Cannabidiol', u'Cannabinol', u'Tetrahydrocannabinol', u'5F-AKB48', u'5F-PB-22', u'AB-FUBINACA', u'JWH-018', u'STS-135', u'THJ-018', u'THJ-2201', u'Ibotenic acid', u'Muscimol', u'Zolpidem', u'Zopiclone', u'Muscimol', u'Salvinorin A', u'Salvinorin B methoxymethyl ether', u'Dextromethorphan', u'W-18', u'Opioid', u'antagonists', u'Naloxone', u'Naltrexone', u'Ayahuasca', u'DXM & DPH', u'Domperidone', u'Alprazolam', u'Clonazepam', u'Clonazolam', u'Diazepam', u'Diclazepam', u'Flubromazepam', u'Flubromazolam', u'Flunitrazepam', u'Flunitrazolam', u'Lorazepam', u'Midazolam', u'Nifoxipam', u'Oxazepam', u'Phenazepam', u'Pyrazolam', u'Temazepam', u'Deschloroetizolam', u'Etizolam', u'Metizolam', u'Amobarbital', u'Pentobarbital', u'Phenobarbital', u'Secobarbital', u'Acetylfentanyl', u'Buprenorphine', u'Codeine', u'Desomorphine', u'Dextropropoxyphene', u'Dihydrocodeine', u'Ethylmorphine', u'Fentanyl', u'Diacetylmorphine', u'Hydrocodone', u'Hydromorphone', u'Kratom', u'Methadone', u'Morphine', u'O-Desmethyltramadol', u'Oxycodone', u'Oxymorphone', u'Sufentanil', u'Tapentadol', u'Tramadol', u'U-47700', u'1,4-Butanediol', u'2-methyl-2-butanol', u'Alcohol', u'Baclofen', u'Carisoprodol', u'GBL', u'GHB', u'Gabapentin', u'Methaqualone', u'Phenibut', u'Haloperidol', u'Prochlorperazine', u'Risperidone', u'Quetiapine', u'Gabapentin', u'Naloxone', u'Pregabalin', u'Zolpidem', u'Zopiclone', u'2-FA', u'2-FMA', u'3-FA', u'3-FPM', u'4-FA', u'4-FMA', u'Amphetamine', u'Lisdexamfetamine', u'Methamphetamine', u'3,4-CTMP', u'4F-EPH', u'4F-MPH', u'Ethylphenidate', u'Isopropylphenidate', u'Methylnaphthidate', u'Methylphenidate', u'3-MMC', u'4-MEC', u'\u03b1-PHP', u'\u03b1-PVP', u'Butylone', u'Cathinone', u'Ethyl-Hexedrone', u'Ethyl-Pentedrone', u'Ethcathinone', u'Ethylone', u'Hexedrone', u'MDPV', u'Mephedrone', u'Methcathinone', u'Methylone', u'Pentedrone', u'BZP', u'mCPP', u'TFMPP', u'Caffeine', u'Cocaine', u'RTI-111', u'2-AI', u'2C-H', u'Bromantane', u'Methiopropamine', u'NM-2-AI', u'Nicotine', u'Poppers', u'Propylhexedrine', u'Aniracetam', u'Coluracetam', u'Oxiracetam', u'Piracetam', u'Pramiracetam', u'Adrafinil', u'Armodafinil', u'Dehydroxyfluorafinil', u'Modafinil', u'Alpha-GPC', u'Choline bitartrate', u'Citicoline', u'Creatine', u'S-Adenosyl methionine', u'Tyrosine', u'5-HTP', u'Bromantane', u'N-Acetylcysteine', u'Noopept', u'L-Theanine', u'Tianeptine', u'5-APB', u'5-APDB', u'5-MAPB', u'6-APB', u'6-APDB', u'MDA', u'MDAI', u'MDEA', u'MDMA', u'MMDA', u'Methylone', u'PMA', u'PMMA'] +""" +``` + +#### Erowid + +```python +from pysychonaut import Erowid + +# getting substances - chemicals, pharms, herbs, animals, plants, smarts + +chemicals = Erowid.get_chemicals() +print(list(chemicals[0].keys())) +names = [c["name"] for c in chemicals] +print(names) + +""" +['url', 'other_names', 'name', 'effects'] +[u'absinthe', u'acetylfentanyl', u'adrenochrome', u'aet', u'alcohol', u'alpha-pvp', u'amitriptyline', u'amphetamine', u'amt', u'ayahuasca', u'barbiturates', u'bk-mbdb', u'bromo-dragonfly', u'bufotenin', u'bz', u'bzp', u'caffeine', u'cannabinoids', u'capsaicin', u'carbogen', u'cathinone', u'chloroform', u'chocolate', u'cocaine / crack', u'desomorphine', u'det', u'dipt', u'dmt', u'dob', u'doc', u'doi', u'dom', u'dpt', u'dxm', u'ephedrine', u'ether', u'ethylcathinone', u'ethylene', u'ethylphenidate', u'ghb', u'ghv', u'harmala', u'heroin', u'hypocretin', u'iap', u'ibogaine', u'inhalants', u'ketamine', u'lsa', u'lsd', u'lsz', u'maois', u'mbdb', u'mcpp', u'mda', u'mde', u'mdai', u'mdma', u'mdpr', u'mdpv', u'mescaline', u'met', u'methadone', u'methamphetamines', u'methaqualone', u'methiopropamine', u'methoxetamine', u'methoxphenidine', u'methylone', u'mipt', u'mptp', u'nbome', u'nicotine', u'nitrous', u'opiates', u'opium', u'petroleum ether', u'piperazines', u'pcp', u'pma', u'pmma', u'psilocybin & psilocin', u'salvinorin b ethoxymethyl ether', u'scopolamine', u'"spice" product', u'ssris', u'tfmpp', u'thc', u'tma-2', u'toad venom', u'1,4-butanediol', u'2-aminoindan', u'2c-b', u'2c-b-fly', u'2c-c', u'2c-c-nbome', u'2c-d', u'2c-e', u'2c-i', u'2c-i-nbome', u'2c-p', u'2c-t-2', u'2c-t-4', u'2c-t-7', u'2c-t-21', u'3c-p', u'3-meo-pcp', u'4-acetoxy-det', u'4-acetoxy-dipt', u'4-acetoxy-dmt', u'4-acetoxy-mipt', u'4-fluoroamphetamine', u'4-fluoromethcathinone', u'4-hydroxy-dipt', u'4-hydroxy-met', u'4-hydroxy-mipt', u'4-hydroxy-mpt', u'4-meo-pcp', u'4-methylaminorex', u'4-methylmethcathinone', u'4-methylethcathinone', u'4-mta', u'5-it', u'5-meo-amt', u'5-meo-dalt', u'5-meo-dmt', u'5-meo-dipt', u'5-meo-mipt', u'6-apb', u'other chemicals'] + +""" + +# parsing a substance page + +chem_data = Erowid.parse_page("https://erowid.org/chemicals/lsd/lsd.shtml") +for key in chem_data: + print(key, ":", chem_data[key]) + +""" +info : {'basics': 'https://erowid.org/chemicals/lsd/lsd_basics.shtml', 'dose': 'https://erowid.org/chemicals/lsd/lsd_dose.shtml', 'health': 'https://erowid.org/chemicals/lsd/lsd_health.shtml', 'effects': 'https://erowid.org/chemicals/lsd/lsd_effects.shtml', 'images': 'https://erowid.org/chemicals/lsd/lsd_images.shtml', 'law': 'https://erowid.org/chemicals/lsd/lsd_law.shtml', 'chemistry': 'https://erowid.org/chemicals/lsd/lsd_chemistry.shtml'} +picture : https://erowid.org/chemicals/lsd/images/lsd_summary1.jpg +name : lsd-25 +url : https://erowid.org/chemicals/lsd/ +other_names : [u'acid', u'l', u'tabs', u'blotter', u'doses', u'trips'] +effects : Psychedelic +chem_name : d-lysergic acid diethylamide +description : LSD is the best known and most researched psychedelic. It is the standard against which all other psychedelics are compared. It is active at extremely low doses and is most commonly available on blotter or in liquid form. + +""" + +# handling experience reports + +trip_report = Erowid.random_experience() +print(list(trip_report.keys())) + +""" ['url', 'gender', 'age', 'experience', 'drug', 'year', 'date', 'exp_id', 'dosage'] """ + +trip_report = Erowid.get_experience(1) +for key in trip_report: + print(key, ":", trip_report[key]) + +""" +url : https://erowid.org/experiences/exp.php?ID=1 +gender : not specified +age : not given + 15 minutes after this scary ordeal i begin to settle down, i layed down inside his warm house on the rug, touching and rubbing my hands like everywhere, everything was orgasmic feeling. I took a look at my eyes, i look like satan! it was so cool! Then after about and hour laying on the floor, other people come to his house who i dont even really know, but i just conversed with them with no feeling of stupidity, embarresment or consequences, very cool, i loved it, an hour later my eyes still were dialated but effects were over, it was fantastic +drug : ecstasy +year : 2000 +date : may 30, 2000 +exp_id : 1 +dosage : [{'substance': u'mdma', 'form': u'(pill / tablet)', 'method': u'oral', 'ammount': u'0.5 tablets', 'time': u't+ 0:00'}, {'substance': u'mdma', 'form': u'(pill / tablet)', 'method': u'oral', 'ammount': u'0.5 tablets', 'time': u't+ 0:45'}] + +""" + +reports = Erowid.search_reports("1P-LSD") +print(reports[0].keys()) +for report in reports[:5]: + print(report["substance"], report["url"], report["date"]) + +""" +['date', 'url', 'substance', 'name', 'author'] +1P-ETH-LAD https://erowid.org/experiences/exp.php?ID=109647 Dec 9 2016 +1P-LSD https://erowid.org/experiences/exp.php?ID=108914 Aug 1 2016 +1P-LSD https://erowid.org/experiences/exp.php?ID=108138 Mar 16 2016 +1P-LSD https://erowid.org/experiences/exp.php?ID=108063 Mar 11 2016 +1P-LSD https://erowid.org/experiences/exp.php?ID=107880 Feb 3 2016 +""" +``` \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..ea8a3c8 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +requests +requests_cache +bs4 \ No newline at end of file diff --git a/setup.py b/setup.py index 0b56be4..51ff5a7 100644 --- a/setup.py +++ b/setup.py @@ -2,12 +2,12 @@ from setuptools import setup setup( name='PySychonaut', - version='0.5.1', + version='0.6.0', packages=['pysychonaut'], url='https://github.com/OpenJarbas/PySychonaut', license='apache2.0', author='jarbasAI', author_email='jarbasai@mailfence.com', description='unnoficial erowid, psychonaut wiki and ask_the_caterpillar apis', - install_requires=["lxml", "bs4", "requests"] + install_requires=["bs4", "requests", "requests_cache"] )