Skip to main content

Automate Crystal HR punch in/out operations

Project description

crystal-hr

PyPI GitHub Repo

Automate your CrystalHR punch-in/punch-out with configurable delays and email notifications. Designed for both convenience and privacy, this package offers a simple CLI for regular users and a solid foundation for contributors.


🚀 For Users

1. Installation

Install the latest release directly from PyPI:

pip install crystal-hr

2. Initial Configuration

Set up your configuration file with a single command:

crystal-hr config init

This will create a file at:

  • Linux/macOS: ~/.config/crystal_hr/config.json
  • Windows: C:\Users\<YourUsername>\.config\crystal_hr\config.json

Example Configuration (config.json)

{
    "hr_system": {
        "username": "your_username",
        "password": "your_password",
        "company_id": "1",
        "base_url": "https://desicrewdtrial.crystalhr.com"
    },
    "email": {
        "gmail_user": "your.email@gmail.com",
        "gmail_app_password": "your_app_password",
        "recipient_email": "recipient@example.com"
    },
    "behavior": {
        "default_delay_minutes": 0,
        "random_delay_max_minutes": 0
    }
}

Update the Following Fields

  • hr_system.username
  • hr_system.password
  • email.gmail_user
  • email.gmail_app_password
  • email.recipient_email

Edit the file in-place with your credentials and settings using any text editor:

  • Linux/macOS: nano ~/.config/crystal_hr/config.json
  • Windows: Open the file via Notepad or VSCode.

Verify Your Configuration

To review your current configuration, run:

crystal-hr config

3. Usage

Basic Commands

  • Punch In:
    crystal-hr punch in
    
  • Punch Out:
    crystal-hr punch out
    

Add a Delay (Optional)

  • Add a fixed delay before action (e.g., 5 minutes):
    crystal-hr punch in --delay 5
    
  • If --delay is not specified, a random delay (1-10 minutes) is applied by default to mimic human-like behavior.

4. Scheduling with Crontab (Linux/macOS)

Automate your attendance using crontab. The built-in random/fixed delay helps avoid robotic timing.

Open your crontab editor:

crontab -e

Example: Schedule punch in at 8:00 AM and punch out at 6:00 PM

0 8 * * * crystal-hr punch in
0 18 * * * crystal-hr punch out

Tip: No need to manually specify a delay unless you want a fixed value; the tool will select a random delay by default.

Advanced: Explicit Fixed Delay

0 8 * * * crystal-hr punch in --delay 7
0 18 * * * crystal-hr punch out --delay 5

Windows Task Scheduler

On Windows, use the Task Scheduler to run similar commands at your preferred times.


🤝 For Contributors

We welcome contributions to enhance features, improve documentation, and fix bugs.

Developing Locally

  1. Fork this repository:
    https://github.com/0rajnishk/rajnish_dc_crystal

  2. Clone your fork:

    git clone https://github.com/<your-username>/rajnish_dc_crystal.git
    cd rajnish_dc_crystal
    
  3. Install dependencies:

    pip install -r requirements.txt
    
  4. Set up a virtual environment (recommended).

  5. Submit a Pull Request with a clear description of your changes.

Guidelines

  • Ensure code is formatted with PEP8 standards.
  • Add or update tests as appropriate.
  • Document new features for users and developers.

ℹ️ Support & Community

  • GitHub Issues for bug reports and feature requests.
  • PRs are always welcome—please open an issue to discuss significant changes first.

Project Homepage:
https://github.com/0rajnishk/rajnish_dc_crystal


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

rajnish_dc_crystal-0.1.1.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

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

rajnish_dc_crystal-0.1.1-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file rajnish_dc_crystal-0.1.1.tar.gz.

File metadata

  • Download URL: rajnish_dc_crystal-0.1.1.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for rajnish_dc_crystal-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d4fd99532c948d0d3abcb77632e7c2dc385149b1d6701975c54f8475f2e645ee
MD5 f6802c029985fc9bfe3ea6eeed4617c7
BLAKE2b-256 e60fcd19e7dc61bd1644681003b850781d46d7da68d25e4827e9f87a144df485

See more details on using hashes here.

File details

Details for the file rajnish_dc_crystal-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for rajnish_dc_crystal-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 23d2b453d9c752d2b4255fce51c76996d8e60310c6be2b04fdf40292b478097f
MD5 d170e9357a0ff989430a937e241e50c2
BLAKE2b-256 82fd86a40672e25d7c6cbda669bba6200a9ae1a6f5d8108e20d0e8d5df673cee

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