Skip to main content

A macOS .app information retriever for Python 3

Project description

macApp

A macOS .app information retriever for Python 3

Installation

pip install macApp --upgrade

Works for Python >=3.1

Usage

>>> import macApp
>>> macApp.App(<path>)
'App Name'
# Example:
>>> VSCode = macApp.App("/Applications/Visual Studio Code - Insiders.app")
>>> VSCode.architectures
['arm64']
>>> VSCode.used_dates
['2020-12-24 08:00:00 +0000', '2020-12-24 23:00:00 +0000', '2020-12-25 23:00:00 +0000', '2020-12-26 23:00:00 +0000', '2020-12-27 23:00:00 +0000', '2020-12-28 23:00:00 +0000', '2020-12-29 23:00:00 +0000']
>>> VSCode.size
'276.41MB'
>>> VSCode.copyright
'Copyright (C) 2019 Microsoft. All rights reserved'
>>> VSCode.creation_date
'2020-12-16 00:00:00 +0000'
>>> VSCode.bundle_id
'com.microsoft.VSCodeInsiders'
>>> VSCode.bundle_id.vendor
'microsoft'
>>> VSCode.bundle_id.app
'VSCodeInsiders'
>>> VSCode.bundle_id.version
'1.53.0-insider'
>>> VSCode.bundle_id.version.major
1
>>> VSCode.as_dict
{'displayName': 'Visual Studio Code - Insiders.app', 'alternateNames': ['Visual Studio Code - Insiders.app'], 'category': 'public.app-category.developer-tools', 'categoryType': None, 'bundleID': {'id': 'com.microsoft.VSCodeInsiders', [...] 'minor': 53, 'patch': 0, 'other': None}}

Methods

  • kill(signal=None)

Closes the app if running (is_running == True)

The 'signal' parameter is used specify a special signal used with killall

  • relatives(starting_path=OPTIMIZEDPATH, no_warning=False)

Searches for all of the files which might be related to the app

The 'starting_path' parameter is used specify which directory (folder) to start searching from
The 'no_warning' parameter is used specify if macApp should display warnings or not

OPTIMIZEDPATH or macApp.utils.OptimizedPath() is a variable used to indicate relatives() that we want to search through predefined paths which are more likely to have files related to the app

  • uninstall(starting_path=OPTIMIZEDPATH, no_warning=False)

Moves all of the files found by relatives() to a folder and creates a report

'starting_path' is the same as the one on relatives()
'no_warning' is the same as the one on relatives()

How does it work

macApp parses the result from the shell macOS built-in shell command mdls to retrieve information about the app

Dependencies

This module uses one dependency to ensure that created reports are safely written to

  • safeIO

Credit

macApp by Anime no Sekai

© Anime no Sekai — 2020

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

macApp-1.1.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

macApp-1.1-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file macApp-1.1.tar.gz.

File metadata

  • Download URL: macApp-1.1.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.23.0 setuptools/49.6.0.post20201009 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.1

File hashes

Hashes for macApp-1.1.tar.gz
Algorithm Hash digest
SHA256 5c30ff5ce161a70ee2a695e888b277c7f819a8452ac5e1be8f75ef464f497125
MD5 ec55ac7f61f285d0a8ed871d3a74b10f
BLAKE2b-256 880680a127bcf96bca984b4ffda1dce700c5cb5e54c7fefbeca6a82ce7c98041

See more details on using hashes here.

File details

Details for the file macApp-1.1-py3-none-any.whl.

File metadata

  • Download URL: macApp-1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.23.0 setuptools/49.6.0.post20201009 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.1

File hashes

Hashes for macApp-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9b21cc22e0bd8ddf36c9e787a5d151212792dc0a20fe1c7b1dd63f3f80933f7e
MD5 8f99817850c7aa078dbee3e852a5a3fb
BLAKE2b-256 164ad36f05edb01ba261e97b7e9f824658720fc3235929d18a35e47ca5d1d037

See more details on using hashes here.

Supported by

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