{"id":16960835,"url":"https://github.com/carleslc/kotlin-extensions","last_synced_at":"2025-03-17T08:37:38.649Z","repository":{"id":46052089,"uuid":"95478130","full_name":"Carleslc/kotlin-extensions","owner":"Carleslc","description":"Utility extensions to boost your programming with Kotlin.","archived":false,"fork":false,"pushed_at":"2023-07-19T20:45:37.000Z","size":209,"stargazers_count":75,"open_issues_count":3,"forks_count":15,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-16T10:12:06.295Z","etag":null,"topics":["2d-array","android","boost","collections","conversion","extension-methods","extensions","gradle","html","kotlin","kotlin-extensions","kotlin-language","kotlin-library","maven","patterns","preconditions","properties","time","utils"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/Carleslc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"ko_fi":"carleslc"}},"created_at":"2017-06-26T18:42:48.000Z","updated_at":"2025-03-11T05:23:24.000Z","dependencies_parsed_at":"2022-09-15T09:52:48.151Z","dependency_job_id":null,"html_url":"https://github.com/Carleslc/kotlin-extensions","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Carleslc%2Fkotlin-extensions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Carleslc%2Fkotlin-extensions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Carleslc%2Fkotlin-extensions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Carleslc%2Fkotlin-extensions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Carleslc","download_url":"https://codeload.github.com/Carleslc/kotlin-extensions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244001630,"owners_count":20381805,"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":["2d-array","android","boost","collections","conversion","extension-methods","extensions","gradle","html","kotlin","kotlin-extensions","kotlin-language","kotlin-library","maven","patterns","preconditions","properties","time","utils"],"created_at":"2024-10-13T22:50:19.530Z","updated_at":"2025-03-17T08:37:38.332Z","avatar_url":"https://github.com/Carleslc.png","language":"Kotlin","funding_links":["https://ko-fi.com/carleslc"],"categories":[],"sub_categories":[],"readme":"# KotlinExtensions\n[![](https://jitpack.io/v/Carleslc/kotlin-extensions.svg)](https://jitpack.io/#Carleslc/kotlin-extensions)\n\nUtility extensions, properties and useful methods to boost your programming with Kotlin.\n\n[![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/carleslc)\n\n## How to install\n\n### Maven\nAdd the following repository to your `pom.xml`:\n```xml\n\u003crepositories\u003e\n    \u003crepository\u003e\n        \u003cid\u003ejitpack.io\u003c/id\u003e\n        \u003curl\u003ehttps://jitpack.io\u003c/url\u003e\n    \u003c/repository\u003e\n\u003c/repositories\u003e\n```\n\nAdd the following dependencies to your `pom.xml`:\n```xml\n\u003cdependencies\u003e\n    \u003cdependency\u003e\n    \t\u003cgroupId\u003eme.carleslc\u003c/groupId\u003e\n    \t\u003cartifactId\u003ekotlin-extensions\u003c/artifactId\u003e\n    \t\u003cversion\u003e0.8\u003c/version\u003e\n    \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\nIf you need more powerful extensions and tools check the [optional libraries section](https://github.com/Carleslc/kotlin-extensions#optional-libraries).\n\n### Gradle\n\nAdd the following repository to your `build.gradle`:\n\n```groovy\nrepositories {\n    maven { url 'https://jitpack.io' }\n}\n```\n\nAdd the following dependency to your `build.gradle`:\n```groovy\ndependencies {\n    compile 'me.carleslc:kotlin-extensions:0.8'\n}\n```\n\nIf you need more powerful extensions and tools check the [optional libraries section](https://github.com/Carleslc/kotlin-extensions#optional-libraries).\n\n### Manual\n\n1. `git clone https://github.com/Carleslc/kotlin-extensions.git`\n2. `cd kotlin-extensions`\n3. Build the KotlinExtensions with `mvn clean install`. This also adds this project to your local Maven repository.\n\nIf you wish, you can use these steps to add the dependency using Maven or Gradle without accessing to the `jitpack.io` remote repository.\n\nOtherwise, you will need to add the `kotlin-extensions-0.8.jar` from generated `target` folder as external dependency of your project.\n\nIf you need more powerful extensions and tools check the [optional libraries section](https://github.com/Carleslc/kotlin-extensions#optional-libraries).\n\n## How to use\n\nIn order to use any of the extensions or methods of KotlinExtensions you only need to import them.\n\n### Import a single extension\n`import main.kotlin.extensions.standard.times`\n\n### Import all extensions of a package\n`import main.kotlin.extensions.standard.*`\n\n## Packages available\n\n### Arrays\n`import main.kotlin.extensions.arrays.*`\n\nExtensions for arrays, a syntactic-sugar way to create literal arrays like `A[1, 2, 3]` instead typical `arrayOf(1, 2, 3)`\nand methods to work with 2D arrays and matrices (2D arrays with fixed columns size) easier.\n\n### Bytes\n`import main.kotlin.extensions.bytes.*`\n\nExtensions for memory size conversions _(from bits to pebibytes and petabytes)_.\n\nInspired from [ktunits](https://github.com/sargunster/ktunits) library.\n\n### Collections\n`import main.kotlin.extensions.collections.*`\n\nExtensions for collections, syntactic-sugar for list and set literals with `L[values]` or `S[values]` and other global methods to create collections.\n\n### Conversions\n`import main.kotlin.extensions.conversions.*`\n\nExtensions for conversions between basic types.\n\n### HTML\n`import main.kotlin.extensions.html.*`\n\nExtensions to generate HTML in a more readable way.\n\n### Map\n`import main.kotlin.extensions.map.*`\n\nExtensions for maps and sintactic-sugar for Map literals with `M[pairs]`.\n\n### Number\n`import main.kotlin.extensions.number.*`\n\nExtensions for numbers and math operations.\n\n### Strings\n`import main.kotlin.extensions.strings.*`\n\nExtensions for strings.\n\n`pluralize` and `singularize` methods are extracted from [kotlin-pluralizer](https://github.com/cesarferreira/kotlin-pluralizer).\n\n### Time\n`import main.kotlin.extensions.time.*`\n\nExtensions for timing, format and manage time or dates easily.\n\nInspired from [kxdate](https://github.com/yole/kxdate) and [khronos](https://github.com/hotchemi/khronos) libraries.\n\n### Tuples\n`import main.kotlin.extensions.tuples.*`\n\nExtensions for pairs and triples.\n\n### Preconditions\n`import main.kotlin.extensions.preconditions.*`\n\nExtensions to ensure preconditions easily.\n\n### Standard\n`import main.kotlin.extensions.standard.*`\n\nGeneral purpose extensions and global methods that do not match any other package category (_e.g._ looping with `10 times { code }` or `10 * { code }`).\n\n## Contribute\n\n_Do you want to contribute to this project? Great!_\n\nSimply fork and do a pull request. Then if it makes sense I will merge it creating a new version of this project.\n\nFollow this rules when doing a pull request in order to be accepted:\n\n1. Match the code style of this project (default in _IntelliJ_). You can do `⌘ + Option + L` in Mac with _IntelliJ_ IDE to reformat your code. \n2. Unit Test your code.\n3. Inline your extensions when possible. Include `@file:Suppress(\"NOTHING_TO_INLINE\")` to suppress warnings at top of your file.\n4. Ensure that your extensions/methods are general enough to be used in many different contexts.\n5. Be descriptive in the title and description of your pull request.\n\n## Optional Libraries\n\n### [Arrow](https://github.com/arrow-kt/arrow)\n\nThis library adds functional stuff to boost your programming with Kotlin. It is a perfect library to use together with KotlinExtensions.\n\nWe've already included `arrow.core` in KotlinExtensions.\n\n### [Guava](https://github.com/google/guava)\n\nThis library from Google includes a lot of useful classes and methods to extend the language. It is written in Java but it can be used from Kotlin with no problem.\n\nIt is already included with version `32.0.0-android` in KotlinExtensions, available for Android use.\n\n### [Android KTX](https://developer.android.com/kotlin/ktx) and [Splitties](https://github.com/LouisCAD/Splitties)\n\nIf you need extensions and useful tools for Android these libraries are recommended for your Android development.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarleslc%2Fkotlin-extensions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarleslc%2Fkotlin-extensions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarleslc%2Fkotlin-extensions/lists"}