Package: reusable-code-for-document-ai
InstructionsBuild and Push the packages on Artifact RegistryInstall required packagesTo install the required packages, execute the following command::pipinstall-rrequirements.txtCreate a repositoryRun the following command to create a new Python package repository in the current project namedreusable-code-for-document-aiin the locationus-central1.gcloudartifactsrepositoriescreatereusable-code-for-document-ai\--repository-format=python\--location=us-central1\--description="Python package repository"Run the following command to verify that your repository was created:gcloudartifactsrepositorieslistUpdate CodeIf you want to update the code, please make changes inside thereusable_codefolder.Build python packagebuild_package.shscript automates the installation of required pip packages and the build process for a Python package.Prerequisites:Python3should be installed on the systemNotes:Delete thedistfolder if it already exists.Make sure to run the script in a directory where you have appropriate write permissions, as the build process may generate files in the current directory.Usage:Open a terminal or command promptNavigate to the directory where the bash script is located.Update the version number in thesetup.cfgfile before uploading the package.Execute the bash script using the following command:Give execute permission to your scriptchmod+xbuild_package.shAnd to run your script./build_package.shThis script build the Python package using thepython3 -m buildcommand. This step generates the distribution files for the package.
After run this bash script you will see this script create adistdirectoryUpload the package to the repositoryUpload the packages to the repository from yourdistdirectorytwineupload--repository-urlhttps://us-central1-python.pkg.dev/saifuls-playground/reusable-code-for-document-ai/--verbosedist/*Installing processFollowing instructions will guide you through setting up the keyring library and configuring it to work with the Rebuy Product API.Note:If you are trying to install it on a local machine, rungcloud initbefore startingSetting up keyringStart by updating the package list usingsudoaptupdate-yThe following command to install pip for Python 3sudoaptinstallpython3-pip-yInstall the keyring librarypipinstallkeyringInstall the Artifact Registry backendArtifact Registry backend is required for authentication with the Rebuy Product API. Install it by running the following command:pipinstallkeyrings.google-artifactregistry-authInstallingInstall usingpipcommandUse the pip command to install this package:pipinstall-ihttps://us-central1-python.pkg.dev/saifuls-playground/reusable-code-for-document-ai/simple/reusable-code-for-document-aiBasic Usagefrom reusable_code.process_document import CustomGoogleDocAIProcessor

processor = GoogleDocAIProcessor(
    location="your_location",
    processor_name="your_processor_name",
    processor_options=your_processor_options
)

document = processor.process_document("path_to_your_document")Make sure to replaceyour_location,your_processor_name,your_processor_options, andpath_to_your_documentwith appropriate values.ReferenceStore Python packages in Artifact RegistrySet up authentication to Python package repositories