Skip to main content

Backstage Simple Client

A simple client for the Backstage developer portal.

Table of Contents

Installation

To install the Backstage Simple Client, you can use pip:

pip install backstage-simple-client

Usage

Here's an example of how to use the Backstage Simple Client:

from backstage_simple_client.client import BackstageClient
from backstage_simple_client.filters import Filter, FullSearchFilter

# Initialize the client
base_url = "https://example.com"
token = "your-token-here"

with BackstageClient(base_url, token=token) as client:
    # Search entities with a filter
    entities = client.search_entities(
        filter=Filter(metadata_namespace='development')
    )

# Print the results
for entity in entities.items:
    print(entity.metadata.name)

Examples

Multiple filters

entities = client.search_entities(
    filter = [
        Filter(kind='component', metadata_namespace='development'),
        Filter(kind='user')
    ]
)

Full-text search

entities = client.search_entities(
    full_text_filter = FullSearchFilter(term = "foobar", fields = ["metadata.name"])
)

Selecting fields, while applying limits and ordering

entities = client.search_entities(
    filter = Filter(kind='component', metadata_namespace='development'),
    fields = ['kind', 'metadata.name'],
    limit = 10,
    order_field = 'kind,asc'
)

Using pagination

pages = client.search_entities(
        filter   = Filter(kind='user')
        paginate = True
)
for page in pages:
    for entity in page.items:
        print(entity.metadata.name)

Getting entity by uid

entity = client.get_entities(uid="0442f73b-c3e9-4a94-a790-0981809b7267")

Getting entity (with its ancestry) by name

entity = client.get_entities(kind="User", name="jdoe")
entities = client.get_entities(kind="User", name="jdoe", ancestry=True)

Geting entities by refs

entities = client.get_entities(refs=["user:default/jdoe", "user:default/gijoe"], fields=["metadata.name", "metadata.namespace", "metadata.uid"])

Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Metadata

Release files for backstage-simple-client 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for backstage-simple-client 0.1.4
File Size Uploaded Provenance
backstage_simple_client-0.1.4.tar.gz 5.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for backstage-simple-client 0.1.4
File Interpreter ABI Platform
backstage_simple_client-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 13.8 kB

Release files / backstage_simple_client-0.1.4.tar.gz

Download URL backstage_simple_client-0.1.4.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c3ed2276309b89447c994d177402da610c2487ebca6b78d1b0d2af3d571337af
BLAKE2b-256 checksum
How to use checksums
2350f1ca3469b681db9b0c3ab3a863231b789e25c2edc7aa78911ef2b2fef727
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.11.11 Linux/6.8.0-1020-azure

Release files / backstage_simple_client-0.1.4-py3-none-any.whl

Download URL backstage_simple_client-0.1.4-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
44c160b0cf418bde8249aa67537727a61741d1c33317d940e326bb868ca33d86
BLAKE2b-256 checksum
How to use checksums
d9ed4e04faa08ee3d372dd21b51ce054961ed693076852d094c683786f38ccca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.11.11 Linux/6.8.0-1020-azure

Security for backstage-simple-client 0.1.4

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page