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.from diaspora_logger import request_token_workflow request_token_workflow()
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> credential access token: <access-token> (expires in two days) credential refresh token: <refresh-token> (expires in six months of inactivity)
If it's your first time producing to a topic, use our ACL endppoint to claim one or more topics.
-
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(topic)
-
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)
Public ACL endpoint
TODO
Communication Flows
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.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08c77cdab60127c28487813cfe832f026c6012538c1d5469a5c8e350e4d02ca6 |
|
MD5 | b5da00ff93055450c22eca650140243a |
|
BLAKE2b-256 | 182ba54f58ca3bebe3640e19a94a293eecbfa16d01894184dcac280141cc9dae |