Skip to main content

funity

PyPI PyPI - Python Version PyPI - Status PyPI - License PyPI - Format PyPI - Downloads

A Unity3d installation finder and command line helper.

Installation

pip install funity

Usage

In Terminal

python -m funity

# Outputs a JSON-formatted file containing all Unity3d editors found in the current working directory.

# editor.cache
# [
#   "/Applications/Unity/Hub/Editor/2019.2.6f1"
# ]

In Python

from os import getcwd
from pathlib import Path

from funity import UnityEditor, UnityProject, UnityVersion


cache_dir = Path(getcwd()) / 'editor.cache'

# Find all Unity editor installations and cache the results into 'cache_dir'.
editors = UnityEditor.find_in(cache=str(cache_dir))

version = UnityVersion(2019, 2)

# Filter results to only Unity 2019.2.xfx versions.
editors_2019_2 = [e for e in editors if e.version.is_equal_to(version, fuzzy=True)]

# Throw an exception if no compatible Unity version is found.
if not editors_2019_2:
    raise Exception(f'No Unity {version} found.')

# Get the first Unity 2019.2.xfx editor.
editor = editors_2019_2[0]

# Create a UnityProject instance.
project = UnityProject('/Users/you/Projects/HelloWorld')

# Run 'executeMethod' on the Unity project using the Unity editor CLI.
return_code = editor.run(
    '-projectPath', str(project),
    '-buildTarget', 'Win64',
    '-executeMethod', 'BuildPlayerCommand.Execute',
    cli=True,  # Shorthand for '-batchmode', '-nographics', '-quit', '-silent-crashes'.
    log_func=lambda l: print(l, end='')  # Prints all logs from Unity.
)

Changelog

v0.0.11

  • Fixed Unity version detection on Windows installations.

v0.0.10

  • Minor bug fixes.

v0.0.9

  • Added additional UnityProject helper methods.

v0.0.8

  • Added more UnityProject test cases.

v0.0.7

  • Added additional UnityProject helper methods.

v0.0.6

  • Minor bug fixes.

v0.0.5

  • Added support for getting the Unity version for Windows systems.

v0.0.4

  • Added UnityVersion class.
  • Updated the README file.

v0.0.3

  • Some bug fixes when fetching the Unity version for Darwin systems.

v0.0.2

  • Added support for getting the Unity version for Darwin systems.

Metadata

Release files for funity 0.0.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for funity 0.0.11
File Size Uploaded Provenance Actions
funity-0.0.11.tar.gz 10.0 kB Without provenance Details for funity-0.0.11.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for funity 0.0.11
File Interpreter ABI Platform Actions
funity-0.0.11-py3-none-any.whl Python 3 none any Details for funity-0.0.11-py3-none-any.whl

Total release size: 21.5 kB

Release files / funity-0.0.11.tar.gz

Download URL funity-0.0.11.tar.gz
Size 10.0 kB
Tags Source
SHA-256 checksum
How to use checksums
027eed8c082450a9051416a800827fc1eb83e6c86070cb3c90163dbe4e455fd1
BLAKE2b-256 checksum
How to use checksums
dd6c78d52bf0de2e7e77503023fe8749c31fe1232fc966f30d417682ced434f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

Release files / funity-0.0.11-py3-none-any.whl

Download URL funity-0.0.11-py3-none-any.whl
Size 11.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bfb52766814f0a20893529d4c354386f3d084141239264a6be8410a1dab2fa42
BLAKE2b-256 checksum
How to use checksums
ca3c3e988fa9ad7e630de3ce0033b7e3886a7fa557b02b314e1bb2e9297ac928
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

Security for funity 0.0.11

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page