{"id":19607185,"url":"https://github.com/robocorp/example-private-pypi","last_synced_at":"2025-04-23T16:40:22.575Z","repository":{"id":53843659,"uuid":"460763192","full_name":"robocorp/example-private-pypi","owner":"robocorp","description":"Recipe for accessing private PyPI packages with credentials in Robocorp Vault","archived":false,"fork":false,"pushed_at":"2023-07-31T19:25:13.000Z","size":46,"stargazers_count":1,"open_issues_count":1,"forks_count":3,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-03-30T01:35:40.779Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robocorp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-18T08:05:41.000Z","updated_at":"2022-09-21T07:38:04.000Z","dependencies_parsed_at":"2025-01-10T08:33:25.700Z","dependency_job_id":null,"html_url":"https://github.com/robocorp/example-private-pypi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robocorp%2Fexample-private-pypi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robocorp%2Fexample-private-pypi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robocorp%2Fexample-private-pypi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robocorp%2Fexample-private-pypi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robocorp","download_url":"https://codeload.github.com/robocorp/example-private-pypi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250471786,"owners_count":21436022,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T10:09:11.704Z","updated_at":"2025-04-23T16:40:22.556Z","avatar_url":"https://github.com/robocorp.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Using private python packages in robots\n\nRecipe for using private packages securely with credentials in Robocorp Vault.\n\nIn the example [requirements-private.txt](https://github.com/robocorp/example-private-pypi/blob/master/requirements-private.txt)\nyou'll find how to install Python packages from different sources:\n- Private PyPI service.\n- Private GitHub repository.\n- Local source with a directory path accessible by the robot.\n\n## Setup \u0026 Run\n\n1. Go to Robocorp Control Room and create a Vault secret with name: `private_pypi` and add the following keys:\n   - `pypi_usr` : username for private PyPI source\n   - `pypi_pwd` : password for private PyPI source\n   - `github_token` : Access token for GitHub source\u003cbr/\u003e\u003cbr/\u003e\n   \u003cimg src=\"https://raw.githubusercontent.com/robocorp/example-private-pypi/master/bin/vault.png\" alt=\"Vault example\" width=\"400\"\u003e\u003cbr/\u003e\u003cbr/\u003e\n\n2. Link your VS Code Robocorp extension to Control Room so that it has access to the Vault secrets.\n   * The robot executions with Workforce Agent and Assistant automatically get the secure Vault access.\n3. Run the bot with VSCode and select a task demonstrating how the private packages get installed and used.\n\n## Tasks\n\n- `Private PyPI Library Usage`\n  - Installs and uses a library from a private PyPI.\n  - Requires a Vault secret with name `private_pypi` containing keys: `pypi_usr` and `pypi_pwd`.\n- `Private Repo Or Local Source Library Usage`\n  - Installs and uses a library from either a private repository or a local source. \n  - Requires a Vault secret with the name `private_pypi` containing key: `github_token`.\n  - To choose between the sources, just comment out the lines you don't want in the requirements file.\n\n## How it works\n\n1. The [robot.yaml](https://github.com/robocorp/example-private-pypi/blob/master/robot.yaml) contains an entry called `preRunScripts` which instructs **rcc** to execute a script like [private-pip-install.py](https://github.com/robocorp/example-private-pypi/blob/master/bin/private-pip-install.py) right before the robot run.\n2. The script receives as parameters the Vault secret store name and the path to the [requirements](https://github.com/robocorp/example-private-pypi/blob/master/requirements-private.txt) file to be installed by **pip**, containing private sources for the dependencies.\n3. The script injects into the environment variables used by the `pip install`, which is run to install the private requirements.\n4. Once the script finishes, the selected task will run and use the previous library installed, thus demonstrating that the Python environment contains the requested dependencies from private sources.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobocorp%2Fexample-private-pypi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobocorp%2Fexample-private-pypi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobocorp%2Fexample-private-pypi/lists"}