A Python logging library for sending logs to Diaspora Streams (Kafka)
Project description
Diaspora Logger
Diaspora Logger is a library for logging and processing events to Diaspora Stream using Globus Auth for authentication. Follow the steps below to set up and run the example producer and consumer scripts.
Setup
-
Generate Globus Auth Refresh Token: Run
credentials.py
to generate a Globus Auth refresh token.python credentials.py
Here's an example run:
Please visit the following URL to authorize the application: <Globus Auth /authorize endpoint> Paste the authorization code here: <authorization-code> *** For Python clients (e.g., example_producer.py and example_consumer.py): export DIASPORA_REFRESH=<Globus-Auth-refresh-token> *** Credential subject claim: <subject-claim> Credential subject username: <subject-username>
If it's your first time using the topic, call
claim_topics(<subject-claim>)
to claim all topics that are prefixed with the user's subject claim. -
Export Credential: Export the generated refresh token to your environment.
export DIASPORA_REFRESH=<Globus-Auth-refresh-token>
-
Running Producer: Set the
topic
variable to your producer topic, then callrun_producer_example()
to start the producer.topic = "<producer-topic>" run_producer_example()
-
Running Consumer: Set the
topic
andgroup_id
variables to your consumer topic and group ID respectively, then callrun_consumer_example(topic, group_id)
to start the consumer.topic = '<consumer-topic>' group_id = '<consumer-group-id>' run_consumer_example(topic, group_id)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for diaspora_logger-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88201d57c1cf8aa26d31a787c643734611b2e067cb2421d5f621acc6265553c9 |
|
MD5 | 2a9414f095ea85157f53ea241b1c3197 |
|
BLAKE2b-256 | b4041b5c614e3f4b6b9b5129219f74692d4b7b1b28263b30dd325d39183b4f71 |