{"id":24990034,"url":"https://github.com/rubenhortas/python_examples","last_synced_at":"2025-10-03T17:06:18.976Z","repository":{"id":33367446,"uuid":"37012319","full_name":"rubenhortas/python_examples","owner":"rubenhortas","description":"Examples of Python code and DSA (data structures and algorithms).","archived":false,"fork":false,"pushed_at":"2025-06-29T12:13:42.000Z","size":447,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-29T13:23:00.380Z","etag":null,"topics":["algorithm","algorithms","data","dsa","examples","python","python-3","python3","samples","snippets","structures"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":false,"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/rubenhortas.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,"zenodo":null}},"created_at":"2015-06-07T10:22:12.000Z","updated_at":"2025-06-29T12:13:46.000Z","dependencies_parsed_at":"2023-01-15T00:37:06.568Z","dependency_job_id":"40ac6fd1-4fe5-4cd9-abf4-f77a553f231f","html_url":"https://github.com/rubenhortas/python_examples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rubenhortas/python_examples","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubenhortas%2Fpython_examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubenhortas%2Fpython_examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubenhortas%2Fpython_examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubenhortas%2Fpython_examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rubenhortas","download_url":"https://codeload.github.com/rubenhortas/python_examples/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubenhortas%2Fpython_examples/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278196448,"owners_count":25946326,"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","status":"online","status_checked_at":"2025-10-03T02:00:06.070Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["algorithm","algorithms","data","dsa","examples","python","python-3","python3","samples","snippets","structures"],"created_at":"2025-02-04T13:04:29.360Z","updated_at":"2025-10-03T17:06:18.945Z","avatar_url":"https://github.com/rubenhortas.png","language":"Python","readme":"# python examples\n\nSmall examples of Python code, data structures and algorithms.\n\n![GitHub repo file count](https://img.shields.io/github/directory-file-count/rubenhortas/python_examples)\n![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/rubenhortas/python_examples)\n![GitHub repo size](https://img.shields.io/github/repo-size/rubenhortas/python_examples)\n\n![GitHub issues](https://img.shields.io/github/issues-raw/rubenhortas/python_examples?logo=github)\n![GitHub closed issues](https://img.shields.io/github/issues-closed-raw/rubenhortas/python_examples?logo=github)\n![GitHub pull requests](https://img.shields.io/github/issues-pr-raw/rubenhortas/python_examples?\u0026logo=github)\n![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed-raw/rubenhortas/python_examples?logo=github)\n\n![GitHub](https://img.shields.io/github/license/rubenhortas/python_examples)\n\n## Python naming conventions\n\n### Public elements\n\n| Type            | Notation                    | Example       | Notes                                                                             |\n|-----------------|-----------------------------|---------------|-----------------------------------------------------------------------------------|\n| Class           | PascalCase (UpperCamelCase) | MyClass       |                                                                                   |\n| Constant        | SCREAMING_SNAKE_CASE        | MY_CONSTANT   | Uppercase single letter, word, or words. Separate words with underscores.         |\n| Enum values     | SCREAMING_SNAKE_CASE        | SOME_ENUM     |                                                                                   |\n| Exception       | PascalCase (UpperCamelCase) | MyException   |                                                                                   |\n| Function/Method | snake_case                  | my_function() | Lowercase word or words. Separate words by underscores.                           |\n| Module          | snake_case                  | my_module.py  | Short. Lowercase word or words.  Underscores can be used if improves readability. |\n| Package         | lowercase                   | mypackage     | Short. Lowercase word or words. The use of underscores is discouraged.            |\n| Variable        | snake_case                  | my_variable   | Lowercase single letter, word, or words. Separate words with underscores.         |\n\n### Private elements\n\nNo attribute is really private in Python (without a generally unnecessary amount of work), but there are conventions:\n\n| Convention                  | Meaning                      | Use                                                                                           |\n|-----------------------------|------------------------------|-----------------------------------------------------------------------------------------------|\n| _single_leading_underscore  | Weak internal use indicator. | The object is meant to be private, and shouldn't be directly accessed from outside the class. |\n| __double_leading_underscore | Invokes name mangling.       | A way to make instance variables less likely to collide with variables in subclasses.         |\n\n### Comments\n\n* Should be complete sentences. The first word should be capitalized, unless it is an identifier that begins with a\n  lower case letter.\n* Block comments generally consist of one or more paragraphs built out of complete sentences, with each sentence ending\n  in a period.\n* Use two spaces after a sentence-ending period in multi-sentence comments except after the final sentence.\n    * ### Block Comments\n      Block comments generally apply to some (or all) code that follows them, and are indented to the same level as that\n      code.\n      Each line of a block comment starts with a # and a single space (unless it is indented text inside the comment).  \n      Paragraphs inside a block comment are separated by a line containing a single #.\n\n      ```python\n      # Use this function to check code quality. \n      # Code quality is defined by the following parameters: \n      # - The code follows naming conventions\n      # - The code is easy to understand\n      # - ...\n      def check_code_quality(code):\n        ...\n      ```\n\n    * ### Inline Comments\n      Inline comments should be separated by at least two spaces from the statement. They should start with a # and a\n      single space.\n\n      ```python\n      if len(commits) \u003e 0:  # Make sure that there is commits\n        ...\n      ```\n\n### Documentation strings\n\n* Write docstrings for all public modules, functions, classes, and methods.\n  A docstring is the first statement in a package, module, class or function.\n  Docstrings are not necessary for non-public methods, but you should have a comment that describes what the method\n  does.\n  * The \"\"\" that ends a multiline docstring should be on a line by itself.\n\n    ```python\n    def draw_circle():\n        \"\"\"\n        Returns a circle\n        Draws a circle.\n        \"\"\"\n        ...\n    ```\n* For one-liner docstrings keep the closing \"\"\" on the same line:\n  ```python\n  \"\"\"Returns a circle.\"\"\"\n  ```\n\n## Python file format\n\n  1. Hashbang\n  2. Docstrings\n  3. Imports\n  4. Code\n\n## Sources\n\n* [PEP 8](https://peps.python.org/pep-0008)\n* [Google Python Style Guide](https://google.github.io/styleguide/pyguide.html)\n\n## Support\n\nIf you find these examples useful you can star this repo.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubenhortas%2Fpython_examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frubenhortas%2Fpython_examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubenhortas%2Fpython_examples/lists"}