Matrix COSEC biometric Python integration library
Project description
pycosec
pycosec is a Python library that provides an easy interface to interact with COSEC biometric devices. It allows you to manage users, configure device settings, retrieve attendance events, and handle credentials programmatically.
Features
- Configure device settings such as IP, time, and access control.
- Manage users (add, update, delete).
- Enable/disable face recognition and other special features.
- Retrieve attendance events (punch-in/punch-out).
- Manage user credentials (fingerprint, card, palm, face templates/images).
- Support for alarms, door features, and system timers.
- Works with COSEC API using HTTP Basic authentication.
Installation
Install via pip:
pip install pycosec
Or clone the repository and install locally:
git clone https://github.com/KSreethul/pycosec.git
cd pycosec
pip install .
Requirements
- Python 3.10+
requestslibrary (>=2.0)
Usage
from pycosec import COSECBiometric
# Initialize device connection
device = COSECBiometric(
machine_ip="192.168.1.100",
port=80,
username="admin",
password="password"
)
# Retrieve total number of users
user_count = device.get_user_count()
print("Total Users:", user_count)
# Add or update a user
response = device.set_cosec_user(
user_id="1001",
ref_user_id=1,
name="John Doe",
user_active=True,
card1="1234567890",
enable_fr=True
)
print(response)
# Retrieve attendance events
events = device.get_attendance_events(no_of_events=50)
print(events)
Documentation
The library provides methods to configure and interact with:
-
Device Settings
basic_config(),finger_reader_parameter_configuration(),enrollment_configuration(),access_settings_configuration(),alarm_configuration(),date_and_time_configuration(),door_features_configuration(),system_timer_configuration(),special_function_configuration(),wiegand_interface(),smart_card_format()
-
User Management
get_cosec_user(),set_cosec_user(),delete_cosec_user(),enable_user_face_recognition(),get_user_credential(),get_user_credential_count(),delete_cosec_user_credential()
-
Attendance
get_attendance_events()
Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b feature-name. - Make your changes and commit:
git commit -m "Add feature". - Push to your branch:
git push origin feature-name. - Create a Pull Request.
License
This project is licensed under the LGPL 3.0 license. See [LICENSE](https://www.gnu.org/licenses/lgpl-3.0.html) for details.
Links
- Homepage: https://github.com/KSreethul/pycosec
- Bug Tracker: https://github.com/KSreethul/pycosec/issues
Project details
Release history Release notifications | RSS feed
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 pycosec-0.1.0.tar.gz.
File metadata
- Download URL: pycosec-0.1.0.tar.gz
- Upload date:
- Size: 11.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dab0edf0c77eeb5a09e39375669efd423fb7a853df41db305b6e94a4c4829690
|
|
| MD5 |
cf48695cd4c6fcde883753e7dafe50d2
|
|
| BLAKE2b-256 |
156b283c7ad6270576cc3a24dc461da0d523dac06e83dd799f12b35916b41448
|
File details
Details for the file pycosec-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pycosec-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c0717a72e6cf47a06b7e6ea2277551c3009db56387414690d1d39d4f254d3006
|
|
| MD5 |
b8ccc62273c914d96941fe5ca0b90dfb
|
|
| BLAKE2b-256 |
76c974019c587a40b61ee3180a3a8bb7ea27056c328da7c9c489f8f6c0bcd50c
|