#!/usr/bin/env python # coding: utf-8 # # Update the Text-Fabric package (generic) # ## Table of content (TOC) # * 1 - Introduction # * 2 - Managing the installed Text-Fabric versions # * 2.1 - Obtain details on the available Text-Fabric version # * 2.2 - Obtain the current installed Text-Fabric version # * 2.3 - Upgrade to the latest Text-Fabric version # * 2.4 - Update to a specific Text-Fabric version # * 3 - Notebook version # # 1 - Introduction # ##### [Back to TOC](#TOC) # # To ensure optimal performance and access to the latest features, it's important to regularly update your Python environment, including the Text-Fabric package. This Jupyter Notebook offers step-by-step instructions to check the current version of Text-Fabric and update it to the latest release or a specific version, as needed. # # The format of these commands can be used in any cell within a Jupyter Notebook. When running the commands in a shell, you can omit the trailing exclamation mark (!). # # 2 - Managing the installed Text-Fabric versions # ##### [Back to TOC](#TOC) # # The following activities are described in this section of the Notebook: # * Obtain details on the available Text-Fabric version # * Obtain the current installed Text-Fabric version # * Upgrade to the latest Text-Fabric version # * Update to a specific Text-Fabric version # ## 2.1 - Obtain details on the available Text-Fabric version # # An overview of the available Text-Fabric version can be obtained from the page with recent [Text-Fabric release notes](https://annotation.github.io/text-fabric/tf/about/releases.html). # ## 2.2 - Obtain the current installed Text-Fabric version # # The following will list the text-fabric package along with its version: # # ```python # # Check the current version of Text-Fabric # !pip show text-fabric # ``` # When executing this in a Jupyter Notebook cell it will output something like: # #
# Name: text-fabric # Version: 12.5.3 # Summary: Processor and browser for annotated text corpora # Home-page: https://github.com/annotation/text-fabric # Author: Dirk Roorda # Author-email: dirk.roorda@di.huc.knaw.nl # License: # Location: C:\Users\tonyj\anaconda3\envs\Text-Fabric\Lib\site-packages # Requires: flask, ipython, markdown, pyyaml, requests, wheel # Required-by: ## # Note that in the Notebook viewer the exclamation mark is enclosed in a red box which helps users to see that this line is a shell command and not standard Python code. # ## 2.3 - Upgrade to the latest Text-Fabric version # # To upgrade to the latest release of Text-Fabric the following command can be used: # # ```python # # Update Text-Fabric to the latest version # !pip install --upgrade text-fabric # ``` # # When executing this in a Jupyter Notebook cell the following output is shown (which is abbreviated here): # #
# Requirement already satisfied: text-fabric in c:\users\tonyj\anaconda3\envs\text-fabric\lib\site-packages (12.5.1) # Collecting text-fabric # Using cached text_fabric-12.5.3-py3-none-any.whl.metadata (1.9 kB) # Requirement already satisfied: wheel in c:\users\tonyj\anaconda3\envs\text-fabric\lib\site-packages (from text-fabric) (0.41.2) # ... # Requirement already satisfied: six in c:\users\tonyj\anaconda3\envs\text-fabric\lib\site-packages (from asttokens->stack-data->ipython->text-fabric) (1.16.0) # Using cached text_fabric-12.5.3-py3-none-any.whl (12.3 MB) # Installing collected packages: text-fabric # Attempting uninstall: text-fabric # Found existing installation: text-fabric 12.5.1 # Uninstalling text-fabric-12.5.1: # Successfully uninstalled text-fabric-12.5.1 # Successfully installed text-fabric-12.5.3 ## ## 2.4 - Update to a specific Text-Fabric version # # In certain cases, it may be necessary to load a specific version of Text-Fabric. For example, if the analysis described in a publication uses a specific Text-Fabric version, you might need to use the same version to reproduce the results. This typically involves downgrading to an earlier version. # # Downgrading to an earlier Text-Fabric version can be done using the following command: # # ```python # !pip install text-fabric==<desired_version> # ``` # # Where <desired_version> is the unqouted version number. For example to downgrade to version 12.5.1 the following command can be used: # # ```python # # Update Text-Fabric to version 12.5.1 # !pip install text-fabric==12.5.1 # ``` # # As example, when downgrading from version 12.5.3, the following output is shown (which is abbreviated here): # #
# Collecting text-fabric==12.5.1 # Downloading text_fabric-12.5.1-py3-none-any.whl.metadata (1.9 kB) # Requirement already satisfied: wheel in c:\users\tonyj\anaconda3\envs\text-fabric\lib\site-packages (from text-fabric==12.5.1) (0.41.2) # ... # Requirement already satisfied: six in c:\users\tonyj\anaconda3\envs\text-fabric\lib\site-packages (from asttokens->stack-data->ipython->text-fabric==12.5.1) (1.16.0) # Downloading text_fabric-12.5.1-py3-none-any.whl (12.3 MB) # ---------------------------------------- 0.0/12.3 MB ? eta -:--:-- # ... # ---------------------------------------- 12.3/12.3 MB 4.3 MB/s eta 0:00:00 # Installing collected packages: text-fabric # Attempting uninstall: text-fabric # Found existing installation: text-fabric 12.5.3 # Uninstalling text-fabric-12.5.3: # Successfully uninstalled text-fabric-12.5.3 # Successfully installed text-fabric-12.5.1 ## # 3 - Notebook version # ##### [Back to TOC](#TOC) # #
Author | #Tony Jurg | #
Version | #1.1 | #
Date | #9 October 2024 | #