Skip to main content

library.qpubsub

pubsub layer for NLP services

Usages

Configs

You need to configure these in your service:

{
    "PROJECT_ID": "...",
    "SUBSCRIPTION_NAME": "...",
    "TOPIC_NAME": "...",
    "MAX_MESSAGES": ...
}

Where: PROJECT_ID: qordoba project id e.g. qordoba-devel SUBSCRIPTION_NAME: a subscription to pull the messages from e.g. dev4.segment-delegator.gender-tone-pubsub.allLang TOPIC_NAME: where to publish the result messages e.g. dev4.segment-delegator.gender-tone-pubsub-latch.allLang MAX_MESSAGES: The maximum number of messages in the subscriber queue e.g. 100

Use PubSub only

Add this to the service application.py

    ps_connection = QPubSub(
        analyzer,
        white_lister=whitelister,
        category=category,
        verbose=VERBOSE,
        debug=DEBUG,
        ignore_html=IGNORE_HTML,
        sentence_token_limit=SENTENCE_TOKEN_LIMIT,
        ignore_inside_quotes=False
    )

    ps_connection.connect()

Use PubSub with REST

Add this to the service application.py

    rest_connection = QRest(
        analyzer,
        white_lister=whitelister,
        category=category,
        verbose=VERBOSE,
        debug=DEBUG,
        ignore_html=IGNORE_HTML,
        sentence_token_limit=SENTENCE_TOKEN_LIMIT,
        ignore_inside_quotes=False
    )
    ps_connection = QPubSub(
        analyzer,
        white_lister=whitelister,
        category=category,
        verbose=VERBOSE,
        debug=DEBUG,
        ignore_html=IGNORE_HTML,
        sentence_token_limit=SENTENCE_TOKEN_LIMIT,
        ignore_inside_quotes=False
    )

    ps_connection.connect_with_rest(rest_connection)

Service docker changes to compile google-cloud-pubsub

add the following lines before pip install -r requirements.txt command

    apk update && \
    apk add --virtual build-dependencies linux-headers build-base gcc && \

add the following lines after pip install -r requirements.txt command

    apk del build-dependencies && \
    rm -rf /var/cache/apk/* && \

License

This software is not licensed. If you do not work at Qordoba, you are not legally allowed to use it. Also, it's just helper functions that really won't help you. If something in it does look interesting, and you would like access, open an issue.

TODO

  • reduce compile time
  • add tests
  • handle errors, e.g. publish it to an error topic or return empty issues to the same topic.

Metadata

Release files for qpubsub 0.1.0

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

Source distribution (sdist)

Source distribution for qpubsub 0.1.0
File Size Uploaded Provenance Actions
qpubsub-0.1.0.tar.gz 4.4 kB Without provenance Details for qpubsub-0.1.0.tar.gz

Release files / qpubsub-0.1.0.tar.gz

Download URL qpubsub-0.1.0.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
8cd2293a3662f5f509a27bff73ea625fd7a29d1da246b2691d2ef87e816d44a1
BLAKE2b-256 checksum
How to use checksums
8cd4c6f0c290502444153e4377dca43cd641b3dd1becebc953eab135d10ae6f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.6

Security for qpubsub 0.1.0

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file No provenance

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