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
  1. 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)
SUPABASE_DB_URL=your_supabase_db_url

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

  1. Installing the module.

You can install the module directly from pip:

pip install entrylogger

Alternatively, you can install module directly from git:

pip install git+https://github.com/hadinah/entrylogger.git

Usage

  1. Setting up the environment:

Ensure your .env file is properly configured with the correct Supabase credentials (SUPABASE_URL and SUPABASE_KEY, SUPABASE_DB_URL).

  1. 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.6.tar.gz (42.5 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.6-py3-none-any.whl (29.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: entrylogger-0.1.6.tar.gz
  • Upload date:
  • Size: 42.5 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.6.tar.gz
Algorithm Hash digest
SHA256 7825d95be2d0b61f66c42d620186e22494f9459012ac506b68176f210783db98
MD5 304be58367c362b1be5a211e466b4ef4
BLAKE2b-256 036cdd6860aa605cb408249da7afee1b5aadbee12879b5ccafff9445a1f8c013

See more details on using hashes here.

File details

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

File metadata

  • Download URL: entrylogger-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 29.3 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 1d3cbdcdb22bd15806b2a72a3f73ca8cc0ebc52565de2e719ecab3c395938ce9
MD5 075f96b9d73c1a55e1b0e738b63a92cd
BLAKE2b-256 c08c1dfd53874532c5dc988860bff85bd2da264b653a247c0e1686e0ba113f79

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