Automate Crystal HR punch in/out operations
Project description
crystal-hr
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.usernamehr_system.passwordemail.gmail_useremail.gmail_app_passwordemail.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
--delayis 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
-
Fork this repository:
https://github.com/0rajnishk/rajnish_dc_crystal -
Clone your fork:
git clone https://github.com/<your-username>/rajnish_dc_crystal.git cd rajnish_dc_crystal
-
Install dependencies:
pip install -r requirements.txt
-
Set up a virtual environment (recommended).
-
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c371b2b333f5917d3ff56c522d8a32c8353c17d577fe8d10fdbd2a665ee50047
|
|
| MD5 |
238c6316e0fd683ed37d3e3d2ba35b19
|
|
| BLAKE2b-256 |
846c7d6b7976079cb04678dc506e0193627ca9b59e65228b690eebdf77dc3c4f
|
File details
Details for the file rajnish_dc_crystal-0.1.3-py3-none-any.whl.
File metadata
- Download URL: rajnish_dc_crystal-0.1.3-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
403badd68f730b3f62efadc292f6c382fa3582e7f033f5b18e32bec64838d20d
|
|
| MD5 |
7ff32bea10e3ee8dba865eec6aefbaeb
|
|
| BLAKE2b-256 |
c00d922ad5a3800040a75846a2dd4c8f3cca73b11c2f6e737bebd5cb13e4ac00
|