{"id":15444513,"url":"https://github.com/cariad/rebelbase","last_synced_at":"2025-03-28T08:13:51.070Z","repository":{"id":63803177,"uuid":"570821141","full_name":"cariad/rebelbase","owner":"cariad","description":"Python package for working with numbers of any base","archived":false,"fork":false,"pushed_at":"2022-11-29T15:22:25.000Z","size":530,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-05T12:08:56.611Z","etag":null,"topics":["data-science","mathematics","python"],"latest_commit_sha":null,"homepage":"https://rebelbase.dev","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/cariad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"cariad"}},"created_at":"2022-11-26T08:30:20.000Z","updated_at":"2022-11-28T14:09:54.000Z","dependencies_parsed_at":"2023-01-22T08:02:44.442Z","dependency_job_id":null,"html_url":"https://github.com/cariad/rebelbase","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cariad%2Frebelbase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cariad%2Frebelbase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cariad%2Frebelbase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cariad%2Frebelbase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cariad","download_url":"https://codeload.github.com/cariad/rebelbase/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245991585,"owners_count":20706129,"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":["data-science","mathematics","python"],"created_at":"2024-10-01T19:41:31.240Z","updated_at":"2025-03-28T08:13:51.051Z","avatar_url":"https://github.com/cariad.png","language":"Python","funding_links":["https://github.com/sponsors/cariad"],"categories":[],"sub_categories":[],"readme":"# RebelBase\n\n[![codecov](https://codecov.io/gh/cariad/rebelbase/branch/main/graph/badge.svg?token=3YgEtYwvmb)](https://codecov.io/gh/cariad/rebelbase)\n\n**RebelBase** is a Python package for working with numbers of any base.\n\nFull documentation is online at **[rebelbase.dev](https://rebelbase.dev)**.\n\n## What does RebelBase do?\n\nWant to work with base 3 numbers? We've got you covered.\n\n```python\nfrom rebelbase import Base3\n\nn = Base3(42)           # Represent decimal 42 in base 3\n\nprint(\"n:    \", n)      #  \"1120\" (Decimal 42     == base 3  1120)\nprint(\"n + 1:\", n + 1)  #  \"1121\" (Decimal 42 + 1 == base 3  1121)\nprint(\"n - 1:\", n - 1)  #  \"1112\" (Decimal 42 - 1 == base 3  1112)\nprint(\"n / 2:\", n / 2)  #   \"210\" (Decimal 42 / 2 == base 3   210)\nprint(\"n * 2:\", n * 2)  # \"10010\" (Decimal 42 * 1 == base 3 10010)\n\nn = Base3(\"212\")        # Create the base 3 value 212\n\nprint(int(n))           # \"23\"    (Base 3 212     == decimal 23)\n```\n\nNeed to make your own bonkers base 5 system with vowels for digits? No problem.\n\n```python\nfrom rebelbase.number import Number\n\nclass Base5(Number):\n    @classmethod\n    def digits(cls) -\u003e tuple[str, ...]:\n        return (\"A\", \"E\", \"I\", \"O\", \"U\")\n\nn = Base5(42)           # Represent decimal 42 in base 5\n\nprint(\"n:    \", n)      # \"EOI\" (Decimal 42     == base 5 EOI)\nprint(\"n + 1:\", n + 1)  # \"EOO\" (Decimal 42 + 1 == base 5 EOO)\nprint(\"n - 1:\", n - 1)  # \"EOE\" (Decimal 42 - 1 == base 5 EOE)\nprint(\"n / 2:\", n / 2)  #  \"UE\" (Decimal 42 / 2 == base 5  UE)\nprint(\"n * 2:\", n * 2)  # \"OEU\" (Decimal 42 * 2 == base 5 OEU)\n\nn = Base5(\"OOO\")        # Create the base 5 value OOO\n\nprint(int(n))           # \"93\"  (Base 5 OOO     == decimal 93)\n```\n\nA [`Number`](https://rebelbase.dev/number/) can be [created](https://rebelbase.dev/create/) with [optional zero support](https://rebelbase.dev/optional-zero/) for any base.\n\nNumbers can be initialised with their decimal value or string representation.\n\nA ton of Python [operations](https://rebelbase.dev/number/#math-operations) -- including addition, subtraction, floor and true division, multiplication, modulo and exponentiation -- work out of the box.\n\n## Installation\n\n**RebelBase** requires Python 3.9 or later.\n\n```console\npip install rebelbase\n```\n\n## Support\n\nPlease raise bugs, request new features and ask questions at [github.com/cariad/rebelbase/issues](https://github.com/cariad/rebelbase/issues).\n\n## Contributions\n\nSee [CONTRIBUTING.md](https://github.com/cariad/rebelbase/blob/main/CONTRIBUTING.md) for contribution guidelines.\n\n## The Project\n\n**RebelBase** is \u0026copy; 2022 Cariad Eccleston and released under the [MIT License](https://github.com/cariad/rebelbase/blob/main/LICENSE) at [cariad/rebelbase](https://github.com/cariad/rebelbase).\n\n## The Author\n\nHello! 👋 I'm **Cariad Eccleston** and I'm a freelance backend and infrastructure engineer in the United Kingdom. You can find me at [cariad.earth](https://cariad.earth), [github.com/cariad](https://github.com/cariad), [linkedin.com/in/cariad](https://linkedin.com/in/cariad) and on Mastodon at [@cariad@tech.lgbt](https://tech.lgbt/@cariad).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcariad%2Frebelbase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcariad%2Frebelbase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcariad%2Frebelbase/lists"}