API Reference¶
- Descriptors
- Resolver
Environment
Environment.environmentPath()
Environment.loadEnvironmentFile()
Environment.updateEnvironmentDescriptorFromDict()
Environment.removeDescriptorFromEnvironment()
Environment.createEnvironmentFile()
Environment.resolveFromPath()
Environment.resolve()
Environment.shutdown()
Environment.packageFromPath()
Environment.packageForDescriptor()
Environment.existingPackage()
Environment.packageByName()
Environment.testPackagesInCurrentEnv()
- Package
isPackageDirectory()
Package
Package.fromData()
Package.setVersion()
Package.processFile()
Package.setPath()
Package.exists()
Package.processData()
Package.dirname()
Package.setName()
Package.delete()
Package.searchStr()
Package.nameForPackageNameAndVersion()
Package.resolve()
Package.resolveEnvPath()
Package.save()
Package.updateAndWriteVersion()
Package.createZip()
Package.copyTo()
Package.runInstall()
Package.runUninstall()
Package.runStartup()
Package.shutdown()
- Plugin Manager
PluginManager
PluginManager.registerByEnv()
PluginManager.registerPaths()
PluginManager.registerPath()
PluginManager.registerByModule()
PluginManager.registerByPackage()
PluginManager.registerPlugin()
PluginManager.loadPlugin()
PluginManager.loadAllPlugins()
PluginManager.getPlugin()
PluginManager.unload()
PluginManager.unloadAllPlugins()
- Plugin
- Environment registry
- Git Wrapper
- Change Log
- Utilties
- Environment handling
- Filesystem
- Processes
SubprocessError
subprocessCheckOutput()
checkOutput()
Singleton
importModule()
iterModules()
iterMembers()
isDottedPath()
iterSubclassesFromModule()
asDottedPath()
runScriptFunction()
CentralLogManager
logLevels()
levelsDict()
getLogger()
globalLogLevelOverride()
reloadLoggerHierarchy()
iterLoggers()
rootLogger()
setGlobalDebug()
isGlobalDebug()
flushUnder()
reloadZoo()
camelToNice()
titleCase()
newLines()
isStr()
fileSafeName()
wordWrapPath()
shortenPath()
trailingNumber()
incrementName()
findNonAscii()
isAscii()
Zoo Config Manager¶
- class Zoo(zooPath)¶
Bases:
object
Zoo class is the main entry point for operating on any part of zoo tools.
- Parameters:
zooPath (str) – The root location of zootools root folder ie. the one above the installation folder.
- Raise:
errors.FileNotFoundError
- coreVersion()¶
Returns core(this) package version string.
- Returns:
coreVersion ie. “1.0.0”
- Return type:
- buildVersion()¶
Returns the Zoo Tools build version string.
- Returns:
buildVersion ie. “1.0.0”
- Return type:
- buildPackagePath()¶
Returns the fullPath to the zoo_package.json which is the build package.
- Returns:
str
- property isAdmin¶
Returns whether the current user is in admin mode.
- Returns:
True if admin.
- Return type:
- property commands¶
Returns the executable cli commands dict cache.
- Returns:
Plugin manager instance
- Return type:
- property rootPath¶
Returns the root path of zootools.
The root path directory is the folder above the installation folder
- Returns:
The root folder of zootools.
- Return type:
- property configPath¶
Returns the config folder which sits below the root.
- Returns:
The config folder for zootools.
- Return type:
- property corePath¶
The core folder of zootools which is relative to the root under the installation folder.
The core folder houses internal logic of zootools package management.
- Returns:
The core folder
- Return type:
- property packagesPath¶
Returns the package repository path under the zootools/install folder.
This folder is the location for all installed packages. Each package Housed here is in the form of:
Packages - packageName - packageVersion(LooseVersion) -code
- Returns:
The package’s folder.
- Return type:
- property pythonPath¶
Returns the python folder path under the core installation.
- Returns:
The “python” folder path.
- Return type:
- property resolver¶
Returns the environment resolver instance which contains the package cache.
- Returns:
The Environment Resolver instance
- Return type:
resolver.Environment
- property commandLibrary¶
Returns the CLI command plugin manager instance.
Only one is created per Zoo session
- Return type:
pluginmanager.PluginManager
- property descriptorLibrary¶
Returns the descriptor types plugin manager instance.
Only one is created per Zoo session
- Return type:
descriptor.DescriptorRegistry
- preferenceRootsPath()¶
Returns the preferences roots config file path in the installRoot/config/env folder.
- Return type:
- preferenceRootsConfig()¶
Loads and returns the preference_roots file contents as a dict
- Return type:
- cacheFolderPath()¶
Returns the current Zoo tools cache folder.
The cache folder is used to store temporary data like pip installed libraries, logs, temp export files etc.
- Return type:
- sitePackagesPath()¶
Returns the site packages folder path where zootools installs pip packages when needed. This path is python version dependent.
- Return type:
- descriptorFromDict(descriptorDict)¶
Helper method which calls for
zoo.core.descriptors.descriptor.descriptorFromDict()
- Parameters:
descriptorDict (dict) – See
zoo.core.descriptors.descriptor.descriptorFromDict()
for more info- Returns:
The corresponding Descriptor instance
- Return type:
- descriptorForPackageName(name)¶
Returns the matching descriptor instance for the package name.
- Parameters:
name (str) – The zoo package name to find.
- Returns:
The descriptor or None
- Return type:
- descriptorsForPackageNames(*names)¶
Returns the matching descriptor instances for the package names.
- Parameters:
names (tuple[str]) – The zoo package names to find.
- Returns:
The descriptor or None
- Return type:
list[
zoo.core.descriptors.descriptor.Descriptor
or None]
- descriptorFromPath(location, descriptorDict)¶
Given absolute path and descriptor dict return the matching Descriptor instance.
- Parameters:
- Return type:
- runCommand(commandName, arguments)¶
Run’s the specified CLI command.
User runCommand(“commandName”, [”–help”]) to get the command help.
- shutdown()¶
Shutdown Method for zootools excluding Host application plugin related code.
- currentConfig()¶
Returns the
Zoo
instance currently initialized globally.If this func returns None call
zooFromPath()
.
Exception Types¶
- exception PackageAlreadyExists¶
Bases:
Exception
Raised when the package requested already exist.
- exception MissingPackageVersion¶
Bases:
Exception
Raised when the requested package doesn’t exist in the packages location
- exception MissingPackage¶
Bases:
Exception
- exception DescriptorMissingKeys¶
Bases:
Exception
Raised when the provided descriptor keys doesn’t meet the required descriptor keys
- exception UnsupportedDescriptorType¶
Bases:
Exception
Raised when the provided descriptor information doesn’t match any existing descriptors
- exception MissingGitPython(*args, **kwargs)¶
Bases:
Exception
Error Raised when git python installed in the current python environment
- exception InvalidPackagePath¶
Bases:
Exception
Raised when The package path requested isn’t compatible with zootools.
- exception MissingEnvironmentPath¶
Bases:
Exception
Raised when the package_version.config doesn’t exist
- exception GitTagAlreadyExists¶
Bases:
Exception
Raised request for tag creation already exists
- exception MissingCliArgument¶
Bases:
Exception