{"id":22978260,"url":"https://github.com/mattruggio/teton","last_synced_at":"2026-02-09T09:33:09.275Z","repository":{"id":58663130,"uuid":"532961676","full_name":"mattruggio/teton","owner":"mattruggio","description":"Hierarchical key-value object store interface","archived":false,"fork":false,"pushed_at":"2023-10-27T19:58:00.000Z","size":33,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-05T13:42:36.516Z","etag":null,"topics":["document-store","hierarchical-data","key-value-store","object-store","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/mattruggio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2022-09-05T15:38:06.000Z","updated_at":"2025-03-30T00:49:45.000Z","dependencies_parsed_at":"2023-01-30T01:01:05.098Z","dependency_job_id":"b6bef688-a29b-4ae3-8510-619bfa9799ef","html_url":"https://github.com/mattruggio/teton","commit_stats":{"total_commits":10,"total_committers":3,"mean_commits":"3.3333333333333335","dds":0.4,"last_synced_commit":"58455f37e23f39f364ccbdcdc5cc1d28a344a457"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/mattruggio/teton","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattruggio%2Fteton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattruggio%2Fteton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattruggio%2Fteton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattruggio%2Fteton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattruggio","download_url":"https://codeload.github.com/mattruggio/teton/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattruggio%2Fteton/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29260696,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T04:11:57.159Z","status":"ssl_error","status_checked_at":"2026-02-09T04:11:56.117Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["document-store","hierarchical-data","key-value-store","object-store","ruby"],"created_at":"2024-12-15T01:18:02.955Z","updated_at":"2026-02-09T09:33:09.195Z","avatar_url":"https://github.com/mattruggio.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Teton\n\n[![Gem Version](https://badge.fury.io/rb/teton.svg)](https://badge.fury.io/rb/teton) [![Ruby Gem CI](https://github.com/mattruggio/teton/actions/workflows/rubygem.yml/badge.svg)](https://github.com/mattruggio/teton/actions/workflows/rubygem.yml) [![Maintainability](https://api.codeclimate.com/v1/badges/787a5d512223e85efd69/maintainability)](https://codeclimate.com/github/mattruggio/teton/maintainability) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n#### Hierarchical key-value object store\n\n---\n\nStore key-value pair-based objects in a key-based hierarchy.  Provides a pluggable interface for multiple back-ends.\n\n## Installation\n\nTo install through Rubygems:\n\n````\ngem install teton\n````\n\nYou can also add this to your Gemfile using:\n\n````\nbundle add teton\n````\n\n## Examples\n\nThe main API is made up of these instance methods:\n\nMethod                                 | Description\n---------------------------------------| --------------------------------------------------------------\n`Db#set(key, data = {})`               | Set an entries data to the passed in values.\n`Db#get(key, limit: nil, skip: nil)`   | Get the entry if it exists or nil if it does not.  If the key is a resource then it will always return an array.\n`Db#del(key)`                          | Delete the key and all children of the key from the store.\n`Db#count(key)`                        | The number of entries directly under a key if the key is a resource.  If they key is an entry then 1 if the entry exists and 0 if it does not exist.\n\nNote(s):\n\n* limit and skip are optional and only apply to resource keys, not entry keys.\n\n#### Setting Up Database\n\n````ruby\ndb = Teton::Db.new\n````\n\n#### Setting Objects\n\n````ruby\nbozo_key             = 'users/1'\ninception_key        = \"#{bozo_key}/movies/1\"      # =\u003e users/1/movies/1\ninception_actors_key = \"#{inception_key}/actors\"   # =\u003e users/1/movies/1/actors\nleo_key              = \"#{inception_actors_key}/1\" # =\u003e users/1/movies/1/actors/1\ntom_key              = \"#{inception_actors_key}/2\" # =\u003e users/1/movies/1/actors/2\n\ndb.set(bozo_key, first: 'bozo', last: 'clown')\n  .set(inception_key, title: 'Inception', year: 2010)\n  .set(leo_key, first: 'Leonardo', last: 'DiCaprio', star: true)\n  .set(tom_key, first: 'Tom', last: 'Hardy', star: true)\n````\n\nNote(s):\n\n* `#set` returns self.\n* If an inner key within the key does not exist then it will be added to the hierarchy.\n\n#### Retrieving Objects\n\n````ruby\nbozo             = db.get(bozo_key)             # =\u003e Teton::Entry\ninception        = db.get(inception_key)        # =\u003e Teton::Entry\nleo              = db.get(leo_key)              # =\u003e Teton::Entry\ntom              = db.get(tom_key)              # =\u003e Teton::Entry\ninception_actors = db.get(inception_actors_key) # =\u003e [Teton::Entry]\n````\n\nNote(s):\n\n* If a key does not exist then nil will be returned.\n* If a key is for a resource then it will return an array.\n\n#### Deleting Objects\n\n````ruby\ndb.del(leo_key)\n  .del(inception_key)\n  .del(bozo_key)\n````\n\nNote(s):\n\n* `#del` returns self.\n* If an inner key is deleted then all child keys in the hierarchy are deleted.\n\n#### Backends\n\nThe back-end: `Teton::Stores::Memory` will be used by default.  You can also pass in another back-end if one exists:\n\n````ruby\nstore = Teton::Stores::MySQL.new(host: '127.0.0.1', db: 'teton_entries')\ndb    = Teton::Db.new(store: store)\n````\n\nNote(s):\n\n* Each back-end may require specific configuration so it is up to you to check the desired back-end's documentation.\n* Currently `Teton::Stores::MySQL` does not exist as an implementation but any store (i.e. MySQL, PostgeSQL, Redis, S3, traditional file systems) should all be possible.\n\nEach back-end provides its own persistence mechanics.  For example, `Teton::Stores::Memory` provides persistence/serialization methods:\n\nMethod              | Description\n------------------- | -----------\n`#load!(path(`      | Load from a file on disk\n`#save!(path)`      | Save to a file on disk\n`#from_json!`       | Deserialize a passed in JSON string\n`#to_json`          | Return a serialized JSON string\n\n## Contributing\n\n### Development Environment Configuration\n\nBasic steps to take to get this repository compiling:\n\n1. Install [Ruby](https://www.ruby-lang.org/en/documentation/installation/) (check teton.gemspec for versions supported)\n2. Install bundler (gem install bundler)\n3. Clone the repository (git clone git@github.com:mattruggio/teton.git)\n4. Navigate to the root folder (cd teton)\n5. Install dependencies (bundle)\n\n### Running Tests\n\nTo execute the test suite run:\n\n````zsh\nbin/rspec spec --format documentation\n````\n\nAlternatively, you can have Guard watch for changes:\n\n````zsh\nbin/guard\n````\n\nAlso, do not forget to run Rubocop:\n\n````zsh\nbin/rubocop\n````\n\nAnd auditing the dependencies:\n\n````zsh\nbin/bundler-audit check --update\n````\n\n### Publishing\n\nNote: ensure you have proper authorization before trying to publish new versions.\n\nAfter code changes have successfully gone through the Pull Request review process then the following steps should be followed for publishing new versions:\n\n1. Merge Pull Request into main\n2. Update `version.rb` using [semantic versioning](https://semver.org/)\n3. Install dependencies: `bundle`\n4. Update `CHANGELOG.md` with release notes\n5. Commit \u0026 push main to remote and ensure CI builds main successfully\n6. Run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Code of Conduct\n\nEveryone interacting in this codebase, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/mattruggio/teton/blob/main/CODE_OF_CONDUCT.md).\n\n## License\n\nThis project is MIT Licensed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattruggio%2Fteton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattruggio%2Fteton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattruggio%2Fteton/lists"}