Giter Site home page Giter Site logo

kevinqz / pylogu Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 2.45 MB

The pylogu library offers a powerful yet intuitive interface for integrating Logu's real-time monitoring and analytics capabilities into your Python applications.

Home Page: https://www.logu.app

Python 100.00%
notification notification-api notification-center notification-service notification-system notifications logu

pylogu's Introduction

Logu - Python SDK

The pylogu library offers a powerful yet intuitive interface for integrating Logu's real-time monitoring and analytics capabilities into your Python applications. Designed with an emphasis on Developer Experience, it provides easy-to-use functionalities for logging events, identifying users, and gaining insights, all with real-time updates and custom notifications.

Key Features

  • Developer-Friendly: Straightforward setup and easy integration.
  • Customizable Logging: Tailor log details to your project's needs.
  • User Identification: Easily track and manage user data.
  • Insightful Analytics: Gain valuable insights with minimal setup.
  • Real-Time Updates: Stay up-to-date with the latest data.

About Logu

Revolutionize your business with Logu – the epitome of simplicity and efficiency. Enjoy an unparalleled Developer Experience, an intuitive log interface, and customized notifications. Stay ahead with real-time insights. Logu isn't just a tool; it's your pathway to smarter, faster business decisions.

Start using at: www.logu.app

After creating your account, an API Key, a Project and a Channel, you can start using this: Logu Example Usage Template hosted in a Replit Repl


Setup

0️⃣Install pylogu

Using pip

pip install pylogu

Using poetry

poetry add pylogu

Simple Usage

1️⃣ Import Logu Client

from pylogu import Logu

2️⃣ Initialize the Logu client

logu = Logu(LOGU_API_KEY, LOGU_PROJECT, LOGU_CHANNEL)

3️⃣ Using the 'log' function

logu.log(LOGU_EVENT, LOGU_ICON)
# logu.log(LOGU_PROJECT, LOGU_CHANNEL, LOGU_EVENT, LOGU_ICON)

🙋 Using the 'identify' function

logu.identify(LOGU_USER_ID, LOGU_USER_PROPERTIES)
# logu.identify(LOGU_PROJECT, LOGU_USER_ID, LOGU_USER_PROPERTIES)

💡 Using the 'insight' function

logu.insight(LOGU_INSIGHT, LOGU_ICON, LOGU_INSIGHT_VALUE)
# logu.insight(LOGU_PROJECT, LOGU_INSIGHT, LOGU_ICON, LOGU_INSIGHT_VALUE)

Usage Example

1️⃣ Import Logu Client

from pylogu import Logu

2️⃣ Initialize the Logu client

logu = Logu(
    key=LOGU_API_KEY,
    project=LOGU_PROJECT,
    channel=LOGU_CHANNEL # channel is optional
)

3️⃣ Using the 'log' function

log_response = logu.log(
    # project=LOGU_PROJECT || None,
    # project is required, but optional if you initiated the client with a project
    # channel=LOGU_CHANNEL || None,
    # channel is required, but optional, even if you didn't initiate the client with a channel
    event=LOGU_EVENT,
    icon=LOGU_ICON
)
print("Log Response:", log_response)

🙋 Using the 'identify' function

identify_response = logu.identify(
    # project=LOGU_PROJECT || None,
    # project is required, but optional if you initiated the client with a project
    user_id=LOGU_USER_ID,
    properties=LOGU_USER_PROPERTIES
)
print("Identify Response:", identify_response)

💡 Using the 'insight' function

insight_response = logu.insight(
  # project=LOGU_PROJECT || None,
    # project is required, but optional if you initiated the client with a project
    insight=LOGU_INSIGHT, 
    icon=LOGU_ICON, 
    value=LOGU_INSIGHT_VALUE
)
print("Insight Response:", insight_response)

⚠️ For Test Purposes Only ⚠️

from example_config import * # This file have some example configs that you can adjust according to your needs or set the variables directly in the code

1️⃣ Import Logu Client

from pylogu import Logu

2️⃣ Initialize the Logu client

logu = Logu(
    key=LOGU_API_KEY,
    project=LOGU_PROJECT,
    channel=LOGU_CHANNEL # channel is optional
)

3️⃣ Using the 'log' function

log_response = logu.log(
    project=random.choice([LOGU_PROJECT, None]),
    # project is required, but optional if you initiated the client with a project
    channel=random.choice([LOGU_CHANNEL, None]),
    # channel is required, but optional, even if you didn't initiate the client with a channel
    event=LOGU_EVENT,
    icon=LOGU_ICON
)
print("Log Response:", log_response)

🙋 Using the 'identify' function

identify_response = logu.identify(
    # project=LOGU_PROJECT,
    # project is required, but optional if you initiated the client with a project
    user_id=LOGU_USER_ID + random.choice(["1", "2"]),
    properties=LOGU_USER_PROPERTIES
)
print("Identify Response:", identify_response)

💡 Using the 'insight' function

insight_response = logu.insight(
    # project=LOGU_PROJECT,
    # project is required, but optional if you initiated the client with a project
    insight=LOGU_INSIGHT, 
    icon=LOGU_ICON, 
    value=LOGU_INSIGHT_VALUE
)
print("Insight Response:", insight_response)

pylogu's People

Contributors

kevinqz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.