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.3.tar.gz (12.4 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.3-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rajnish_dc_crystal-0.1.3.tar.gz
  • Upload date:
  • Size: 12.4 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.3.tar.gz
Algorithm Hash digest
SHA256 c371b2b333f5917d3ff56c522d8a32c8353c17d577fe8d10fdbd2a665ee50047
MD5 238c6316e0fd683ed37d3e3d2ba35b19
BLAKE2b-256 846c7d6b7976079cb04678dc506e0193627ca9b59e65228b690eebdf77dc3c4f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rajnish_dc_crystal-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 403badd68f730b3f62efadc292f6c382fa3582e7f033f5b18e32bec64838d20d
MD5 7ff32bea10e3ee8dba865eec6aefbaeb
BLAKE2b-256 c00d922ad5a3800040a75846a2dd4c8f3cca73b11c2f6e737bebd5cb13e4ac00

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