{"id":13509625,"url":"https://github.com/adamkittelson/simplex","last_synced_at":"2026-02-23T05:01:42.507Z","repository":{"id":20465598,"uuid":"23742996","full_name":"adamkittelson/simplex","owner":"adamkittelson","description":"An Elixir library for interacting with the Amazon SimpleDB API.","archived":false,"fork":false,"pushed_at":"2019-10-24T19:40:52.000Z","size":87,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-21T15:34:15.950Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Elixir","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/adamkittelson.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-06T19:17:26.000Z","updated_at":"2016-06-21T19:58:37.000Z","dependencies_parsed_at":"2022-07-31T20:48:05.357Z","dependency_job_id":null,"html_url":"https://github.com/adamkittelson/simplex","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/adamkittelson/simplex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamkittelson%2Fsimplex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamkittelson%2Fsimplex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamkittelson%2Fsimplex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamkittelson%2Fsimplex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adamkittelson","download_url":"https://codeload.github.com/adamkittelson/simplex/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamkittelson%2Fsimplex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29701973,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T23:35:04.139Z","status":"ssl_error","status_checked_at":"2026-02-21T23:35:03.832Z","response_time":107,"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":[],"created_at":"2024-08-01T02:01:10.544Z","updated_at":"2026-02-23T05:01:42.399Z","avatar_url":"https://github.com/adamkittelson.png","language":"Elixir","funding_links":[],"categories":["Third Party APIs"],"sub_categories":[],"readme":"# Simplex\n\n[![Build Status](https://travis-ci.org/adamkittelson/simplex.svg)](https://travis-ci.org/adamkittelson/simplex)\n[![Coverage Status](https://img.shields.io/coveralls/adamkittelson/simplex.svg)](https://coveralls.io/r/adamkittelson/simplex)\n\nAn Elixir library for interacting with the [Amazon SimpleDB](http://aws.amazon.com/simpledb/) API.\n\nRequires Elixir ~\u003e 1.0.0\n\n## Installation\n\nInstall the [Hex.pm](http://hex.pm) package\n\n1. Add simplex to your `mix.exs` dependencies:\n\n    ```elixir\n    def deps do\n      [\n        {:simplex, \"0.3.0\"}\n      ]\n    end\n    ```\n\n2. Add `:simplex` to your application dependencies:\n\n    ```elixir\n    def application do\n      [applications: [:simplex]]\n    end\n    ```\n\n### Configuration\n\n`{:ok, simplex} = Simplex.new`\n\n#### AWS Keys\n\nTo communicate with the SimpleDB API you'll need to provide your AWS Access and Secret keys.\n\nThere are two ways to provide your keys to the Simplex library:\n\n1. Set them from within your application\n    ```elixir\n    {:ok, simplex} = Simplex.new(\"your-access-key\", \"your-secret-access-key\")\n    ```\n\n    or\n\n    ```elixir\n    {:ok, simplex} = Simplex.new\n    Simplex.aws_access_key(simplex, \"your-access-key\")\n    Simplex.aws_secret_access_key(simplex, \"your-secret-access-key\")\n    ```\n\n2. Set them as the environment variables `AWS_ACCESS_KEY` and `AWS_SECRET_ACCESS_KEY`\n    ```\n    AWS_ACCESS_KEY=your-access-key AWS_SECRET_ACCESS_KEY=your-secret-access-key iex -S mix\n\n    iex(1)\u003e {:ok, simplex} = Simplex.new\n    {:ok, #PID\u003c0.164.0\u003e}\n    iex(2)\u003e Simplex.aws_access_key(simplex)\n    \"your-access-key\"\n    iex(3)\u003e Simplex.aws_secret_access_key(simplex)\n    \"your-secret-access-key\"\n\n    ```\n\n3. If not provided by the above two methods Simplex will attempt to retrieve keys from [instance metadata](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html) if it's running in EC2 and you launched your instance with an IAM role with permission to access SimpleDB.\n\n#### SimpleDB URL\n\nBy default Simplex will send all requests to the us-east-1 SimpleDB url: `https://sdb.amazonaws.com`. If you want to use a [different region](http://docs.aws.amazon.com/general/latest/gr/rande.html#sdb_region) you can change the url by:\n\n1. Setting it from within your application\n    ```elixir\n    {:ok, simplex} = Simplex.new\n    Simplex.simpledb_url(simplex, \"https://sdb.us-west-1.amazonaws.com\")\n    ```\n\n2. Set it as the environment variable `SIMPLEDB_URL`\n    ```\n    SIMPLEDB_URL=https://sdb.us-west-1.amazonaws.com iex -S mix\n\n    iex(1)\u003e {:ok, simplex} = Simplex.new\n    {:ok, #PID\u003c0.164.0\u003e}\n    iex(2)\u003e Simplex.simpledb_url(simplex)\n    \"https://sdb.us-west-1.amazonaws.com\"\n    ```\n\n#### SimpleDB Version\n\nBy default Simplex will use the 2009-04-15 version of the SimpleDB API. If you wish to use a different version you can change it by:\n\n1. Setting it from within your application\n    ```elixir\n    {:ok, simplex} = Simplex.new\n    Simplex.simpledb_version(simplex, \"2008-02-12\")\n    ```\n\n2. Set it as the environment variable `SIMPLEDB_VERSION`\n    ```\n    SIMPLEDB_VERSION=2008-02-12 iex -S mix\n\n    iex(1)\u003e {:ok, simplex} = Simplex.new\n    {:ok, #PID\u003c0.164.0\u003e}\n    iex(2)\u003e Simplex.simpledb_version(simplex)\n    \"2008-02-12\"\n    ```\n\n\n## Responses\n\nSimplex will respond to SimpleDB requests with a 3 element tuple, either `{:ok, result, response}` or `{:error, messages, response}`\n\n#### %Simplex.Response{}\n\nA Simplex response (third element of the tuple above) has the following fields:\n\n1. body: A Map containing the parsed body of the response\n2. status_code: The HTTP status code of the response\n3. headers: The response headers\n4. raw_body: The raw string of the response body. (XML)\n\n#### Pattern Matching\n\nYou can pattern match to determine how to handle the response:\n\n  ```elixir\n  case Simplex.Domains.create(simplex, \"new_domain\") do\n    {:ok, result, response} -\u003e\n      # some happy path stuff here\n    {:error, messages, response} -\u003e\n      # handle problems\n  end\n  ```\n\n## Domains\n\n[Create](http://docs.aws.amazon.com/AmazonSimpleDB/latest/DeveloperGuide/SDB_API_CreateDomain.html) a new domain.\n\n  ````elixir\n  Simplex.Domains.create(simplex, \"new_domain\")\n  ````\n\n[List](http://docs.aws.amazon.com/AmazonSimpleDB/latest/DeveloperGuide/SDB_API_ListDomains.html) domains.\n\n  ````elixir\n  Simplex.Domains.list(simplex)\n\n  Simplex.Domains.list(simplex, %{\"MaxNumberOfDomains\" =\u003e \"10\", \"NextToken\" =\u003e \"token-from-previous-list-response\"})\n  ````\n\n[Delete](http://docs.aws.amazon.com/AmazonSimpleDB/latest/DeveloperGuide/SDB_API_DeleteDomain.html) a domain.\n\n  ````elixir\n  Simplex.Domains.delete(simplex, \"domain_to_delete\")\n  ````\n\n## Attributes\n\n[Get](http://docs.aws.amazon.com/AmazonSimpleDB/latest/DeveloperGuide/SDB_API_GetAttributes.html) attributes of an item.\n\n  ````elixir\n  Simplex.Attributes.get(simplex, \"your_domain\", \"your_item_name\")\n\n  Simplex.Attributes.get(simplex, \"your_domain\", \"your_item_name\", %{\"AttributeName\" =\u003e \"some_attribute\", \"ConsistentRead\" =\u003e \"true\"})\n  ````\n\n[Put](http://docs.aws.amazon.com/AmazonSimpleDB/latest/DeveloperGuide/SDB_API_PutAttributes.html) attributes on an item (or create a new item).\n\n  ````elixir\n  # Attribute values can be strings, lists of strings, or a\n  # two-element tuple of :replace and a string or list of strings\n  # The replace tuple indicates that the value should replace the existing\n  # value for that attribute, rather than be added to its values\n\n  Simplex.Attributes.put(simplex,\n                         \"your_domain\",\n                         \"your_item_name\",\n                         %{\"some_key\"        =\u003e \"some_value\",\n                           \"another_key\"     =\u003e [\"a\", \"list\", \"of\", \"values\"],\n                           \"yet_another_key\" =\u003e {:replace, \"a value to replace the existing value(s) of yet_another_key\"},\n                           \"one_last_key     =\u003e {:replace, [\"values\", \"to\", \"replace\", \"one_last_key's\", \"previous\", \"value(s)\"]}})\n\n  # put \"some_value\" in the \"some_key\" attribute only if\n  # \"other_key\" has the \"other_value\" value\n  Simplex.Attributes.put(simplex,\n                         \"your_domain\",\n                         \"your_item_name\",\n                         %{\"some_key\" =\u003e \"some_value\"},\n                         %{\"Name\" =\u003e \"other_key\", \"Value\" =\u003e \"other_value\"})\n  ````\n\n[Delete](http://docs.aws.amazon.com/AmazonSimpleDB/latest/DeveloperGuide/SDB_API_DeleteAttributes.html) attributes on an item (or delete an item).\n\n  ````elixir\n  # Delete the \"some_value\" value from the \"some_key\" attribute\n  Simplex.Attributes.delete(simplex,\n                            \"your_domain\",\n                            \"your_item_name\",\n                            %{\"some_key\" =\u003e \"some_value\"})\n\n  # Delete \"your_item_name\" if it doesn't have the \"some_key\" attribute\n  Simplex.Attributes.delete(simplex,\n                            \"your_domain\",\n                            \"your_item_name\",\n                            %{},\n                            %{\"Name\" =\u003e \"some_key\", \"Exists\" =\u003e \"false\"})\n  ````\n\n## Select\n\n[Select](http://docs.aws.amazon.com/AmazonSimpleDB/latest/DeveloperGuide/SDB_API_Select.html) attributes from items matching an expression.\n\n  ````elixir\n  Simplex.Select.select(simplex, \"select * from your_domain where some_key = 'some_value'\")\n  ````\n\n----\n\n#### TODO:\n\n1. Implement [BatchDeleteAttributes](http://docs.aws.amazon.com/AmazonSimpleDB/latest/DeveloperGuide/SDB_API_BatchDeleteAttributes.html), [BatchPutAttributes](http://docs.aws.amazon.com/AmazonSimpleDB/latest/DeveloperGuide/SDB_API_BatchPutAttributes.html), and [DomainMetadata](http://docs.aws.amazon.com/AmazonSimpleDB/latest/DeveloperGuide/SDB_API_DomainMetadata.html)\n2. Docs\n3. Implement Select.select_all / Domains.list_all (automatically follow next_token to load more results if present)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamkittelson%2Fsimplex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamkittelson%2Fsimplex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamkittelson%2Fsimplex/lists"}