Hello @Rita_Garcia, welcome to the forums!
To answer your questions broadly, you can think of Pyblish as just for
-loop, where each element is a snippet of Python code you write.
def snippet1():
print("Hello ")
def snippet2():
print("World")
def publish():
for snippet in [snippet1, snippet2]:
snippet()
publish()
# Hello World
In Pyblish, these snippets are referred to as “plug-ins”, each plug-in is written by you and Pyblish does only what is within these plug-ins.
For example, if you somehow would like to interact with files, then it is within a plug-in that you decide what to do with these files. Pyblish has no knowledge of what is actually in a plug-in, and you can use the Python standard library as you normally would.
import shutil
from pyblish import api
class MyPlugin(api.ContextPlugin):
def process(self, context):
shutil.copytree("/src/dir", "/dst/dir")
And the same goes for validation. If you should want to ensure one of your conventions, then it’s within a plug-in you could do this.
from pyblish import api
class MyValidator(api.ContextPlugin):
order = api.ValidatorOrder
def process(self, context):
assert context.data["user"] == "marcus", "Wrong user"
You can give Pyblish special knowledge about your plug-in via the order
attribute. In this case, you are letting Pyblish know that this is a “validator” in which case throwing an exception will cause publishing to stop before moving onto the next phase, extraction.
There are 4 pre-defined orders in Pyblish that are run one after the other - collection
, validation
, extraction
and integration
.
To get some hands on experience with these concepts, I would recommend you spent a few minutes running through the first few examples in Learn Pyblish by Example, especially:
- Introduction
- Hello World
- Quickstart
- Files
Yes, as a standalone Python package, you could keep it in sync like any normal Python package. For example via a shared directory, or by keeping track of the version you are currently running.
$ pip install pyblish-base
$ python -c "import pyblish;print(pyblish.version)"
1.4.2
Would it be possible to elaborate on this? I’m not sure what it means.
Pyblish runs entirely within a single Python process and makes no attempts to connect to any external program.
Let me know if this answers your questions, or if you have got more, and good luck!