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.2.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.2-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rajnish_dc_crystal-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 43a824f069994619a071bbff6153e96680312f9d650411fe63b50bec11d904eb
MD5 14b7b1a044b6d34c083efaf8e1f2d7cf
BLAKE2b-256 636b53056b99cc973a3ae5a7011d3acba7eee035b627cefda155bb427658a55a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rajnish_dc_crystal-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 88bb07f9398080b9d9ef28731e530121cc428425c280c87c7c2ef3848045d3c0
MD5 3f73b566a56aa64a66cc2a6bcfea5cd9
BLAKE2b-256 3aafaef2da11ecea6fab4942b61899b14ee6d61e5f02c9d97c9c96fbaf87c8c4

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