{"id":37064034,"url":"https://github.com/cykyy/pyros-api","last_synced_at":"2026-01-14T07:29:01.640Z","repository":{"id":62583193,"uuid":"286527243","full_name":"cykyy/pyros-api","owner":"cykyy","description":"pyros-api is a simple python API for MikroTik RouterOS.","archived":false,"fork":false,"pushed_at":"2021-04-27T16:59:30.000Z","size":31,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-27T19:46:23.938Z","etag":null,"topics":["mikrotik","mikrotik-api","mikrotik-hotspot","mikrotik-routeros-api","mikrotik-routeros-script","python","routeros","routeros-api"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cykyy.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-10T16:35:58.000Z","updated_at":"2023-06-28T04:30:12.000Z","dependencies_parsed_at":"2022-11-03T20:18:38.537Z","dependency_job_id":null,"html_url":"https://github.com/cykyy/pyros-api","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/cykyy/pyros-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cykyy%2Fpyros-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cykyy%2Fpyros-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cykyy%2Fpyros-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cykyy%2Fpyros-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cykyy","download_url":"https://codeload.github.com/cykyy/pyros-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cykyy%2Fpyros-api/sbom","scorecard":{"id":314402,"data":{"date":"2025-08-11","repo":{"name":"github.com/cykyy/pyros-api","commit":"54e0bb838dda4076309f323eee821bde1bf5cae6"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/19 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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"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 'master'"],"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-17T23:53:36.461Z","repository_id":62583193,"created_at":"2025-08-17T23:53:36.461Z","updated_at":"2025-08-17T23:53:36.461Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28413221,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["mikrotik","mikrotik-api","mikrotik-hotspot","mikrotik-routeros-api","mikrotik-routeros-script","python","routeros","routeros-api"],"created_at":"2026-01-14T07:29:00.934Z","updated_at":"2026-01-14T07:29:01.628Z","avatar_url":"https://github.com/cykyy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pyros-api\n## A simplified routerOS api in python!\n```\nThanks to Social WiFi for their incredible RouterOS-api\n```\npyros-api is a simple python api for [MikroTik](https://mikrotik.com/) RouterOS extended from [RouterOS-api](https://github.com/socialwifi/RouterOS-api). \\\npyros-api on [PyPi](https://pypi.org/project/pyros-api/)\n\n### Why Another API?\nWell, I find the routeros-api by socialwifi (their api is great!) is complicated unless you are well familiar with routerOS.\\\nThough I was somewhat familiar with routerOS I still needed to often search on google and play with winbox/cli to do a simple stuff. \\\nAnd the most embarrassing part is I used to often forget what I did to achieve something let's say a day ago If I deleted or needed to implement the same logic with a bit of twist.\\\nThat's where this wrapper comes in. There's not many functions are covered so far but I will be working on this and will update with more simplified api. Any contribution is welcome.\n\n\n## Usage\n`pip install pyros-api`\n\n### Connection\n\n```python\n#!/usr/bin/python\n\nimport pyros_api\n\nconnection = pyros_api.RosCall('Mikrotik IP', username='admin', password='')\nconnection.login()\nconnection.get_ppp_secret()\n```\n\n#### Connect Options\n\n```python\npyros_api.RosCall(\n    host,\n    username='admin',\n    password='',\n    port=8728,\n    use_ssl=False,\n    ssl_verify=True,\n    ssl_verify_hostname=True,\n    ssl_context=None,\n)\n```\n\nParameters:\n\n* `host` - String - Hostname or IP of device\n\nOptional Parameters:\n\n* `username` - String - Login username - Default 'admin'\n* `password` - String - Login password - Default empty string\n* `port` - Integer - TCP Port for API - Default 8728 or 8729 when using SSL\n* `plaintext_login` - Boolean - Try plaintext login (for RouterOS 6.43 onwards) - Default **False**\n* `use_ssl` - Boolean - Use SSL or not? - Default **False**\n* `ssl_verify` - Boolean - Verify the SSL certificate? - Default **True**\n* `ssl_verify_hostname` - Boolean - Verify the SSL certificate hostname matches? - Default **True**\n* `ssl_context` - Object - Pass in a custom SSL context object. Overrides other options. - Default **None**\n\n#### Using SSL\n\nIf we want to use SSL, we can simply specify `use_ssl` as `True`:\n\n```python\nconnection = pyros_api.RosCall('\u003cIP\u003e', username='admin', password='', use_ssl=True)\nconnection.login()\n```\n\nThis will automatically verify SSL certificate and hostname. \nThe most flexible way to modify SSL parameters is to provide an SSL Context object using the \n`ssl_context` parameter, but for typical use-cases with self-signed certificates, the shorthand options of\n `ssl_verify` and `ssl_verify_hostname` are provided.\n\ne.g. if using a self-signed certificate, you can (but probably shouldn't) use:\n\n```python\nconnection = pyros_api.RosCall(\n    '\u003cIP\u003e',\n    username='admin',\n    password='',\n    use_ssl=True,\n    ssl_verify=False,\n    ssl_verify_hostname=False,\n)\n```\n\n#### Login for RouterOS v6.43 onwards\n\nRouterOS Versions v6.43 onwards now use a different login method. \nThe disadvantage is that it passes the password in plain text. \nFor security we only attempt the plaintext login if requested using the `plaintext_login` parameter. \nIt is highly recommended only to use this option with SSL enabled.\n\n```python\npyros_api.RosCall(host, username='admin', password='', plaintext_login=True)\nconnection.login()\n```\n\n### Execute Commands\n\nAfter successfully connecting with routerOS you can call all the available functions.\n\n### Examples\n```python\nx = connection.get_ppp_secret()\nprint(x)  # print list of all ppp secrets from routerOS\n```\n\n```python\n# changes password of given ppp secret. e.g.: secret = 'abc1 \u0026 password = '1234'\nx = connection.update_secret_password(secret, password)\n```\n\n#### Create New PPP Secret\n```\nsecret = {\n    'c_ident': '',\n    'p_pw': '',\n    'profile': 'default',\n    'service_type': 'pppoe',\n    'comment': '',\n    'has_suspended': False\n }\n```\nSecret Dictionary Key-Value Pair:\n\n* `c_ident` - String - PPP secret name (e.g: abc1) - Default empty string\n\nOptional Keys:\n\n* `p_pw` - String - PPP secret password - Default empty string\n* `profile` - String - PPP secret profile - Default 'default' profile\n* `service_type` - String - PPP secret service type (e.g: pptp/any/pppe) - Default pppoe\n* `comment` - String - PPP secret comment - Default empty string\n* `has_suspended` - Boolean - PPP secret state after creation (e.g: if True then after creating the secret the ppp secret will be disabled) - Default **False**\n##### Example\n```python\nsecret = {\n    'c_ident': 'abc5',\n    'p_pw': '1234',\n    'profile': 'default',\n    'service_type': 'pppoe',\n    'comment': 'This is a dummy comment!',\n    'has_suspended': False\n}\nconnection.add_ppp_secret(secret)  # returns True if successfully created\n```\n\n### Close conection:\n\n```python\nconnection.disconnect()\n```\n\n## socialWifi's routerOS-api API's\n\nEverything from the routerOS-api by socialWifi is also available by invoking the given function.\n```\napi = connection.ros_api_raw()\n```\nNow we can access all the functions from the routerOS-api by socialWifi.\n#### Example\n```\napi = connection.ros_api_raw()\nlist_ppp = api.get_resource('/ppp/secret')\nprint(list_ppp.get())  # prints all ppp secrets\n```\nTo learn more about how to access API's from [RouterOS-api] by Social WiFi please visit their [repository].\n\nAny contribution is welcome! Thanks.\n\n\n\n\n[RouterOS-api]: \u003chttps://github.com/socialwifi/RouterOS-api\u003e\n[repository]: \u003chttps://github.com/socialwifi/RouterOS-api\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcykyy%2Fpyros-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcykyy%2Fpyros-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcykyy%2Fpyros-api/lists"}