{"id":16964983,"url":"https://github.com/propensive/galilei","last_synced_at":"2025-07-08T17:41:20.693Z","repository":{"id":37233704,"uuid":"320927912","full_name":"propensive/galilei","owner":"propensive","description":"Simple interfaces for I/O operations in Scala","archived":false,"fork":false,"pushed_at":"2025-02-04T08:13:26.000Z","size":3119,"stargazers_count":3,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-04T22:48:35.263Z","etag":null,"topics":["disk","files","filesystem","filesystem-library","io","paths","scala"],"latest_commit_sha":null,"homepage":"https://soundness.dev/galilei/","language":"Scala","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/propensive.png","metadata":{"files":{"readme":".github/readme.md","changelog":null,"contributing":".github/contributing.md","funding":null,"license":null,"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}},"created_at":"2020-12-12T21:30:02.000Z","updated_at":"2025-02-04T08:13:29.000Z","dependencies_parsed_at":"2023-02-14T18:16:04.525Z","dependency_job_id":"8eac6a8d-f2f8-4644-a8bd-3743eb8cf578","html_url":"https://github.com/propensive/galilei","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/propensive/galilei","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/propensive%2Fgalilei","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/propensive%2Fgalilei/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/propensive%2Fgalilei/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/propensive%2Fgalilei/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/propensive","download_url":"https://codeload.github.com/propensive/galilei/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/propensive%2Fgalilei/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264316551,"owners_count":23589975,"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":["disk","files","filesystem","filesystem-library","io","paths","scala"],"created_at":"2024-10-13T23:44:46.451Z","updated_at":"2025-07-08T17:41:20.669Z","avatar_url":"https://github.com/propensive.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"[\u003cimg alt=\"GitHub Workflow\" src=\"https://img.shields.io/github/actions/workflow/status/propensive/galilei/main.yml?style=for-the-badge\" height=\"24\"\u003e](https://github.com/propensive/galilei/actions)\n[\u003cimg src=\"https://img.shields.io/discord/633198088311537684?color=8899f7\u0026label=DISCORD\u0026style=for-the-badge\" height=\"24\"\u003e](https://discord.com/invite/MBUrkTgMnA)\n\u003cimg src=\"/doc/images/github.png\" valign=\"middle\"\u003e\n\n# Galilei\n\n__Making I/O in Scala elegant and typesafe__\n\n__Galilei__ is a library for performing safe disk I/O with Scala. It uses dependent types to provide\nprecise static representations of paths, files, directories and other filesystem objects, enforcing\nfilesystem-aware constraints on filenames and metadata. Galilei has a particular focus on precise error\nhandling and, when enabled, each filesystem operation which might fail must be handled for each possible\nfailure type; but its innovation is in minimizing that to a set of failure types which depends not\njust on the operation, but also the filesystem and in-scope options.\n\n## Features\n\n- intuitive and instructive API for most common filesystem operations\n- safe and precise error handling, without unnecessary handling\n- read from and write to files on disk with a variety of different types\n\n\n## Availability\n\n\n\n\n\n\n\n## Getting Started\n\n### Example\n\nFor example, moving a file from `/home/work/file` to `/home/work/copy` should work fine\nif there is no pre-existing file at `/home/work/copy`. We can move it with,\n`file.moveTo(destination)`. But if `/home/work/copy` already\nexists, then we may or may not care about what happens if we try to overwrite it.\n\nThe behavior can be specified with a contextual value in scope. Either,\n```scala\nimport filesystemOptions.overwritePreexisting\n```\nor,\n```scala\nimport filesystemOptions.doNotOverwritePreexisting\n```\n\nThe `moveTo` operation does not assume one option or the other as a default, and Galilei's\nphilosophy is that it would be wrong to do so. Instead, invoking `moveTo` _without_ exactly\none of the two contextal values in scope is a compile error, and the user is forced to\ndecide on the correct behavior. This is both unpresumptuous and instructive, since the\nuser may not have even considered the decision had to be made.\n\nAs a contextual value, the choice of behavior can be limited to a narrow scope, or\nimported globally, as needed.\n\nIf Scala 3's \"safer exceptions\" are turned on, then the choice of behavior also affects\nwhich exceptions must be handled when calling `moveTo`. The method invocation may throw\nan `IoError` under any circumstances, so that must always be handled, but with\n`doNotOverwritePreexisting` in scope, if there _is_ a pre-existing file at the destination,\nthen an `OverwriteError` will be thrown, which must be handled.\n\nBut since it cannot be thrown with `overwritePreexisting` in scope, the obligation to handle it\nis also removed.\n\n### Types\n\nUnlike many disk I/O libraries, __Galilei__ provides different types for `Path`s, `File`s, `Directory`s\nand other types of node, like `Symlink`s. A `Path` represents the abstract notion of a location within\na filesystem, which may or may not exist and may be a file, a directory or (on Linux, at least) one of\nseveral other filesystem node types. Types such as `File` and `Directory` should only exist to\ncorrespond to a real file or directory on disk.\n\nOf course, the contents of a filesystem can change independently of the JVM, so the existence of\nan immutable `File` or `Directory` instance does not guarantee its eternal existence on disk, but\nwe do, at least, guarantee that the filesystem node existed and had the correct type at the time\nof the object's creation.\n\n\n\n\n\n## Status\n\nGalilei is classified as __fledgling__. For reference, Soundness projects are\ncategorized into one of the following five stability levels:\n\n- _embryonic_: for experimental or demonstrative purposes only, without any guarantees of longevity\n- _fledgling_: of proven utility, seeking contributions, but liable to significant redesigns\n- _maturescent_: major design decisions broady settled, seeking probatory adoption and refinement\n- _dependable_: production-ready, subject to controlled ongoing maintenance and enhancement; tagged as version `1.0.0` or later\n- _adamantine_: proven, reliable and production-ready, with no further breaking changes ever anticipated\n\nProjects at any stability level, even _embryonic_ projects, can still be used,\nas long as caution is taken to avoid a mismatch between the project's stability\nlevel and the required stability and maintainability of your own project.\n\nGalilei is designed to be _small_. Its entire source code currently consists\nof 864 lines of code.\n\n## Building\n\nGalilei will ultimately be built by Fury, when it is published. In the\nmeantime, two possibilities are offered, however they are acknowledged to be\nfragile, inadequately tested, and unsuitable for anything more than\nexperimentation. They are provided only for the necessity of providing _some_\nanswer to the question, \"how can I try Galilei?\".\n\n1. *Copy the sources into your own project*\n   \n   Read the `fury` file in the repository root to understand Galilei's build\n   structure, dependencies and source location; the file format should be short\n   and quite intuitive. Copy the sources into a source directory in your own\n   project, then repeat (recursively) for each of the dependencies.\n\n   The sources are compiled against the latest nightly release of Scala 3.\n   There should be no problem to compile the project together with all of its\n   dependencies in a single compilation.\n\n2. *Build with [Wrath](https://github.com/propensive/wrath/)*\n\n   Wrath is a bootstrapping script for building Galilei and other projects in\n   the absence of a fully-featured build tool. It is designed to read the `fury`\n   file in the project directory, and produce a collection of JAR files which can\n   be added to a classpath, by compiling the project and all of its dependencies,\n   including the Scala compiler itself.\n   \n   Download the latest version of\n   [`wrath`](https://github.com/propensive/wrath/releases/latest), make it\n   executable, and add it to your path, for example by copying it to\n   `/usr/local/bin/`.\n\n   Clone this repository inside an empty directory, so that the build can\n   safely make clones of repositories it depends on as _peers_ of `galilei`.\n   Run `wrath -F` in the repository root. This will download and compile the\n   latest version of Scala, as well as all of Galilei's dependencies.\n\n   If the build was successful, the compiled JAR files can be found in the\n   `.wrath/dist` directory.\n\n## Contributing\n\nContributors to Galilei are welcome and encouraged. New contributors may like\nto look for issues marked\n[beginner](https://github.com/propensive/galilei/labels/beginner).\n\nWe suggest that all contributors read the [Contributing\nGuide](/contributing.md) to make the process of contributing to Galilei\neasier.\n\nPlease __do not__ contact project maintainers privately with questions unless\nthere is a good reason to keep them private. While it can be tempting to\nrepsond to such questions, private answers cannot be shared with a wider\naudience, and it can result in duplication of effort.\n\n## Author\n\nGalilei was designed and developed by Jon Pretty, and commercial support and\ntraining on all aspects of Scala 3 is available from [Propensive\nO\u0026Uuml;](https://propensive.com/).\n\n\n\n## Name\n\nGalilei's primary focus is handling Input and Output, or _I/O_, and is a pun on the name of the moon _Io_, one of the four moons of Jupiter discovered by Galileo Galilei.\n\n### Pronunciation\n\n`/ˌɡælɪˈleɪ/`\n\nIn general, Soundness project names are always chosen with some rationale,\nhowever it is usually frivolous. Each name is chosen for more for its\n_uniqueness_ and _intrigue_ than its concision or catchiness, and there is no\nbias towards names with positive or \"nice\" meanings—since many of the libraries\nperform some quite unpleasant tasks.\n\nNames should be English words, though many are obscure or archaic, and it\nshould be noted how willingly English adopts foreign words. Names are generally\nof Greek or Latin origin, and have often arrived in English via a romance\nlanguage.\n\n## Logo\n\nThe logo is the Galilean planet, Io.\n\n## License\n\nGalilei is copyright \u0026copy; 2025 Jon Pretty \u0026 Propensive O\u0026Uuml;, and\nis made available under the [Apache 2.0 License](/license.md).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpropensive%2Fgalilei","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpropensive%2Fgalilei","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpropensive%2Fgalilei/lists"}