{"id":20107583,"url":"https://github.com/trisdeveloper/contactmanager","last_synced_at":"2026-06-12T14:32:33.862Z","repository":{"id":249722357,"uuid":"832339003","full_name":"trisDeveloper/contactManager","owner":"trisDeveloper","description":"The Contact Manager is a Python-based terminal application designed to help users easily manage their contacts. With this application, you can add, view, and delete contacts, and all contact information is persistently saved to a file. This ensures that your data remains intact even after closing and reopening the application.","archived":false,"fork":false,"pushed_at":"2024-07-22T20:55:01.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-13T05:25:52.112Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trisDeveloper.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-07-22T20:24:37.000Z","updated_at":"2024-07-22T20:55:03.000Z","dependencies_parsed_at":"2024-07-23T00:53:09.668Z","dependency_job_id":null,"html_url":"https://github.com/trisDeveloper/contactManager","commit_stats":null,"previous_names":["trisdeveloper/contactmanager"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trisDeveloper%2FcontactManager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trisDeveloper%2FcontactManager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trisDeveloper%2FcontactManager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trisDeveloper%2FcontactManager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trisDeveloper","download_url":"https://codeload.github.com/trisDeveloper/contactManager/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241549118,"owners_count":19980476,"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":[],"created_at":"2024-11-13T17:58:04.224Z","updated_at":"2026-06-12T14:32:28.819Z","avatar_url":"https://github.com/trisDeveloper.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Contact Manager\n\n## Video Demo: https://youtu.be/DVx4n0wK3sY\n\n## Description\n\nThe Contact Manager is a simple Python-based terminal application designed to help users easily manage their contacts. With this application, you can add, view, and delete contacts, and all contact information is persistently saved to a file. This ensures that your data remains intact even after closing and reopening the application.\n\n## Features\n\n### Add Contact\n- **Functionality**: Allows the user to add a new contact by entering the contact's name and phone number.\n- **Usage**: Simply follow the prompts to input the contact's details.\n- **Persistence**: The new contact is saved to the `contacts.txt` file.\n\n### View Contacts\n- **Functionality**: Displays all saved contacts in a readable format.\n- **Usage**: Select the option to view contacts, and all contacts will be listed with their names and phone numbers.\n\n### Delete Contact\n- **Functionality**: Enables the user to delete a contact by specifying the contact's name.\n- **Usage**: Enter the name of the contact you wish to delete, and the contact will be removed from the list and file.\n\n### Exit Contact Program\n- **Functionality**: Enables the user to save the contacts in `contacts.txt`file and exit the program.\n- **Usage**: Choose option 4 and hit Enter.\n\n## Project Structure\n\n├── project.py\n├── test_project.py\n└── README.md\n### project.py\n\nThis file contains the main application logic, including the main function and several helper functions.\n\n#### Functions\n\n- `load(file_path)`: Loads contacts from a specified file and returns them as a dictionary.\n- `save(contacts, file_path)`: Saves the contacts dictionary to a specified file.\n- `add(contacts, input_stream=None, output_stream=None)`: Prompts the user to enter a contact name and phone number, then adds this contact to the dictionary.\n- `view(contacts, output_stream=None)`: Prints all contacts in the dictionary to the terminal.\n- `delete(contacts, input_stream=None, output_stream=None)`: Prompts the user to enter the name of a contact to delete, then removes this contact from the dictionary if it exists.\n- `main()`: Runs the main loop of the application, allowing the user to add, view, and delete contacts or exit the program.\n\n### test_project.py\n\nThis file contains the tests for the main functions in `project.py`, ensuring that they work as expected.\n\n#### Tests\n\n- `test_load()`: Loads a test file with predefined contacts and checks if the returned dictionary matches the expected contacts.\n- `test_save()`: Saves a new set of contacts to a test file and verifies the file contents match the expected data.\n- `test_add()`:  Simulates user input to add a contact and verifies the contact is present with correct details.\n- `test_view()`: Captures the output of viewing contacts and verifies it matches the expected formatted list.\n- `test_delete()`: Simulates user input to delete a contact and verifies the contact is removed from the dictionary.\n\n## Running the Application\n\n1. Clone the repository:\n```sh\ngit clone https://github.com/trisDeveloper/contactManager.git\n```\n2. Navigate to the project directory:\n```sh\ncd ContactManager\n```\n3. Run the application:\n```sh\npython project.py\n```\n\n## Running Tests\n1. Ensure you have pytest installed:\n```sh\npip install pytest\n```\n2. Run the tests:\n```sh\npytest test_project.py\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrisdeveloper%2Fcontactmanager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrisdeveloper%2Fcontactmanager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrisdeveloper%2Fcontactmanager/lists"}