Initial commit.

This commit is contained in:
Sleepy Monax 2024-06-12 11:09:09 +02:00
commit 424710adb7
7 changed files with 148 additions and 0 deletions

5
.gitignore vendored Normal file
View file

@ -0,0 +1,5 @@
.cutekit
__pycache__
.DS_Store
.vscode
.idea

9
license.md Normal file
View file

@ -0,0 +1,9 @@
MIT License
Copyright © 2024 Cute Engineering
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

21
meta/plugins/__init__.py Normal file
View file

@ -0,0 +1,21 @@
import cutekit
cutekit.ensure((0, 7, 0))
from cutekit import cli, model
@cli.command(None, "uti", "Manage uti definitions")
def _():
pass
@cli.command(None, "uti/graph", "Show uti graph")
def _(args: model.RegistryArgs):
r = model.Registry.use(args)
# Iter all components and finds revelants res/_uti.json
for c in r.iter(model.Manifest):
path = c.subpath("res/_uti.json")
if path.exists():
print(c.path, path)

6
project.json Normal file
View file

@ -0,0 +1,6 @@
{
"$schema": "https://schemas.cute.engineering/stable/cutekit.manifest.project.v1",
"id": "cute-engineering/ce-uti",
"type": "project",
"description": "Utilities and repository for/of Uniform Type Identifier (UTI)"
}

89
readme.md Normal file
View file

@ -0,0 +1,89 @@
# 🗄️ Cute Engineering Uniform Type Identifier Library
Common uniform type identifier.
## What are UTIs?
Uniform Type Identifiers (UTIs) are a type of identifier used identify the type of a ressource in a computer system. UTIs are hierarchical, meaning that they can be related to each other in a parent-child relationship. For example, the UTI for a JPEG image is `public.jpeg`, and the UTI for a PNG image is `public.png`. The `public.image` UTI is the parent of both `public.jpeg` and `public.png`.
## Why use UTIs?
UTIs are more flexible than file extensions, and can be used to identify any type of ressource, not just files. UTIs can also be used to identify ressources that don't have a file extension, or that have a non-standard file extension.
## How to use UTIs?
UTIs are strings that follow a specific format. The format of a UTI is a series of components separated by dots. Each component is a string that represents a category of ressource. For example, the UTI for a JPEG image is `public.jpeg`, which consists of two components: `public` and `jpeg`.
## Examples
- `public.jpeg`: JPEG image
- `public.png`: PNG image
- `public.audio`: Audio file
- `public.video`: Video file
- `public.text`: Text file
## Relationship with Apple's UTIs
While inspired by Apple's UTIs, this specification is its own thing and is not affiliated with Apple in any way. The goal of this specification is to provide a common set of UTIs that can be used across different platforms and programming languages.
## Format
The format of a UTI is a series of components separated by dots. Each component is a string that represents a category of ressource. For example, the UTI for a JPEG image is `public.jpeg`, which consists of two components: `public` and `jpeg`.
## Namespaces
UTIs are divided into namespaces, which are used to group related UTIs together. Common namespaces include `public`, `vendor`, `private`, and `local`.
- `public`: UTIs that are intended to be used by everyone.
- `vendor`: UTIs that are intended to be used by a specific vendor.
- `private`: UTIs that are intended to be used by a specific application.
- `local`: UTIs that are intended to be used by a specific user/computer.
### The `local` Namespace
The `local` namespace is intended to be used for UTIs that are specific to a particular system or user, and that may not be applicable to other systems or users. For example a UTI for the user's device `local.device` could conform to `public.device.mobile` or `public.device.desktop` depending on the device type.
## Declaration
A UTI is declared as JSON object following the `https://schemas.cute.engineering/stable/common.uti.v1` schema.
```json
{
"$schema": "https://schemas.cute.engineering/stable/common.uti.v1",
"exports": [
{
"id": "public.jpeg",
"description": "JPEG image",
"conforms": [
"public.image"
],
"references": [
"https://en.wikipedia.org/wiki/JPEG"
],
"specifications": [
".jpg",
".jpeg",
".jpe",
"image/jpeg",
"image/jpg"
]
}
]
}
```
## Contributing
Contributions are welcome! If you have a UTI that you would like to add, please open a pull request. Please make sure to follow the format of existing UTIs, and to provide a description of the UTI and its intended use.
## License
<a href="https://opensource.org/licenses/MIT">
<img align="right" height="96" alt="MIT License" src="https://branding.cute.engineering/licenses/mit.svg" />
</a>
This software projet is licensed under the **MIT License**.
The full text of the license can be accessed via [this link](https://opensource.org/licenses/MIT) and is also included in the [license.md](license.md) file of this software package.

View file

@ -0,0 +1,6 @@
{
"$schema": "https://schemas.cute.engineering/stable/cutekit.manifest.component.v1",
"id": "ce-uti-core",
"type": "lib",
"description": "Core UTI definitions"
}

View file

@ -0,0 +1,12 @@
{
"$schema": "https://schemas.cute.engineering/stable/common.uti.v1",
"exports": [
{
"id": "public.data",
"description": "A data stream",
"conforms": [
"public.item"
]
}
]
}