{"id":21178775,"url":"https://github.com/rkstudio585/pyclock","last_synced_at":"2025-03-14T18:44:02.702Z","repository":{"id":262131186,"uuid":"886296710","full_name":"rkstudio585/pyClock","owner":"rkstudio585","description":"pyClock is a terminal-based real-time clock built with Python, featuring stylish ASCII art and a colorful interface using the rich and pyfiglet libraries. It updates every second, offering a visually appealing and interactive experience.","archived":false,"fork":false,"pushed_at":"2024-11-10T18:19:28.000Z","size":381,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-21T11:45:25.429Z","etag":null,"topics":["pyclock","pyclock-tool","python-clock","python-project","real-time-clock","terminal-base-clock","terminal-base-ui-clock"],"latest_commit_sha":null,"homepage":"https://rkstudio.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rkstudio585.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-10T17:40:21.000Z","updated_at":"2024-11-10T18:19:31.000Z","dependencies_parsed_at":"2024-11-10T18:47:43.113Z","dependency_job_id":null,"html_url":"https://github.com/rkstudio585/pyClock","commit_stats":null,"previous_names":["rkstudio585/pyclock"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkstudio585%2FpyClock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkstudio585%2FpyClock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkstudio585%2FpyClock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkstudio585%2FpyClock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rkstudio585","download_url":"https://codeload.github.com/rkstudio585/pyClock/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243629437,"owners_count":20322055,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pyclock","pyclock-tool","python-clock","python-project","real-time-clock","terminal-base-clock","terminal-base-ui-clock"],"created_at":"2024-11-20T17:26:22.730Z","updated_at":"2025-03-14T18:44:02.682Z","avatar_url":"https://github.com/rkstudio585.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pyClock 🕰️\n\n---\n![pyclock logo](logo.webp)\n\n---\n`pyClock` is a real-time, terminal-based clock created using Python, `rich` library for a colorful user interface, and `pyfiglet` for beautiful ASCII clock styling. The clock continuously updates every second, offering a visually appealing and interactive experience in your terminal.\n\n## Features 🌟\n\n- **Real-time Clock**: The clock updates every second, showing the current time in `HH:MM:SS` format.\n- **ASCII Art**: The current time is displayed in a stylish ASCII format, using the `pyfiglet` library.\n- **Colorful Interface**: The time display is wrapped in a beautifully styled `rich` panel with customizable border and title.\n- **Terminal-based**: Perfect for enhancing your terminal experience with a professional touch.\n\n## Requirements 📦\n\nBefore running the project, you need to install the required dependencies:\n\n- Python 3.x\n- `rich` library\n- `pyfiglet` library\n\nTo install the dependencies, run the following command:\n\n```bash\npip install rich pyfiglet\n```\n\n## Usage 🚀\n\n1. Clone the repository:\n\n```bash\ngit clone https://github.com/rkstudio585/pyClock.git\ncd pyClock\n```\n\n2. Run the program:\n\n```bash\npython clock.py\n```\n\nThe clock will start displaying in your terminal and update every second.\n\n## Code Explanation 🧑‍💻\n\n### `clock.py`\n\nThis Python script runs the real-time clock in the terminal.\n\n- **Imports**: \n  - `time`: For fetching the current system time.\n  - `pyfiglet`: For creating the ASCII art representation of the current time.\n  - `rich.console.Console`: For printing styled content in the terminal.\n  - `rich.panel.Panel`: For adding a panel around the clock with customized borders and title.\n\n- **Display Loop**: \n  - The script runs in a continuous loop, updating the clock every second.\n  - The `time.strftime(\"%H:%M:%S\")` function fetches the current time.\n  - `pyfiglet.figlet_format` generates the ASCII art for the time.\n  - The clock is then displayed in a `rich` panel with a title and border.\n\n- **Interrupt Handling**: The clock can be stopped using a keyboard interrupt (`Ctrl+C`), and a message will be displayed to confirm the stop.\n\n### Code Snippet\n\n```python\nimport time\nimport pyfiglet\nfrom rich.console import Console\nfrom rich.panel import Panel\nfrom rich.text import Text\n\nconsole = Console()\n\ndef display_clock():\n    try:\n        while True:\n            current_time = time.strftime(\"%H:%M:%S\")\n            ascii_time = pyfiglet.figlet_format(current_time, font=\"big\")\n            clock_panel = Panel(Text(ascii_time, justify=\"center\"), title=\"🕰 Real-Time Clock 🕰\", border_style=\"bold green\")\n            \n            console.clear()\n            console.print(clock_panel)\n            time.sleep(1)\n\n    except KeyboardInterrupt:\n        console.print(\"Clock stopped.\", style=\"bold red\")\n```\n\n### Key Components:\n- **Real-time update**: The clock updates every second using `time.sleep(1)`.\n- **ASCII Style**: `pyfiglet` turns the time into an ASCII art style.\n- **Rich Panel**: The time is displayed within a styled panel using `rich`.\n\n## Contributing 🤝\n\nFeel free to fork the repository, clone it, and make improvements. If you add any new features or fix bugs, please create a pull request.\n\n## Screenshots 🖼️ \n\n\u003e This Screenshot Take In Termux.\n \u003e ![fast screenshot](1.jpg)\n \u003e \n \u003e ![second screenshot](2.jpg)\n\n## License 📜\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n---\n\nHappy Clocking! ⏰\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frkstudio585%2Fpyclock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frkstudio585%2Fpyclock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frkstudio585%2Fpyclock/lists"}