Skip to main content

A windows current song tracker

Project description

SongTracker

License Python Platform

A python package for windows made to track the current song being listened to.

usage

Intended usage:

from songtracker import SongTracker
import asyncio

# Songtracker().run(callable)
# also possible to do SongTracker().run(callable, check_delay=5)
# default delay is 2.5sec
# Ex:
def broadcast(song):
    print(song) # song object __repr__ is f"{self.title} - {self.artist}"

asyncio.run(SongTracker().run(broadcast)) # will run infinitely and execute broadcast on song change

Manual usage:

from songtracker import SongTracker
import asyncio

# /!\ Use try/Except statement to catch OSError on winrt error
# must be run inside an async function Ex: async def main() asyncio.run(main)

tracker = Songtracker()
if await tracker.get_new_session():
    #generates a winrt session and returns a bool (True = Success)
    if await tracker.update_current_song(): 
        #generates new song object if song has changed and returns bool (True = Success)
        if not tracker.current_song.error:
            # checks if song object is usable (song.error = 1 means artist or title is None)
            # do something
            print(tracker.currentsong) # song object __repr__ is f"{self.title} - {self.artist}"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

songtracker-1.0.0.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

songtracker-1.0.0-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file songtracker-1.0.0.tar.gz.

File metadata

  • Download URL: songtracker-1.0.0.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for songtracker-1.0.0.tar.gz
Algorithm Hash digest
SHA256 62c58034b463fc0706affffc2a05be288032689bed5bcf294cde9555e6b4fba0
MD5 b02c6800661b15b69ba3beed66393bc1
BLAKE2b-256 30483abd44176fc74f1b19ceba40314368b347506909c69bbb47c6470caac425

See more details on using hashes here.

File details

Details for the file songtracker-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: songtracker-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for songtracker-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d91a3ec165db921757c722b9107affe88f14d185e3cf45d6cf6978c908f89575
MD5 ef02c3c67cc4c623d87c2d965fb56f32
BLAKE2b-256 fa48be417c2d8bca283c7b3b6b02283b69b34b70bb5364c6f3d82f1b0e255392

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page