Package: watchful
Watchful Python Package for Interacting with Watchful EnvironmentOverviewThe Watchful Python Package allows installation of the Watchful Python SDK over the internet from PyPI. The Watchful Python SDK enables communication with the Watchful API using Python and helps in the automation of Watchful Python features when used with the product.The current features include the following and their corresponding user guides:Watchful API andnotebookData EnrichmentandnotebookSteps (Use)Install Watchful Python SDK from PyPI (Recommended)If you want to use Python to communicate with the Watchful API, you'll need to install the Watchful Python SDK from PyPI.Install your desired release version (they can be found atPyPI)pip3 install watchful[==your.desired.version]Install Optional Dependencies for EnrichmentIf you intend to enrich using either SpaCy or Flair, you can take advantage of the enrichers we ship with the library. To do so, specifyenrichwhen installing the library.pip3 install watchful[enrich]Basic UsageOnce you have installed the SDK, import it and begin interacting with it.For a more thorough Watchful API introduction, read through ourAPI Introduction Jupyter Notebook.Basic EnrichmentThe Watchful SDK aims to make enrichment a straight-forward task. The following steps assume a brand new user without any projects.Ensure you have the proper Python version and environment setup. Follow theenvironment setup guidefor more details.Open the Watchful AppCreate a new ProjectImport a dataset into your ProjectInstall the latest Watchful SDK from PyPIpython3 -m pip install watchfulInstall spaCypython3 -m pip install spacyInstall spaCy'sen_core_web_smmodelpython -m spacy download en_core_web_smEnrich your currently opened Watchful project’s dataset via terminal window:python3 -m watchful.enrich --host localhost --port 9001# Enter your actual host and port.Note: Enrich via Jupyter Notebook- A more comprehensive guide to enrichment is available in theEnrichment Introduction Jupyter Notebook.For more guides and documentation, see theReadMein theexamplesdirectory.Code PracticesIf contributing to this code, you're encouraged to apply the following code practices.Apply linting and formattingcd to/the/repo_directory/that/being/watchful-pypylama src/watchful/ -o pylama.iniblack src/watchful/ --config=pyproject.toml --diffBuild & Install Watchful Package LocallyBuild the packagehatch buildInstall the built package (add--force-reinstallto guarantee a full (re)installation)pip3 install dist/watchful-<latest.release.version>-py3-none-any.whl [--force-reinstall]<latest.release.version>can be foundhere.Show the installed watchful packagepip3 show watchfulUse Watchful Package in Development Mode (Optional)Interactively use or test package while in development modepip3 install -e . [--force-reinstall]Install Watchful Package from PyPI (Optional)Install your desired release version (they can be found atPyPI)pip3 install watchful[==your.desired.version]Run TestsAfter you've done the preceding steps correctly, you will be able to see the following.Print Watchful versionpython3 -c 'import watchful; print(watchful.__version__);'Run testspytest -W ignore::DeprecationWarning tests/test_*.py -vSteps (Release)After you've done the preceding steps correctly, you will be able to publish Watchful Package to PyPI. Before cutting a release, ensure the release changes are communicated withengineering@watchful.io. There may be corresponding changes required in the Watchful application; do not worry about this as it will be taken care of by Watchful.Prepare ReleaseEnsure yourmainbranch is updated and create a new branch:git checkout main && git pull && git checkout -b bump-versionBump the version in theversion file:e.g. from 1.0.0 to 1.0.1Commit and push the branch to Github:git add src/watchful/VERSION && git commit -m 'bump version' && git push -u origin bump-versionOpen a pull request in Github and merge it tomainafter it is approved.Create ReleaseVisitWatchful Python Package Releasesin GithubClickDraft a new releaseClickChoose a tagType in va.b.cwherea.b.cis the version in theversion file(e.g. v1.0.1 if the version in the version file is 1.0.1)Type in the release title, which is the same value as above, i.e. va.b.cEnsureTargetis set tomain(should be default)EnsurePrevious tagis set to the most current release tag (should be default)ClickGenerate release notesClickPublish releaseThe release will be triggered and CI will automatically build and publish the Watchful Python Package toPyPI.