.. image:: https://cfl.dropboxstatic.com/static/images/sdk/stone_banner.png
:target: https://github.com/dropbox/stone
.. image:: https://img.shields.io/pypi/pyversions/stone.svg
:target: https://pypi.python.org/pypi/stone
.. image:: https://img.shields.io/pypi/v/stone.svg
:target: https://pypi.python.org/pypi/stone
.. image:: https://codecov.io/gh/dropbox/stone/branch/main/graph/badge.svg
:target: https://codecov.io/gh/dropbox/stone
The Official Api Spec Language for Dropbox.
`Documentation`_ can be found on GitHub
Installation
============
Install stone using ``pip``::
$ pip install --user stone
This will install a script ``stone`` to your PATH that can be run from the
command line::
$ stone -h
Stone requires Python 3.
Alternative
-----------
If you choose not to install ``stone`` using the method above, you will need
to ensure that you have the Python packages ``ply`` and ``six``, which can be
installed through ``pip``::
$ pip install "ply>=3.4" "six>=1.3.0" "typing>=3.5.2"
If the ``stone`` package is in your PYTHONPATH, you can replace ``stone``
with ``python -m stone.cli`` as follows::
$ python -m stone.cli -h
If you have the ``stone`` package on your machine, but did not install it or
add its location to your PYTHONPATH, you can use the following::
$ PYTHONPATH=path/to/stone python -m stone.cli -h
After installation, follow one of our `Examples`_ or read the `Documentation`_.
Overview
========
Define an API once in Stone. Use backends, i.e. code generators, to translate
your specification into objects and functions in the programming languages of
your choice.
* Introduction
* Motivation_
* Installation_
* `Language Reference <https://github.com/dropbox/stone/blob/main/docs/lang_ref.rst>`_
* `Builtin Backends <https://github.com/dropbox/stone/blob/main/docs/builtin_backends.rst>`_
* `Managing Specs <https://github.com/dropbox/stone/blob/main/docs/managing_specs.rst>`_
* `Evolving a Spec <https://github.com/dropbox/stone/blob/main/docs/evolve_spec.rst>`_
* `Backend Reference <https://github.com/dropbox/stone/blob/main/docs/backend_ref.rst>`_
* `JSON Serializer <https://github.com/dropbox/stone/blob/main/docs/json_serializer.rst>`_
* `Network Protocol <https://github.com/dropbox/stone/blob/main/docs/network_protocol.rst>`_
*Warning: The documentation is undergoing a rewrite.*
.. image:: docs/overview.png
Stone is made up of several components:
Language
--------
A language for writing API specifications, "specs" for short.
Command-Line Interface
----------------------
The CLI (``stone``) generates code based on the provided specs, backend,
and additional arguments.
Backends
--------
There are builtin backends that come with Stone: Javascript, Python, Obj-C,
Swift, and Typescript.
There are other backends we've written that aren't part of the Stone package
because they aren't sufficiently general, and can't realistically be re-used
for non-Dropbox APIs: Go and Java.
Stone includes a Python interface for defining new backends based on its
intermediate representation of specs. This gives you the freedom to generate
to any target.
JSON Serialization
------------------
Stone defines a JSON-compatible serialization scheme.
Motivation
==========
Stone was birthed at Dropbox at a time when it was becoming clear that API
development needed to be scaled beyond a single team. The company was
undergoing a large expansion in the number of product groups, and it wasn't
scalable for the API team, which traditionally dealt with core file operations,
to learn the intricacies of each product and build corresponding APIs.
Stone's chief goal is to decentralize API development and ownership at Dropbox.
To be successful, it needed to do several things:
**Decouple APIs from SDKS**: Dropbox has first-party clients for our mobile
apps, desktop client, and website. Each of these is implemented in a different
language. Moreover, we wanted to continue providing SDKs to third-parties, over
half of whom use our SDKs. It's untenable to ask product groups that build APIs
to also implement these endpoints in a half-dozen different language-specific
SDKs. Without decoupling, as was the case in our v1 API, the SDKs will
inevitably fall behind. Our solution is to have our SDKs automatically
generated.
**Improve Visibility into our APIs**: These days, APIs aren't just in the
domain of engineering. Product managers, product specialists, partnerships,
sales, and services groups all need to have clear and accurate specifications
of our APIs. After all, APIs define Dropbox's data models and functionality.
Before Stone, API design documents obseleted by changes during implementation
were the source of truth.
**Consistency and Predictability**: Consistency ranging from documentation
tense to API patterns are important for making an API predictable and therefore
easier to use. We needed an easy way to make and enforce patterns.
**JSON**: To make consumption easier for third parties, we wanted our data
types to map to JSON. For cases where serialization efficiency
(space and time) are important, you can try using msgpack (alpha support
available in the Python generator). It's possible also to define your own
serialization scheme, but at that point, you may consider using something like
`Protobuf <https://github.com/google/protobuf>`_.
Stone is in active use for the `Dropbox v2 API
<http://www.dropbox.com/developers>`_.
Assumptions
-----------
Stone makes no assumptions about the protocol layer being used to make API
requests and return responses; its first use case is the Dropbox v2 API which
operates over HTTP. Stone does not come with nor enforce any particular RPC
framework.
Stone makes some assumptions about the data types supported in target
programming languages. It's assumed that there is a capacity for representing
dictionaries (unordered string keys -> value), lists, numeric types, and
strings.
Stone assumes that a route (or API endpoint) can have its argument and
result types defined without relation to each other. In other words, the
type of response does not change based on the input to the endpoint. An
exception to this rule is afforded for error responses.
Examples
========
We provide `Examples`_ to help get you started with a lot of the basic functionality of Stone.
Getting Help
============
If you find a bug, please see `CONTRIBUTING.md`_ for information on how to report it.
If you need help that is not specific to Stone, please reach out to `Dropbox Support`_.
License
=======
Stone is distributed under the MIT license, please see `LICENSE`_ for more information.
.. _logo: {logo_link}
.. _repo: https://github.com/dropbox/stone
.. _`Documentation`: https://github.com/dropbox/stone/tree/main/docs
.. _`Examples`: https://github.com/dropbox/stone/tree/main/example/backend
.. _LICENSE: https://github.com/dropbox/stone/blob/main/LICENSE
.. _CONTRIBUTING.md: https://github.com/dropbox/stone/blob/main/CONTRIBUTING.md
.. _`Dropbox Support`: https://www.dropbox.com/developers/contact
Raw data
{
"_id": null,
"home_page": "https://github.com/dropbox/stone",
"name": "stone",
"maintainer": "Dropbox",
"docs_url": null,
"requires_python": null,
"maintainer_email": "api-platform@dropbox.com",
"keywords": null,
"author": "Ken Elkabany",
"author_email": "kelkabany@dropbox.com",
"download_url": "https://files.pythonhosted.org/packages/96/5a/3807e5ceefaf5b6d71ffbe4cbecfa33f471331db0086a303e8225e0174fc/stone-3.3.7.tar.gz",
"platform": null,
"description": ".. image:: https://cfl.dropboxstatic.com/static/images/sdk/stone_banner.png\n :target: https://github.com/dropbox/stone\n\n.. image:: https://img.shields.io/pypi/pyversions/stone.svg\n :target: https://pypi.python.org/pypi/stone\n\n.. image:: https://img.shields.io/pypi/v/stone.svg\n :target: https://pypi.python.org/pypi/stone\n\n.. image:: https://codecov.io/gh/dropbox/stone/branch/main/graph/badge.svg\n :target: https://codecov.io/gh/dropbox/stone\n\nThe Official Api Spec Language for Dropbox.\n\n`Documentation`_ can be found on GitHub\n\nInstallation\n============\n\nInstall stone using ``pip``::\n\n $ pip install --user stone\n\nThis will install a script ``stone`` to your PATH that can be run from the\ncommand line::\n\n $ stone -h\n\nStone requires Python 3.\n\nAlternative\n-----------\n\nIf you choose not to install ``stone`` using the method above, you will need\nto ensure that you have the Python packages ``ply`` and ``six``, which can be\ninstalled through ``pip``::\n\n $ pip install \"ply>=3.4\" \"six>=1.3.0\" \"typing>=3.5.2\"\n\nIf the ``stone`` package is in your PYTHONPATH, you can replace ``stone``\nwith ``python -m stone.cli`` as follows::\n\n $ python -m stone.cli -h\n\nIf you have the ``stone`` package on your machine, but did not install it or\nadd its location to your PYTHONPATH, you can use the following::\n\n $ PYTHONPATH=path/to/stone python -m stone.cli -h\n\nAfter installation, follow one of our `Examples`_ or read the `Documentation`_.\n\n\nOverview\n========\n\nDefine an API once in Stone. Use backends, i.e. code generators, to translate\nyour specification into objects and functions in the programming languages of\nyour choice.\n\n* Introduction\n * Motivation_\n * Installation_\n* `Language Reference <https://github.com/dropbox/stone/blob/main/docs/lang_ref.rst>`_\n* `Builtin Backends <https://github.com/dropbox/stone/blob/main/docs/builtin_backends.rst>`_\n* `Managing Specs <https://github.com/dropbox/stone/blob/main/docs/managing_specs.rst>`_\n* `Evolving a Spec <https://github.com/dropbox/stone/blob/main/docs/evolve_spec.rst>`_\n* `Backend Reference <https://github.com/dropbox/stone/blob/main/docs/backend_ref.rst>`_\n* `JSON Serializer <https://github.com/dropbox/stone/blob/main/docs/json_serializer.rst>`_\n* `Network Protocol <https://github.com/dropbox/stone/blob/main/docs/network_protocol.rst>`_\n\n*Warning: The documentation is undergoing a rewrite.*\n\n.. image:: docs/overview.png\n\nStone is made up of several components:\n\nLanguage\n--------\n\nA language for writing API specifications, \"specs\" for short.\n\nCommand-Line Interface\n----------------------\n\nThe CLI (``stone``) generates code based on the provided specs, backend,\nand additional arguments.\n\nBackends\n--------\n\nThere are builtin backends that come with Stone: Javascript, Python, Obj-C,\nSwift, and Typescript.\n\nThere are other backends we've written that aren't part of the Stone package\nbecause they aren't sufficiently general, and can't realistically be re-used\nfor non-Dropbox APIs: Go and Java.\n\nStone includes a Python interface for defining new backends based on its\nintermediate representation of specs. This gives you the freedom to generate\nto any target.\n\nJSON Serialization\n------------------\n\nStone defines a JSON-compatible serialization scheme.\n\nMotivation\n==========\n\nStone was birthed at Dropbox at a time when it was becoming clear that API\ndevelopment needed to be scaled beyond a single team. The company was\nundergoing a large expansion in the number of product groups, and it wasn't\nscalable for the API team, which traditionally dealt with core file operations,\nto learn the intricacies of each product and build corresponding APIs.\n\nStone's chief goal is to decentralize API development and ownership at Dropbox.\nTo be successful, it needed to do several things:\n\n**Decouple APIs from SDKS**: Dropbox has first-party clients for our mobile\napps, desktop client, and website. Each of these is implemented in a different\nlanguage. Moreover, we wanted to continue providing SDKs to third-parties, over\nhalf of whom use our SDKs. It's untenable to ask product groups that build APIs\nto also implement these endpoints in a half-dozen different language-specific\nSDKs. Without decoupling, as was the case in our v1 API, the SDKs will\ninevitably fall behind. Our solution is to have our SDKs automatically\ngenerated.\n\n**Improve Visibility into our APIs**: These days, APIs aren't just in the\ndomain of engineering. Product managers, product specialists, partnerships,\nsales, and services groups all need to have clear and accurate specifications\nof our APIs. After all, APIs define Dropbox's data models and functionality.\nBefore Stone, API design documents obseleted by changes during implementation\nwere the source of truth.\n\n**Consistency and Predictability**: Consistency ranging from documentation\ntense to API patterns are important for making an API predictable and therefore\neasier to use. We needed an easy way to make and enforce patterns.\n\n**JSON**: To make consumption easier for third parties, we wanted our data\ntypes to map to JSON. For cases where serialization efficiency\n(space and time) are important, you can try using msgpack (alpha support\navailable in the Python generator). It's possible also to define your own\nserialization scheme, but at that point, you may consider using something like\n`Protobuf <https://github.com/google/protobuf>`_.\n\nStone is in active use for the `Dropbox v2 API\n<http://www.dropbox.com/developers>`_.\n\nAssumptions\n-----------\n\nStone makes no assumptions about the protocol layer being used to make API\nrequests and return responses; its first use case is the Dropbox v2 API which\noperates over HTTP. Stone does not come with nor enforce any particular RPC\nframework.\n\nStone makes some assumptions about the data types supported in target\nprogramming languages. It's assumed that there is a capacity for representing\ndictionaries (unordered string keys -> value), lists, numeric types, and\nstrings.\n\nStone assumes that a route (or API endpoint) can have its argument and\nresult types defined without relation to each other. In other words, the\ntype of response does not change based on the input to the endpoint. An\nexception to this rule is afforded for error responses.\n\nExamples\n========\n\nWe provide `Examples`_ to help get you started with a lot of the basic functionality of Stone.\n\nGetting Help\n============\n\nIf you find a bug, please see `CONTRIBUTING.md`_ for information on how to report it.\n\nIf you need help that is not specific to Stone, please reach out to `Dropbox Support`_.\n\nLicense\n=======\n\nStone is distributed under the MIT license, please see `LICENSE`_ for more information.\n\n.. _logo: {logo_link}\n.. _repo: https://github.com/dropbox/stone\n.. _`Documentation`: https://github.com/dropbox/stone/tree/main/docs\n.. _`Examples`: https://github.com/dropbox/stone/tree/main/example/backend\n.. _LICENSE: https://github.com/dropbox/stone/blob/main/LICENSE\n.. _CONTRIBUTING.md: https://github.com/dropbox/stone/blob/main/CONTRIBUTING.md\n.. _`Dropbox Support`: https://www.dropbox.com/developers/contact\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "Stone is an interface description language (IDL) for APIs.",
"version": "3.3.7",
"project_urls": {
"Homepage": "https://github.com/dropbox/stone"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "bd4f950765bc6d699eefe28ba6dff689042aa7fd1b4826e2d239815143336b1a",
"md5": "f885c3ed00de3cd91de8a608b485de3a",
"sha256": "6de5ed29b78ea6435775230bed0847703b4726aeeee66365bf6ad3c63334361b"
},
"downloads": -1,
"filename": "stone-3.3.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f885c3ed00de3cd91de8a608b485de3a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 158907,
"upload_time": "2024-07-16T21:26:05",
"upload_time_iso_8601": "2024-07-16T21:26:05.748863Z",
"url": "https://files.pythonhosted.org/packages/bd/4f/950765bc6d699eefe28ba6dff689042aa7fd1b4826e2d239815143336b1a/stone-3.3.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "965a3807e5ceefaf5b6d71ffbe4cbecfa33f471331db0086a303e8225e0174fc",
"md5": "f692053072830283f087a1afe3e0442e",
"sha256": "0b3c3969747aa9287ea660f88515700ab41d027e49daddd732f09858360ebfda"
},
"downloads": -1,
"filename": "stone-3.3.7.tar.gz",
"has_sig": false,
"md5_digest": "f692053072830283f087a1afe3e0442e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 189440,
"upload_time": "2024-07-16T21:26:07",
"upload_time_iso_8601": "2024-07-16T21:26:07.227080Z",
"url": "https://files.pythonhosted.org/packages/96/5a/3807e5ceefaf5b6d71ffbe4cbecfa33f471331db0086a303e8225e0174fc/stone-3.3.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-16 21:26:07",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "dropbox",
"github_project": "stone",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"requirements": [],
"tox": true,
"lcname": "stone"
}