PySychonaut/examples/wiki.py

40 lines
43 KiB
Python
Raw Permalink Normal View History

2018-05-01 23:04:24 +02:00
from pysychonaut import PsychonautWiki
wiki = PsychonautWiki()
2019-12-13 01:50:57 +01:00
# TODO this seems to be gone now? accidental regression?
#print(wiki.fix_substance_names("ice is really bad for you"))
2018-05-01 23:04:24 +02:00
2019-12-13 01:50:57 +01:00
#print(wiki.fix_substance_names("this is not about a substance"))
2018-05-01 23:04:24 +02:00
"""
methamphetamines is really bad for you
False
"""
2019-12-13 01:50:57 +01:00
print(wiki.search_psychonaut_wiki("lsd"))
2018-05-01 23:04:24 +02:00
2019-12-13 01:50:57 +01:00
print(wiki.search_psychonaut_wiki("speed"))
2018-05-01 23:04:24 +02:00
2019-12-13 01:50:57 +01:00
print(wiki.search_psychonaut_wiki("nfajsbguiajshb"))
2018-05-01 23:04:24 +02:00
"""
{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/
{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'Driftin
Warning, this query does not seem to contain a valid substance name
{u'substances': []}
"""
2019-12-13 01:50:57 +01:00
print(wiki.substances)
2018-05-01 23:04:24 +02:00
"""
{'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://psychonautwi
"""
2019-12-13 01:50:57 +01:00
print(wiki.substance_list)
2018-05-01 23:04:24 +02:00
"""
[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'Met
2018-04-18 17:59:46 +02:00
"""