Skip to main content

A Python module to log workspace entries

Project description

entrylogger

A Python based module to Mark Entry, specificaly built for workspace's

Overview

EntryLogger is a simple yet efficient Python module designed to track entry and exit times for users in a workspace. It integrates with databases like Supabase to log check-in and check-out times. This module can be particularly useful for managing employee or student attendance, monitoring work hours, or even just managing time logs for a team or personal use.

Features

  • Track Entry and Exit Times: Log when a user enters or exits the workspace.
  • User-Specific Logs: Entries are stored for individual users, making it easy to monitor specific users' work hours.
  • Dynamic Time Tracking: The check-in time is automatically stored when the user first enters, and the checkout time is recorded when the user leaves.
  • Integration with Supabase: The module supports seamless integration with Supabase for managing and storing logs.

Installation

Prerequisites

  1. You need to have Python 3.6 or higher installed on your system.
  2. Install the required libraries using pip:
pip install -r requirements.txt

Setup .env

Before you can use the module, ensure you have the required environment variables set up for Supabase integration. Create a .env file in the root of your project with the following variables:

SUPABASE_URL=your_supabase_url
SUPABASE_KEY=your_supabase_key (service key/secret)

Replace your_supabase_url and your_supabase_key with your actual Supabase project credentials. Installation via pip

You can install the module directly from pip:

pip install entrylogger

Alternatively, you can clone the repository directly:

git clone https://github.com/hadinah/entrylogger.git
cd entrylogger
python setup.py install

Usage

  1. Setting up the environment:

Ensure your .env file is properly configured with the correct Supabase credentials (SUPABASE_URL and SUPABASE_KEY). 2. Basic Usage Example:

Here's an example of how you can use the module to track user entry and exit times:

import entrylogger

# Log entry (Check-in)
entrylogger.mark_entry(user_id="user-id")

# Log exit (Check-out)
entrylogger.mark_exit(user_id="user-id")
  1. Integrating with Supabase:

Ensure your Supabase project is set up, and the database tables (entry_logs, task_logs, user_logs, etc.) are created. You can use the script provided in the repository to automatically create these tables. 4. Customizing the Module:

If needed, you can extend and customize the module to fit your use case. Add custom logic, like tracking user tasks or integrating with other services. Database Schema

  1. entry_logs Table:

Stores user entries and exits. Column Type Description entry_id time without time zone Unique identifier for the entry time workday_id date The workday date user_id uuid User ID from your system entry boolean Whether the entry is check-in (True) or check-out (False) 2. task_logs Table:

Stores the tasks logged by users. Column Type Description workday_id date The workday date user_id uuid User ID from your system name text Name of the task tags text[] Tags related to the task 3. user_logs Table:

Stores check-in and check-out information for users. Column Type Description user_id uuid User ID from your system workday_id date The workday date checkin_time timestamp with time zone The check-in time checkout_time timestamp with time zone The check-out time Contributing

Feel free to contribute! Here's how you can help:

Open Issues: Report bugs or suggest new features.

Fork and Pull Requests: Fork the repository, make your changes, and submit a pull request.

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details. Acknowledgements

Supabase for providing the backend integration.

Python and all the awesome libraries it offers for development.

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

entrylogger-0.1.5.tar.gz (42.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

entrylogger-0.1.5-py3-none-any.whl (29.2 kB view details)

Uploaded Python 3

File details

Details for the file entrylogger-0.1.5.tar.gz.

File metadata

  • Download URL: entrylogger-0.1.5.tar.gz
  • Upload date:
  • Size: 42.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for entrylogger-0.1.5.tar.gz
Algorithm Hash digest
SHA256 fce0d12c9dafaf4ad63848327c0dee50c772532319ced3ef1f76ba8189946a31
MD5 0a90d68cffda7b950ba1105b48d13ee6
BLAKE2b-256 29e8a3a97b526f5b33db4f70610050281ba0b170d8a92e6cac99b85cddc18814

See more details on using hashes here.

File details

Details for the file entrylogger-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: entrylogger-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 29.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for entrylogger-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 646ecc4c4b1873e659b322ec42b5f537be51060b2c20eac82cf3e62b73a1144d
MD5 f4416aed969f1d212f7052228b57dc74
BLAKE2b-256 40a2b9bb536500b9e8d98a8c992157e5a535060700adb240ec29b9324bb8d9c7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page