{"id":15068500,"url":"https://github.com/croketillo/dockerinfo","last_synced_at":"2026-02-01T12:34:55.807Z","repository":{"id":205287041,"uuid":"713018050","full_name":"croketillo/dockerinfo","owner":"croketillo","description":"Extract docker container info module","archived":false,"fork":false,"pushed_at":"2024-07-28T04:48:19.000Z","size":68,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-27T19:01:51.407Z","etag":null,"topics":["docker","docker-container","docker-info","server","servers","system-maintenance","system-management","system-manager"],"latest_commit_sha":null,"homepage":"","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/croketillo.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":"2023-11-01T17:09:23.000Z","updated_at":"2024-07-28T04:43:52.000Z","dependencies_parsed_at":"2024-10-13T04:41:16.450Z","dependency_job_id":"2605a41c-efb0-4656-8b39-6c9926a31ef1","html_url":"https://github.com/croketillo/dockerinfo","commit_stats":null,"previous_names":["croketillo/dockerinfo"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/croketillo/dockerinfo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/croketillo%2Fdockerinfo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/croketillo%2Fdockerinfo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/croketillo%2Fdockerinfo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/croketillo%2Fdockerinfo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/croketillo","download_url":"https://codeload.github.com/croketillo/dockerinfo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/croketillo%2Fdockerinfo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28978177,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T12:13:08.691Z","status":"ssl_error","status_checked_at":"2026-02-01T12:13:08.356Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["docker","docker-container","docker-info","server","servers","system-maintenance","system-management","system-manager"],"created_at":"2024-09-25T01:37:52.790Z","updated_at":"2026-02-01T12:34:55.792Z","avatar_url":"https://github.com/croketillo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# DOCKERINFO\n\n![PyPI](https://img.shields.io/pypi/v/dockerinfo) ![PyPI - Downloads](https://img.shields.io/pypi/dm/dockerinfo?color=%2360EE59) ![Pepy Total Downlods](https://img.shields.io/pepy/dt/dockerinfo)\n\nEasily extract information from docker containers\n\nSince version 1.2 can extract containers logs.\n\n## Example:\n\n```python\nfrom dockerinfo.docker_info import DockerContainerInfo, DockerHelper\n\n# Create an instance of the DockerHelper class and list the existing containers.\n# Use all_containers=True/False to list inactive containers.\ndocker_info = DockerHelper()\ncontainer_list = docker_info.list_containers(all_containers=True)\n\n# Iterate through all found containers and extract information.\nprint(\"\u003e\u003e\u003e ITERATING THROUGH ALL EXISTING CONTAINERS AND EXTRACTING INFORMATION\")\nfor container in container_list:\n    container_info = DockerContainerInfo(container)\n    print(f\"Container ID: {container_info.id}\")\n    print(f\"Container Name: {container_info.name}\")\n    print(f\"Container Status: {container_info.status}\")\n    print(f\"Container Log (last 5 lines):\")\n    for log_line in container_info.get_logs_tail(5):\n        print(log_line)\n\n# Extract information from a specific container (in this case, 'test01').\nprint(\"\n\u003e\u003e\u003e LOOKING FOR A SPECIFIC CONTAINER (test01)\")\ncontainer = docker_info.get_container_by_name('test01')\n\nif container:\n    # If the container is found, create an instance of the DockerContainerInfo class.\n    container_info = DockerContainerInfo(container)\n    \n    # Print container information.\n    print(f\"Container ID: {container_info.id}\")\n    print(f\"Container Name: {container_info.name}\")\n    print(f\"Container Status: {container_info.status}\")\n\n    # Test other methods of the DockerContainerInfo class as needed.\n    print(f\"Networks (all): {container_info.networks}\")\n    \n    network_name = 'bridge'  # Change the network name as needed.\n    network_info = container_info.get_network_config(network_name)\n    print(f\"Network Info for {network_name}: {network_info}\")\n\n    ip_address = container_info.get_network_attribute(network_name, 'IPAddress')\n    mac_address = container_info.get_network_attribute(network_name, 'MacAddress')\n    print(f\"IP Address: {ip_address}, Mac Address: {mac_address}\")\n\n    # Print more container information as needed.\nelse:\n    print(\"Container not found: test01\")\n```\n\n## Available options:\n- **id**\n\nReturns the container ID.\n\n- **name**\n\nReturns the container name.\n\n- **status**\n\nReturns the current status of the container.\n\n- **config**\n\nReturns the entire configuration of the container.\n\n- **hostname**\n\nReturns the container's hostname.\n\n- **domainname**\n\nReturns the container's domain name.\n\n- **stopsignal**\n\nReturns the stop signal of the container.\n\n- **networks**\n\nReturns the configuration of all networks of the container.\n\n- **get_network_config(network)**\n\nReturns the configuration of a specific network of the container.\n\n- **get_network_attribute(network, attribute)**\n\nReturns a specific attribute of a network of the container.\n\n- **mounted_volumes**\n\nReturns the configuration of volumes mounted in the container.\n\n- **get_logs**\nGet the logs of the container, split into lines.\nReturn a list containing each line of the container's logs as a string.\n\n- **get_logs_since(timestamp)**\nGet the logs of the container since a specified timestamp, split into lines.\n\nArgs:\n\ntimestamp (int): The Unix timestamp from which to start fetching logs.\n\nReturn a list containing each line of the container's logs as a string.\n\n- **get_logs_since_date(date_string)**\nGet the logs of the Docker container since a specified date.\n\nArgs:\ndate_string: A string representing the date in MM/DD/YYYY format.\n\nReturns the logs since the specified date.\n\nExample:\n```\nlogs_since_date = instance.get_logs_since_date(\"01/15/2023\")\n```\n**Note:** The date string must be in the correct format to avoid conversion errors\n\n- **get_logs_tail(lines)**\n\nGet the last N lines of the container's logs, split into lines.\n\nArgs:\n\nlines (int): The number of lines to retrieve from the end of the logs.\n\nReturns:\n\nReturns a list containing each line of the container's logs as a string.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcroketillo%2Fdockerinfo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcroketillo%2Fdockerinfo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcroketillo%2Fdockerinfo/lists"}