{"id":37073383,"url":"https://github.com/cobacdavid/abrviz","last_synced_at":"2026-01-14T08:36:52.244Z","repository":{"id":57407827,"uuid":"321596413","full_name":"cobacdavid/abrviz","owner":"cobacdavid","description":"Visualisation des ABR grâce à graphviz","archived":false,"fork":false,"pushed_at":"2021-01-03T10:33:38.000Z","size":988,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-28T21:59:17.962Z","etag":null,"topics":["abr","bst","graphviz"],"latest_commit_sha":null,"homepage":"","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/cobacdavid.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}},"created_at":"2020-12-15T08:07:46.000Z","updated_at":"2024-03-21T10:23:17.000Z","dependencies_parsed_at":"2022-09-26T17:10:48.615Z","dependency_job_id":null,"html_url":"https://github.com/cobacdavid/abrviz","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cobacdavid/abrviz","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cobacdavid%2Fabrviz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cobacdavid%2Fabrviz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cobacdavid%2Fabrviz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cobacdavid%2Fabrviz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cobacdavid","download_url":"https://codeload.github.com/cobacdavid/abrviz/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cobacdavid%2Fabrviz/sbom","scorecard":{"id":295087,"data":{"date":"2025-08-11","repo":{"name":"github.com/cobacdavid/abrviz","commit":"be792af9c4ed285c8fe19d9ae4439bf9525e04da"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/11 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-17T19:17:55.656Z","repository_id":57407827,"created_at":"2025-08-17T19:17:55.656Z","updated_at":"2025-08-17T19:17:55.656Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28414665,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:31:27.429Z","status":"ssl_error","status_checked_at":"2026-01-14T08:31:19.098Z","response_time":107,"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":["abr","bst","graphviz"],"created_at":"2026-01-14T08:36:51.755Z","updated_at":"2026-01-14T08:36:52.230Z","avatar_url":"https://github.com/cobacdavid.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# abrviz\n\n## Installation\n\n`pip3 install abrviz`\n\n## Exemple 0\n\n### Code\n```python\nfrom abrviz import Arbre, Noeud\n\n\nvaleurs = [3, 4, 7, 9, 5, 8, 1, 0, 6, 2]\nnoeuds = [Noeud(i) for i in valeurs]\n\na = Arbre()\nfor n in noeuds:\n    a.inserer(n)\n\ntexte = f\"\"\"Affichage imbriquée :\n{a}\n\nHauteur : {a.hauteur()}\nTaille : {len(a)}\n\nLes parcours fournissent des listes d'objets :\nParcours en largeur : {a.largeur}\n\nPour obtenir les clés, on demande les valeurs :\nParcours en largeur : {[n.valeur for n in a.largeur]}\n\nParcours prefixe : {[n.valeur for n in a.prefixe]}\nParcours infixe : {[n.valeur for n in a.infixe]}\nParcours suffixe : {[n.valeur for n in a.suffixe]}\n\nUne liste 'complète' en largeur peut être obtenue :\n{[n if not n else n.valeur for n in a.liste_aplatie()]}\n\nRecherche du noeud de clé 5 :\nle noeud : {a.rechercher(5).__repr__()}\nson arborescence : {a.rechercher(5)}\nsa valeur : {a.rechercher(5).valeur}\nson contenu (éventuellement transporté dans sa structure) : \\\n{a.rechercher(5).contenu}\nle chemin qui y mène : {[n.valeur for n in a.chemin_vers(a.rechercher(5))]}\n\nSi on connaît une référence vers le noeud, on peut l'utiliser.\nle noeud de clé 5 est le 4ème de la liste noeuds : \\\n{noeuds[4]}\n\"\"\"\nprint(texte)\n\na.supprimer(noeuds[0])\ntexte = f\"\"\"Nouveau parcours en largeur après suppression de la racine :\n{[n.valeur for n in a.largeur]}\n\"\"\"\nprint(texte)\n\n```\n\n### Sortie console\n\n```python\nAffichage imbriquée :\n(((None -- 0 -- None) -- 1 -- (None -- 2 -- None)) -- 3 -- (None -- 4 -- ((None -- 5 -- (None -- 6 -- None)) -- 7 -- ((None -- 8 -- None) -- 9 -- None))))\n\nHauteur : 5\nTaille : 10\n\nLes parcours fournissent des listes d'objets :\nParcours en largeur : [\u003cabrviz.abrviz.Noeud object at 0x7fec0c283eb0\u003e, \u003cabrviz.abrviz.Noeud object at 0x7fec0c283880\u003e, \u003cabrviz.abrviz.Noeud object at 0x7fec0c283f10\u003e, \u003cabrviz.abrviz.Noeud object at 0x7fec0c38c0d0\u003e, \u003cabrviz.abrviz.Noeud object at 0x7fec0c14da90\u003e, \u003cabrviz.abrviz.Noeud object at 0x7fec0c283f40\u003e, \u003cabrviz.abrviz.Noeud object at 0x7fec0c283fa0\u003e, \u003cabrviz.abrviz.Noeud object at 0x7fec0c283d30\u003e, \u003cabrviz.abrviz.Noeud object at 0x7fec0c14d760\u003e, \u003cabrviz.abrviz.Noeud object at 0x7fec0c283c70\u003e]\n\nPour obtenir les clés, on demande les valeurs :\nParcours en largeur : [3, 1, 4, 0, 2, 7, 5, 9, 6, 8]\n\nParcours prefixe : [3, 1, 0, 2, 4, 7, 5, 6, 9, 8]\nParcours infixe : [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\nParcours suffixe : [0, 2, 1, 6, 5, 8, 9, 7, 4, 3]\n\nUne liste 'complète' en largeur peut être obtenue :\n[3, 1, 4, 0, 2, None, 7, None, None, None, None, None, None, 5, 9, None, None, None, None, None, None, None, None, None, None, None, None, None, 6, 8]\n\nRecherche du noeud de clé 5 :\nle noeud : \u003cabrviz.abrviz.Noeud object at 0x7fec0c283fa0\u003e\nson arborescence : (None -- 5 -- (None -- 6 -- None))\nsa valeur : 5\nson contenu (éventuellement transporté dans sa structure) : None\nle chemin qui y mène : [3, 4, 7, 5]\n\nSi on connaît une référence vers le noeud, on peut l'utiliser.\nle noeud de clé 5 est le 4ème de la liste noeuds : (None -- 5 -- (None -- 6 -- None))\n\nNouveau parcours en largeur après suppression de la racine :\n[2, 1, 4, 0, 7, 5, 9, 6, 8]\n\n```\n\n## Exemple 1\n\n### Code\n```python\nfrom abrviz import Arbre, Noeud\n\n\na = Arbre()\nliste = [Noeud(i) for i in [3, 2, 1, 5, 4, 6]]\nfor i in liste:\n    a.inserer(i)\n\n# on visualise l'arbre\na.sortie(a.racine, \"exemple1_0\", \"png\")\n# on demande une visualisation en arbre binaire complet : un peu\n# plus d'espace dans la dernière ligne\na.sortie(a.racine, \"exemple1_1\", \"png\", style=\"complet\")\n# on demande une visualisation à partir du 2ème noeud rentré\na.sortie(liste[1], \"exemple1_2\", \"png\")\n# on supprime la racine puis on visualise le nouvel arbre en pdf\na.supprimer(liste[0])\na.sortie(a.racine, \"exemple1_3\", \"pdf\")\n\n```\n\n### Sortie Images\n\u003cimg src='./exemples/exemple1_0.png' width='800'\u003e\n\n\u003cimg src='./exemples/exemple1_1.png' width='800'\u003e\n\n\u003cimg src='./exemples/exemple1_2.png' width='800'\u003e\n\n\u003cimg src='./exemples/exemple1_3.png' width='800'\u003e\n\n\n## Exemple 2\n\n### Code\n```python\nfrom abrviz import Arbre, Noeud\nimport random\n\n\nliste = list(range(15))\nrandom.shuffle(liste)\n\na = Arbre()\nfor e in liste:\n    a.inserer(Noeud(e))\n\n# Visualisation de l'arbre\nmon_noeud = a.racine\na.sortie(mon_noeud, \"exemple2_0\", \"png\")\n\n# on peut demander une version \"complète\" avec les noeuds\n# invisibles d'un arbre binaire complet : l'apparence est très\n# large\na.sortie(mon_noeud, \"exemple2_1\", \"png\", style=\"complet\")\n\n# s'il y a un sous-arbre gauche, on le visualise\nif mon_noeud.gauche is not None:\n    a.sortie(mon_noeud.gauche, \"exemple2_2\", \"png\")\n\n```\n\n### Sortie Images\n\n\u003cimg src='./exemples/exemple2_0.png' width='800'\u003e\n\n\u003cimg src='./exemples/exemple2_1.png' width='800'\u003e\n\n\u003cimg src='./exemples/exemple2_2.png' width='800'\u003e\n\n## Exemple 3\n\n### Code\n```python\nfrom abrviz import Arbre, Noeud\nimport random\n\n\nliste = list(range(20))\nrandom.shuffle(liste)\n\na = Arbre()\n# on change la fonction de la relation d'ordre\na.fonction_ordre = lambda x, y: str(x.valeur) \u003c str(y.valeur)\n\nfor e in liste:\n    a.inserer(Noeud(e))\n\na.sortie(a.racine, \"exemple3_0\", \"png\")\n\n# on change le style\nArbre.options('node', {\"style\": \"filled\"})\nArbre.options('edge', {\"arrowhead\": \"diamond\", \"arrowsize\": \"1\"})\na.sortie(a.racine, \"exemple3_1\", \"png\")\n\n# les flèches se courbent\nArbre.options('graph', {\"splines\": \"true\"})\na.sortie(a.racine, \"exemple3_2\", \"png\")\n\n```\n\n### Sortie Images\n\u003cimg src='./exemples/exemple3_0.png' width='800'\u003e\n\n\u003cimg src='./exemples/exemple3_1.png' width='800'\u003e\n\n\u003cimg src='./exemples/exemple3_2.png' width='800'\u003e\n\n## Exemple 4\n\n### Code\n```python\nfrom abrviz import Arbre, Noeud\n\n# dictionnaire, les valeurs seront les clés de l'arbre\ndico_contenu = {\"abricot\": 2, \"poire\": 5, \"pomme\": 1, \"ananas\": 7, \"kiwi\": 0}\n\na = Arbre()\nfor k in dico_contenu:\n    a.inserer(Noeud(dico_contenu[k], k))\n\n# les noeuds montreront le contenu du noeud et non la clé (\"valeur\")\nArbre.etiquette = \"contenu\"\na.sortie(a.racine, \"exemple4_0\", \"png\")\n\n# pour visualiser un mix des deux (clés et valeurs du dictionnaire)\n# on redéfinit l'arbre et les noeuds :\na = Arbre()\nfor k in dico_contenu:\n    noeud = Noeud(dico_contenu[k])\n    # le contenu du noeud reprend les données complètes du dictionnaire\n    noeud.contenu = f\"{k} ({dico_contenu[k]})\"\n    a.inserer(noeud)\n\nArbre.etiquette = \"contenu\"\na.sortie(a.racine, \"exemple4_1\", \"png\")\n\n```\n\n### Sortie Images\n\u003cimg src='./exemples/exemple4_0.png' width='800'\u003e\n\n\u003cimg src='./exemples/exemple4_1.png' width='800'\u003e\n\n## Exemple 5\n\n### Code\n```python\nfrom abrviz import Arbre, Noeud\n\n\nliste = [2, 3, 6, 0, 4, 5, 1]\nliste_noeuds = [Noeud(i) for i in liste]\n\na = Arbre()\nfor e in liste_noeuds:\n    a.inserer(e)\n\n# On peut effectuer des mouvements de rotation à droite ou à gauche\n# L'arbre reste un ABR\na.sortie(a.racine, \"exemple5_0\", \"png\")\n\n# le noeud \"racine\" du changement est passé en argument\na.rotation_gauche(a.rechercher(2))\na.sortie(a.racine, \"exemple5_1\", \"png\")\n\n# on peut alors équilibrer l'arbre\na.rotation_gauche(a.rechercher(0))\na.rotation_droite(a.rechercher(2))\na.rotation_gauche(a.rechercher(4))\na.rotation_droite(a.rechercher(6))\na.sortie(a.racine, \"exemple5_2\", \"png\")\n\n```\n\n### Sortie Images\n\n\u003cimg src='./exemples/exemple5_0.png' width='800'\u003e\n\n\u003cimg src='./exemples/exemple5_1.png' width='800'\u003e\n\n\u003cimg src='./exemples/exemple5_2.png' width='800'\u003e\n\n## Licence\nCC-BY-NC-SA\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcobacdavid%2Fabrviz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcobacdavid%2Fabrviz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcobacdavid%2Fabrviz/lists"}