Skip to main content

Automate Crystal HR punch in/out operations

Project description

Crystal HR Automation

A Python package to automate Crystal HR punch in/out operations with configurable delays and email notifications.

Features

  • Automated punch in/out with configurable delays
  • Email notifications for successful/failed operations
  • Configurable via JSON config file
  • Command-line interface for easy use
  • Production-ready package structure

Installation

From PyPI (Recommended)

pip install rajnish-dc-crystal

From Source

  1. Clone the repository:

    git clone https://github.com/yourusername/rajnish-dc-crystal.git
    cd rajnish-dc-crystal
    
  2. Install in development mode:

    pip install -e .[dev]
    

Quick Start

  1. Initialize configuration:

    crystal-hr config init
    
  2. Edit the config file (usually at ~/.config/crystal_hr/config.json) with your credentials.

  3. Perform a punch in:

    crystal-hr punch in --delay 5
    
  4. Perform a punch out:

    crystal-hr punch out
    

Configuration

The configuration file is stored in ~/.config/crystal_hr/config.json by default. You can specify a different path using the --config option.

Example configuration:

{
    "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
    }
}

Usage

Punch In/Out

# Punch in with a 5-minute delay
crystal-hr punch in --delay 5

# Punch out immediately
crystal-hr punch out

Configuration Management

# Initialize a new config file
crystal-hr config init

# Show current configuration
crystal-hr config show

Development

Setup

  1. Clone the repository
  2. Install development dependencies:
    pip install -e .[dev]
    

Running Tests

pytest

Code Formatting

black .
isort .

Type Checking

mypy .

License

MIT

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

Disclaimer

This software is provided as-is, without any warranties. Use it responsibly and in compliance with your organization's policies.

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.0.tar.gz (10.7 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.0-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rajnish_dc_crystal-0.1.0.tar.gz
  • Upload date:
  • Size: 10.7 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.0.tar.gz
Algorithm Hash digest
SHA256 919df611b8bf8445544d7d6315d8439ac6c69810684492a1ca5f3244dd83da6d
MD5 1b86d4f7410917cdfea3b4da88a65abc
BLAKE2b-256 a70e08fa1baeb60a51d41400f18f0020db91bc4251787d135baa8028fc4150b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rajnish_dc_crystal-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bdb8a9a176fe7bca6e024228db2b661f4a714b3f33263b940f7d9586894d262f
MD5 66d5a36f0769c51f98ca58fd83cde88c
BLAKE2b-256 f2cffc883bff9adf557d37cbd70e75bed2f33f41d7a2e095e0f2d4a281387420

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