
Security News
Astral Launches pyx: A Python-Native Package Registry
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Gyro is a tool to generate Realm model classes, for both Android (Java & Kotlin) and iOS/macOS (Swift), from an .xcdatamodel
file.
![]() |
G enerate Y our R ealm O bjects |
The .xcdatamodel
file is usually used to represent Core Data entities in Xcode in a graphical way. It can be created or edited with a graphical user interface in Xcode.
But with Gyro, you will now be able to use an xcdatamodel
to create a Realm model files as well!
This will allow you to design your model in a visual way (rather than by code), only once (rather than once for Android and once for iOS), and have the code generated for you.
The .xcdatamodel
file is the input of the script.
Gyro is on RubyGems, so this means you can simply install it by using this command in your terminal:
gem install gyro
Alternativly, you could also clone this repository anywhere you want on your machine, then build and install the local gem
gem build gyro.gemspec
gem install gyro-*.gem
Invoke it with the appropriate options like this:
gyro --model <model> --template <template-name> --output <output-dir> --param <key>:<value>
<model>
is the path to the xcdatamodel file
<output-dir>
is the path to the output directory file
<template-name>
is the name of the template. Below you have the list of templates.
You can use gyro -l
to list the names of all the bundled templates available.
If you want additional information about a specific template, you can use gyro -i <template_name>
to print its README documentation, which is also directly accessible on GitHub via the following links:
android
is an alias name for the android-java templateswift4
is an alias name for the swift3 templateDecodable
pod)object-mapper
template)xcdatamodel
The .xcdatamodel
Xcode editor allows you to add "user infos" to your entities, attributes or relationships. Each "user info" entry is an arbitrary key/value pair.
To define a User Info key in Xcode's xcdatamodel editor, select the entity or attribute you want to add a User Info to, then select the 3rd tab in the inspector on the right ("Data Model Inspector", or Cmd-Alt-3), and fill the information you want in the "User Info" section there.
With the help of these "user infos", you will be able to give Gyro extra information about your model classes. For example, you can tell which attribute is the primary key, the attributes to ignore, the JSON mappings, …
For more information about each "user infos" keys supported, you can see the 📖 dedicated documentation here.
This tool is under the Apache 2 License.
It has been initially developed by Niji and is in no way affiliated to the Realm company.
FAQs
Unknown package
We found that gyro demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.