Python API and command-line interface for working with Sonatype Nexus
How to install
pip install repositorytools
Some command line examples
Preparing env. variables
export REPOSITORY_URL=https://repo.example.com export REPOSITORY_USER=admin export REPOSITORY_PASSWORD=mysecretpassword
Uploading an artifact
artifact upload foo-1.2.3.ext releases com.fooware
Resolving artifact’s URL
artifact resolve com.fooware:foo:latest
Deleting artifacts
# by url artifact delete https://repo.example.com/content/repositories/releases/com/fooware/foo/1.2.3/foo-1.2.3.ext # by coordinates artifact resolve com.fooware:foo:latest | xargs artifact delete
Working with staging repositories
Nexus Professional only
repo create -h repo close -h repo release -h repo drop -h repo list -h
Working with custom maven metadata
Nexus Professional only
artifact get-metadata -h artifact set-metadata -h
Some library examples
For most of methods the same env. variables as above have to be exported or specified in call of repository_client_factory()
Uploading artifacts
import repositorytools artifact = repositorytools.LocalArtifact(local_path='~/foo-1.2.3.jar', group='com.fooware') client = repositorytools.repository_client_factory(user='admin', password='myS3cr3tPasswOrd') remote_artifacts = client.upload_artifacts(local_artifacts=[artifact], repo_id='releases') print(remote_artifacts)
Resolving artifacts
Works even without authentication.
import repositorytools
artifact = repositorytools.RemoteArtifact.from_repo_id_and_coordinates('test', 'com.fooware:foo:1.2.3')
client = repositorytools.repository_client_factory()
client.resolve_artifact(artifact)
print(artifact.url)
Deleting artifacts
import repositorytools
artifact = repositorytools.RemoteArtifact.from_repo_id_and_coordinates('test', 'com.fooware:foo:1.2.3')
client = repositorytools.repository_client_factory(user='admin', password='myS3cr3tPasswOrd')
client.resolve_artifact(artifact)
client.delete_artifact(artifact.url)
Documentation
Support
- You can support my effort many ways:
create issues
fix issues (by sending pull requests)
donating on https://gratipay.com/~stardust85/, you can send even 1 cent per month ;) (but the more the better)
Metadata
Release files for repositorytools 4.2.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| repositorytools-4.2.5.tar.gz | 12.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| repositorytools-4.2.5-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 30.5 kB
Release files / repositorytools-4.2.5.tar.gz
| Download URL | repositorytools-4.2.5.tar.gz |
|---|---|
| Size | 12.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
174dd2de1e1913e430aadad414f5cd0f5aaa21c8b525b99a762f5bdcdbe94ecc
|
|
BLAKE2b-256 checksum How to use checksums |
42a723858fc48ae971faef714d89b56bcf19e1bf1e370e039724862f3250c938
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / repositorytools-4.2.5-py2.py3-none-any.whl
| Download URL | repositorytools-4.2.5-py2.py3-none-any.whl |
|---|---|
| Size | 17.7 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
16ab1afd6c14730d426e4116be1eaa2c3b62629a2c9fc56401b7321e2e193517
|
|
BLAKE2b-256 checksum How to use checksums |
899f170c0fb4ef0b8ff1945b6b0f6e8d2c175e43004d04ce1a8b97dc637e4d5e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for repositorytools 4.2.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.