This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
{"HI95 Kauai":{"name":"HI95 Kauai","website":"http://www.hi95kauai.com/","stream":"https://pacificmedia.cdnstream1.com/2789_64.aac","genres":["hawaiian","tropical",""],"description":"","discontinued":"false"},"KPOA 93.5 FM":{"name":"KPOA 93.5 FM","website":"https://kpoa.com","stream":"https://pacificmedia.cdnstream1.com/2794_64.aac","genres":["hawaiian","tropical",""],"description":"Hawaiian Music Maui Style","discontinued":"false"},"UKULELE ISLAND":{"name":"UKULELE ISLAND","website":"http://ukulele-island.com","stream":"http://s3.voscast.com:8662/;stream1675516540823/1","genres":["ukulele","hawaiian",""],"description":"UKULELE ISLAND features artists from Hawaii and beyond.","discontinued":"false"},"Hawaiian Music Live":{"name":"Hawaiian Music Live","website":"https://www.hawaiianmusiclive.xyz","stream":"http://s6.voscast.com:10108/;","genres":["hawaiian",""],"description":"Globally engaging our communities through Live Hawaiian Music and Events","discontinued":"false"},"Hawaiian 105 - KINE":{"name":"Hawaiia |
This file contains hidden or 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
use framework "Vision" | |
on getImageText(imagePath) | |
-- Get image content | |
set theImage to current application's NSImage's alloc()'s initWithContentsOfFile:imagePath | |
-- Set up request handler using image's raw data | |
set requestHandler to current application's VNImageRequestHandler's alloc()'s initWithData:(theImage's TIFFRepresentation()) options:(current application's NSDictionary's alloc()'s init()) | |
-- Initialize text request |
This file contains hidden or 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
use framework "Vision" | |
on getImageAnimals(imagePath) | |
-- Get image content | |
set theImage to current application's NSImage's alloc()'s initWithContentsOfFile:imagePath | |
-- Set up request handler using image's raw data | |
set requestHandler to current application's VNImageRequestHandler's alloc()'s initWithData:(theImage's TIFFRepresentation()) options:(current application's NSDictionary's alloc()'s init()) | |
-- Initialize text request |
This file contains hidden or 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
use framework "SoundAnalysis" | |
set confidenceThreshold to 0.6 -- Level of confidence necessary for classification to appear in result | |
set theResult to "" -- Sequence of sound classification labels throughout the sound file's duration | |
-- Analyze sound file for classifiable sounds | |
on analyzeSound(filePath) | |
global theResult | |
-- Initialize sound analyzer with file |