This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"New England Public Radio WFCR":{"name":"New England Public Radio WFCR","website":"https://www.nepm.org","stream":"https://nepr.streamguys1.com/WFCR.mp3","genres":["community","news","classical","jazz","public",""],"description":["News"," jazz"," and classical music."],"discontinued":"false"},"Venice Classic Radio":{"name":"Venice Classic Radio","website":"https://www.veniceclassicradio.eu","stream":"https://uk2.streamingpulse.com/ssl/vcr2","genres":["classical","baroque","opera","italian",""],"description":["A repertoire of early"," baroque"," classical and romantic music!"],"discontinued":"false"},"Minnesota Public Radio YourClassical":{"name":"Minnesota Public Radio YourClassical","website":"https://www.yourclassical.org/playlist/classical-mpr","stream":"https://cms.stream.publicradio.org/cms.aac","genres":["classical","public",""],"description":"YourClassical MPR provides lively classical music and good company to listeners throughout the day.","discontinued":"false","location":["Minneapolis"," Minnesota |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Tested with PyXA 0.1.1 | |
import PyXA | |
from enum import Enum | |
class LockPosition(Enum): | |
NONE = 0 | |
LOCK_TOP_LEFT = 1 | |
LOCK_TOP = 2 | |
LOCK_TOP_RIGHT = 3 | |
LOCK_RIGHT = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import Counter | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import PyXA # Version 0.2.0 | |
app = PyXA.Application("Music") | |
tracks = app.tracks().greater_than("duration", 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import Counter | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import PyXA # Version 0.2.0 | |
app = PyXA.Application("Music") | |
genre_data = Counter(app.tracks().genre()).most_common() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PyXA | |
from random import random | |
# Horizontal stitching | |
colors = [PyXA.XAColor(random(), 0, random()) for i in range(100)] | |
swatches = [c.make_swatch(10, 500) for c in colors] | |
PyXA.XAImage.horizontal_stitch(swatches).show_in_preview() | |
# Vertical stitching | |
files = ["/Users/exampleUser/Desktop/cat1.jpeg", "/Users/exampleUser/Desktop/cat2.jpeg", "/Users/exampleUser/Desktop/cat3.jpeg"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PyXA # Version 0.2.0 | |
text = PyXA.XAText("Tim Cook is the CEO of Apple.") | |
print(text.tag_entities()) | |
# [('Tim', 'PersonalName'), ('Cook', 'PersonalName'), ('is', 'Verb'), ('the', 'Determiner'), ('CEO', 'Noun'), ('of', 'Preposition'), ('Apple', 'OrganizationName')] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PyXA # Version 0.2.0 | |
# Use the default sentiment scale | |
text = PyXA.XAText("This sucks.\nBut this is great!") | |
print(text.tag_sentiments()) | |
# [('This sucks.\n', 'Negative'), ('But this is great!', 'Positive')] | |
# Use a custom sentiment scale | |
text = PyXA.XAText("This sucks.\nBut this is good!\nAnd this is great!") | |
print(text.tag_sentiments(sentiment_scale=["Very Negative", "Negative", "Somewhat Negative", "Neutral", "Somewhat Positive", "Positive", "Very Positive"])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PyXA # Version 0.2.0 | |
app = PyXA.Application("Mail") | |
dataset = { | |
"junk": app.accounts()[0].mailboxes().by_name("Junk").messages().subject(), | |
"other": app.accounts()[0].mailboxes().by_name("INBOX").messages().subject() | |
} | |
queries = [ | |
"Amazon Web Services Billing Statement Available", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PyXA # Version 0.2.0 | |
from time import sleep | |
flow = PyXA.Application("Flow") | |
in_session = False | |
while True: | |
apps = PyXA.running_applications().localized_name() | |
if "Notes" in apps and not in_session: | |
flow.start() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PyXA # Version 0.2.1 | |
app = PyXA.Application("System Events") | |
desktop_files = app.desktop_folder.files() | |
desktop_folders = app.desktop_folder.folders() | |
# Create sorting bin folders | |
images_folder = app.make("folder", {"name": "Images"}) | |
videos_folder = app.make("folder", {"name": "Videos"}) | |
audio_folder = app.make("folder", {"name": "Audio"}) |