lexrpc


Namelexrpc JSON
Version 0.6 PyPI version JSON
download
home_page
SummaryPython implementation of AT Protocol's XRPC + Lexicon
upload_time2024-03-16 19:44:09
maintainer
docs_urlNone
author
requires_python>=3.7
license
keywords xrpc lexicon at protocol atp
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            lexrpc [![Circle CI](https://circleci.com/gh/snarfed/lexrpc.svg?style=svg)](https://circleci.com/gh/snarfed/lexrpc) [![Coverage Status](https://coveralls.io/repos/github/snarfed/lexrpc/badge.svg?branch=main)](https://coveralls.io/github/snarfed/lexrpc?branch=master)
===

Python implementation of [AT Protocol](https://atproto.com/)'s [XRPC](https://atproto.com/specs/xrpc) + [Lexicon](https://atproto.com/guides/lexicon). lexrpc includes a simple [XRPC](https://atproto.com/specs/xrpc) client, server, and [Flask](https://flask.palletsprojects.com/) web server integration. All three include full [Lexicon](https://atproto.com/guides/lexicon) support for validating inputs, outputs, and parameters against their schemas.

Install from [PyPI](https://pypi.org/project/lexrpc/) with `pip install lexrpc` or `pip install lexrpc[flask]`.

License: This project is placed in the public domain. You may also use it under the [CC0 License](https://creativecommons.org/publicdomain/zero/1.0/).

* [Client](#client)
* [Server](#server)
* [Flask server](#flask-server)
* [Reference docs](https://lexrpc.readthedocs.io/en/latest/source/lexrpc.html)
* [TODO](#todo)
* [Release instructions](#release-instructions)
* [Changelog](#changelog)


## Client

The lexrpc client let you [call methods dynamically by their NSIDs](https://atproto.com/guides/lexicon#rpc-methods). To make a call, first instantiate a [`Client`](https://lexrpc.readthedocs.io/en/latest/source/lexrpc.html#lexrpc.client.Client), then use NSIDs to make calls, passing input as a dict and parameters as kwargs. Here's an example of logging into the [official Bluesky PDS](https://bsky.app/) and fetching the user's timeline:

```py
from lexrpc import Client

client = Client()
session = client.com.atproto.server.createSession({
    'identifier': 'snarfed.bsky.social',
    'password': 'hunter2',
})
print('Logged in as', session['did'])

timeline = client.app.bsky.feed.getTimeline(limit=10)
print('First 10 posts:', json.dumps(timeline, indent=2))
```


By default, `Client` connects to the official `bsky.social` PDS and uses the [official lexicons](https://github.com/bluesky-social/atproto/tree/main/lexicons/) for `app.bsky` and `com.atproto`. You can connect to a different PDS or use custom lexicons by passing them to the `Client` constructor:

```py
lexicons = [
  {
    "lexicon": 1,
    "id": "com.example.my-procedure",
    "defs": ...
  },
  ...
]
client = Client('my.server.com', lexicons=lexicons)
output = client.com.example.my_procedure({'foo': 'bar'}, baz=5)
```

Note that `-` characters in method NSIDs are converted to `_`s, eg the call above is for the method `com.example.my-procedure`.

To call a method with non-JSON (eg binary) input, pass `bytes` to the call instead of a `dict`, and pass the content type with `headers={'Content-Type': '...'}`.

[Event stream methods](https://atproto.com/specs/event-stream) with type `subscription` are generators that `yield` (header, payload) tuples sent by the server. They take parameters as kwargs, but no positional `input`.

```py
for header, msg in client.com.example.count(start=1, end=10):
    print(header['t'])
    print(msg['num'])
```


## Server

To implement an XRPC server, use the [`Server`](https://lexrpc.readthedocs.io/en/latest/source/lexrpc.html#lexrpc.server.Server) class. It validates parameters, inputs, and outputs. Use the [`method`](https://lexrpc.readthedocs.io/en/latest/source/lexrpc.html#lexrpc.server.Server.method) decorator to register method handlers and [`call`](https://lexrpc.readthedocs.io/en/latest/source/lexrpc.html#lexrpc.server.Server.call) to call them, whether from your web framework or anywhere else.

```py
from lexrpc import Server

server = Server()

@server.method('com.example.my-query')
def my_query(input, num=None):
    output = {'foo': input['foo'], 'b': num + 1}
    return output

# Extract nsid and decode query parameters from an HTTP request,
# call the method, return the output in an HTTP response
nsid = request.path.removeprefix('/xrpc/')
input = request.json()
params = server.decode_params(nsid, request.query_params())
output = server.call(nsid, input, **params)
response.write_json(output)
```

You can also register a method handler with [`Server.register`](https://lexrpc.readthedocs.io/en/latest/source/lexrpc.html#lexrpc.server.Server.register):

```
server.register('com.example.my-query', my_query_handler)
```

As with `Client`, you can use custom lexicons by passing them to the `Server` constructor:

```
lexicons = [
  {
    "lexicon": 1,
    "id": "com.example.myQuery",
    "defs": ...
  },
  ...
]
server = Server(lexicons=lexicons)
```

[Event stream methods](https://atproto.com/specs/event-stream) with type `subscription` should be generators that `yield` frames to send to the client. [Each frame](https://atproto.com/specs/event-stream#framing) is a `(header dict, payload dict)` tuple that will be DAG-CBOR encoded and sent to the websocket client. Subscription methods take parameters as kwargs, but no positional `input`.

```
@server.method('com.example.count')
def count(start=None, end=None):
    for num in range(start, end):
        yield {'num': num}
```


## Flask server

To serve XRPC methods in a [Flask](https://flask.palletsprojects.com/) web app, first install the lexrpc package with the `flask` extra, eg `pip install lexrpc[flask]`. Then, instantiate a [`Server`](https://lexrpc.readthedocs.io/en/latest/source/lexrpc.html#lexrpc.server.Server) and register method handlers as described above. Finally, attach the server to your Flask app with [`flask_server.init_flask`](https://lexrpc.readthedocs.io/en/latest/source/lexrpc.html#lexrpc.flask_server.init_flask).

```py
from flask import Flask
from lexrpc.flask_server import init_flask

# instantiate a Server like above
server = ...

app = Flask('my-server')
init_flask(server, app)
```

This configures the Flask app to serve the methods registered with the lexrpc server [as per the spec](https://atproto.com/specs/xrpc#path). Each method is served at the path `/xrpc/[NSID]`, procedures via POSTs and queries via GETs. Parameters are decoded from query parameters, input is taken from the JSON HTTP request body, and output is returned in the JSON HTTP response body. The `Content-Type` response header is set to `application/json`.


## TODO

* schema validation for records


Release instructions
---
Here's how to package, test, and ship a new release.

1. Run the unit tests.

    ```sh
    source local/bin/activate.csh
    python3 -m unittest discover
    ```
1. Bump the version number in `pyproject.toml` and `docs/conf.py`. `git grep` the old version number to make sure it only appears in the changelog. Change the current changelog entry in `README.md` for this new version from _unreleased_ to the current date.
1. Build the docs. If you added any new modules, add them to the appropriate file(s) in `docs/source/`. Then run `./docs/build.sh`. Check that the generated HTML looks fine by opening `docs/_build/html/index.html` and looking around.
1. `git commit -am 'release vX.Y'`
1. Upload to [test.pypi.org](https://test.pypi.org/) for testing.

    ```sh
    python3 -m build
    setenv ver X.Y
    twine upload -r pypitest dist/lexrpc-$ver*
    ```
1. Install from test.pypi.org.

    ```sh
    cd /tmp
    python3 -m venv local
    source local/bin/activate.csh
    pip3 uninstall lexrpc # make sure we force pip to use the uploaded version
    pip3 install --upgrade pip
    pip3 install -i https://test.pypi.org/simple --extra-index-url https://pypi.org/simple lexrpc==$ver
    deactivate
    ```
1. Smoke test that the code trivially loads and runs.

    ```sh
    source local/bin/activate.csh
    python3
    # run test code below
    deactivate
    ```
    Test code to paste into the interpreter:

    ```py
    from lexrpc import Server

    server = Server(lexicons=[{
        'lexicon': 1,
        'id': 'io.example.ping',
        'defs': {
            'main': {
                'type': 'query',
                'description': 'Ping the server',
                'parameters': {'message': { 'type': 'string' }},
                'output': {
                    'encoding': 'application/json',
                    'schema': {
                        'type': 'object',
                        'required': ['message'],
                        'properties': {'message': { 'type': 'string' }},
                    },
                },
            },
        },
    }])

    @server.method('io.example.ping')
    def ping(input, message=''):
        return {'message': message}

    print(server.call('io.example.ping', {}, message='hello world'))
    ```
1. Tag the release in git. In the tag message editor, delete the generated comments at bottom, leave the first line blank (to omit the release "title" in github), put `### Notable changes` on the second line, then copy and paste this version's changelog contents below it.

    ```sh
    git tag -a v$ver --cleanup=verbatim
    git push && git push --tags
    ```
1. [Click here to draft a new release on GitHub.](https://github.com/snarfed/lexrpc/releases/new) Enter `vX.Y` in the _Tag version_ box. Leave _Release title_ empty. Copy `### Notable changes` and the changelog contents into the description text box.
1. Upload to [pypi.org](https://pypi.org/)!

    ```sh
    twine upload dist/lexrpc-$ver.tar.gz dist/lexrpc-$ver-py3-none-any.whl
    ```
1. [Wait for the docs to build on Read the Docs](https://readthedocs.org/projects/lexrpc/builds/), then check that they look ok.
1. On the [Versions page](https://readthedocs.org/projects/lexrpc/versions/), check that the new version is active, If it's not, activate it in the _Activate a Version_ section.


## Changelog

### 0.6 - 2024-03-16

* Drop `typing-extensions` version pin now that [typing-validation has been updated to be compatible with it](https://github.com/hashberg-io/typing-validation/issues/1).
* Update bundled `app.bsky` and `com.atproto` lexicons, as of [bluesky-social/atproto@50f209e](https://github.com/snarfed/atproto/commit/50f209e6507d8bfff20fb78eae1d3ec963e926de).

### 0.5 - 2023-12-10

* `Client`:
  * Support binary request data automatically based on input type, eg `dict` vs `bytes`.
  * Add new `headers` kwarg to `call` and auto-generated lexicon method calls, useful for providing an explicit `Content-Type` when sending binary data.
  * Bug fix: don't infinite loop if `refreshSession` fails.
  * Other minor authentication bug fixes.

### 0.4 - 2023-10-28

* Bundle [the official lexicons](https://github.com/bluesky-social/atproto/tree/main/lexicons/) for `app.bsky` and `com.atproto`, use them by default.
* `Base`:
  * Expose lexicons in `defs` attribute.
* `Client`:
  * Add minimal auth support with `access_token` and `refresh_token` constructor kwargs and `session` attribute. If you use a `Client` to call `com.atproto.server.createSession` or `com.atproto.server.refreshSession`, the returned tokens will be automatically stored and used in future requests.
  * Bug fix: handle trailing slash on server address, eg `http://ser.ver/` vs `http://ser.ver`.
  * Default server address to official `https://bsky.social` PDS.
  * Add default `User-Agent: lexrpc (https://lexrpc.readthedocs.io/)` request header.
* `Server`:
  * Add new `Redirect` class. Handlers can raise this to indicate that the web server should serve an HTTP redirect. [Whether this is official supported by the XRPC spec is still TBD.](https://github.com/bluesky-social/atproto/discussions/1228)
* `flask_server`:
  * Return HTTP 405 error on HTTP requests to subscription (websocket) XRPCs.
  * Support the new `Redirect` exception.
  * Add the `error` field to the JSON response bodies for most error responses.


### 0.3 - 2023-08-29

* Add array type support.
* Add support for non-JSON input and output encodings.
* Add `subscription` method type support over websockets.
* Add `headers` kwarg to `Client` constructor.
* Add new `Server.register` method for manually registering handlers.
* Bug fix for server `@method` decorator.


### 0.2 - 2023-03-13

Bluesky's Lexicon design and schema handling is still actively changing, so this is an interim release. It generally supports the current lexicon design, but not full schema validation yet. I'm not yet trying to fast follow the changes too closely; as they settle down and stabilize, I'll put more effort into matching and fully implementing them. Stay tuned!

_Breaking changes:_

* Fully migrate to [new lexicon format](https://github.com/snarfed/atproto/commit/63b9873bb1699b6bce54e7a8d3db2fcbd2cfc5ab). Original format is no longer supported.


### 0.1 - 2022-12-13

Initial release!

Tested interoperability with the `lexicon`, `xprc`, and `xrpc-server` packages in [bluesky-social/atproto](https://github.com/bluesky-social/atproto). Lexicon and XRPC themselves are still very early and under active development; caveat hacker!

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "lexrpc",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "XRPC,Lexicon,AT Protocol,ATP",
    "author": "",
    "author_email": "Ryan Barrett <lexrpc@ryanb.org>",
    "download_url": "https://files.pythonhosted.org/packages/58/d8/4d4d52467c063a04dea554c4ce2f3bb035a31016878574975030aa49932b/lexrpc-0.6.tar.gz",
    "platform": null,
    "description": "lexrpc [![Circle CI](https://circleci.com/gh/snarfed/lexrpc.svg?style=svg)](https://circleci.com/gh/snarfed/lexrpc) [![Coverage Status](https://coveralls.io/repos/github/snarfed/lexrpc/badge.svg?branch=main)](https://coveralls.io/github/snarfed/lexrpc?branch=master)\n===\n\nPython implementation of [AT Protocol](https://atproto.com/)'s [XRPC](https://atproto.com/specs/xrpc) + [Lexicon](https://atproto.com/guides/lexicon). lexrpc includes a simple [XRPC](https://atproto.com/specs/xrpc) client, server, and [Flask](https://flask.palletsprojects.com/) web server integration. All three include full [Lexicon](https://atproto.com/guides/lexicon) support for validating inputs, outputs, and parameters against their schemas.\n\nInstall from [PyPI](https://pypi.org/project/lexrpc/) with `pip install lexrpc` or `pip install lexrpc[flask]`.\n\nLicense: This project is placed in the public domain. You may also use it under the [CC0 License](https://creativecommons.org/publicdomain/zero/1.0/).\n\n* [Client](#client)\n* [Server](#server)\n* [Flask server](#flask-server)\n* [Reference docs](https://lexrpc.readthedocs.io/en/latest/source/lexrpc.html)\n* [TODO](#todo)\n* [Release instructions](#release-instructions)\n* [Changelog](#changelog)\n\n\n## Client\n\nThe lexrpc client let you [call methods dynamically by their NSIDs](https://atproto.com/guides/lexicon#rpc-methods). To make a call, first instantiate a [`Client`](https://lexrpc.readthedocs.io/en/latest/source/lexrpc.html#lexrpc.client.Client), then use NSIDs to make calls, passing input as a dict and parameters as kwargs. Here's an example of logging into the [official Bluesky PDS](https://bsky.app/) and fetching the user's timeline:\n\n```py\nfrom lexrpc import Client\n\nclient = Client()\nsession = client.com.atproto.server.createSession({\n    'identifier': 'snarfed.bsky.social',\n    'password': 'hunter2',\n})\nprint('Logged in as', session['did'])\n\ntimeline = client.app.bsky.feed.getTimeline(limit=10)\nprint('First 10 posts:', json.dumps(timeline, indent=2))\n```\n\n\nBy default, `Client` connects to the official `bsky.social` PDS and uses the [official lexicons](https://github.com/bluesky-social/atproto/tree/main/lexicons/) for `app.bsky` and `com.atproto`. You can connect to a different PDS or use custom lexicons by passing them to the `Client` constructor:\n\n```py\nlexicons = [\n  {\n    \"lexicon\": 1,\n    \"id\": \"com.example.my-procedure\",\n    \"defs\": ...\n  },\n  ...\n]\nclient = Client('my.server.com', lexicons=lexicons)\noutput = client.com.example.my_procedure({'foo': 'bar'}, baz=5)\n```\n\nNote that `-` characters in method NSIDs are converted to `_`s, eg the call above is for the method `com.example.my-procedure`.\n\nTo call a method with non-JSON (eg binary) input, pass `bytes` to the call instead of a `dict`, and pass the content type with `headers={'Content-Type': '...'}`.\n\n[Event stream methods](https://atproto.com/specs/event-stream) with type `subscription` are generators that `yield` (header, payload) tuples sent by the server. They take parameters as kwargs, but no positional `input`.\n\n```py\nfor header, msg in client.com.example.count(start=1, end=10):\n    print(header['t'])\n    print(msg['num'])\n```\n\n\n## Server\n\nTo implement an XRPC server, use the [`Server`](https://lexrpc.readthedocs.io/en/latest/source/lexrpc.html#lexrpc.server.Server) class. It validates parameters, inputs, and outputs. Use the [`method`](https://lexrpc.readthedocs.io/en/latest/source/lexrpc.html#lexrpc.server.Server.method) decorator to register method handlers and [`call`](https://lexrpc.readthedocs.io/en/latest/source/lexrpc.html#lexrpc.server.Server.call) to call them, whether from your web framework or anywhere else.\n\n```py\nfrom lexrpc import Server\n\nserver = Server()\n\n@server.method('com.example.my-query')\ndef my_query(input, num=None):\n    output = {'foo': input['foo'], 'b': num + 1}\n    return output\n\n# Extract nsid and decode query parameters from an HTTP request,\n# call the method, return the output in an HTTP response\nnsid = request.path.removeprefix('/xrpc/')\ninput = request.json()\nparams = server.decode_params(nsid, request.query_params())\noutput = server.call(nsid, input, **params)\nresponse.write_json(output)\n```\n\nYou can also register a method handler with [`Server.register`](https://lexrpc.readthedocs.io/en/latest/source/lexrpc.html#lexrpc.server.Server.register):\n\n```\nserver.register('com.example.my-query', my_query_handler)\n```\n\nAs with `Client`, you can use custom lexicons by passing them to the `Server` constructor:\n\n```\nlexicons = [\n  {\n    \"lexicon\": 1,\n    \"id\": \"com.example.myQuery\",\n    \"defs\": ...\n  },\n  ...\n]\nserver = Server(lexicons=lexicons)\n```\n\n[Event stream methods](https://atproto.com/specs/event-stream) with type `subscription` should be generators that `yield` frames to send to the client. [Each frame](https://atproto.com/specs/event-stream#framing) is a `(header dict, payload dict)` tuple that will be DAG-CBOR encoded and sent to the websocket client. Subscription methods take parameters as kwargs, but no positional `input`.\n\n```\n@server.method('com.example.count')\ndef count(start=None, end=None):\n    for num in range(start, end):\n        yield {'num': num}\n```\n\n\n## Flask server\n\nTo serve XRPC methods in a [Flask](https://flask.palletsprojects.com/) web app, first install the lexrpc package with the `flask` extra, eg `pip install lexrpc[flask]`. Then, instantiate a [`Server`](https://lexrpc.readthedocs.io/en/latest/source/lexrpc.html#lexrpc.server.Server) and register method handlers as described above. Finally, attach the server to your Flask app with [`flask_server.init_flask`](https://lexrpc.readthedocs.io/en/latest/source/lexrpc.html#lexrpc.flask_server.init_flask).\n\n```py\nfrom flask import Flask\nfrom lexrpc.flask_server import init_flask\n\n# instantiate a Server like above\nserver = ...\n\napp = Flask('my-server')\ninit_flask(server, app)\n```\n\nThis configures the Flask app to serve the methods registered with the lexrpc server [as per the spec](https://atproto.com/specs/xrpc#path). Each method is served at the path `/xrpc/[NSID]`, procedures via POSTs and queries via GETs. Parameters are decoded from query parameters, input is taken from the JSON HTTP request body, and output is returned in the JSON HTTP response body. The `Content-Type` response header is set to `application/json`.\n\n\n## TODO\n\n* schema validation for records\n\n\nRelease instructions\n---\nHere's how to package, test, and ship a new release.\n\n1. Run the unit tests.\n\n    ```sh\n    source local/bin/activate.csh\n    python3 -m unittest discover\n    ```\n1. Bump the version number in `pyproject.toml` and `docs/conf.py`. `git grep` the old version number to make sure it only appears in the changelog. Change the current changelog entry in `README.md` for this new version from _unreleased_ to the current date.\n1. Build the docs. If you added any new modules, add them to the appropriate file(s) in `docs/source/`. Then run `./docs/build.sh`. Check that the generated HTML looks fine by opening `docs/_build/html/index.html` and looking around.\n1. `git commit -am 'release vX.Y'`\n1. Upload to [test.pypi.org](https://test.pypi.org/) for testing.\n\n    ```sh\n    python3 -m build\n    setenv ver X.Y\n    twine upload -r pypitest dist/lexrpc-$ver*\n    ```\n1. Install from test.pypi.org.\n\n    ```sh\n    cd /tmp\n    python3 -m venv local\n    source local/bin/activate.csh\n    pip3 uninstall lexrpc # make sure we force pip to use the uploaded version\n    pip3 install --upgrade pip\n    pip3 install -i https://test.pypi.org/simple --extra-index-url https://pypi.org/simple lexrpc==$ver\n    deactivate\n    ```\n1. Smoke test that the code trivially loads and runs.\n\n    ```sh\n    source local/bin/activate.csh\n    python3\n    # run test code below\n    deactivate\n    ```\n    Test code to paste into the interpreter:\n\n    ```py\n    from lexrpc import Server\n\n    server = Server(lexicons=[{\n        'lexicon': 1,\n        'id': 'io.example.ping',\n        'defs': {\n            'main': {\n                'type': 'query',\n                'description': 'Ping the server',\n                'parameters': {'message': { 'type': 'string' }},\n                'output': {\n                    'encoding': 'application/json',\n                    'schema': {\n                        'type': 'object',\n                        'required': ['message'],\n                        'properties': {'message': { 'type': 'string' }},\n                    },\n                },\n            },\n        },\n    }])\n\n    @server.method('io.example.ping')\n    def ping(input, message=''):\n        return {'message': message}\n\n    print(server.call('io.example.ping', {}, message='hello world'))\n    ```\n1. Tag the release in git. In the tag message editor, delete the generated comments at bottom, leave the first line blank (to omit the release \"title\" in github), put `### Notable changes` on the second line, then copy and paste this version's changelog contents below it.\n\n    ```sh\n    git tag -a v$ver --cleanup=verbatim\n    git push && git push --tags\n    ```\n1. [Click here to draft a new release on GitHub.](https://github.com/snarfed/lexrpc/releases/new) Enter `vX.Y` in the _Tag version_ box. Leave _Release title_ empty. Copy `### Notable changes` and the changelog contents into the description text box.\n1. Upload to [pypi.org](https://pypi.org/)!\n\n    ```sh\n    twine upload dist/lexrpc-$ver.tar.gz dist/lexrpc-$ver-py3-none-any.whl\n    ```\n1. [Wait for the docs to build on Read the Docs](https://readthedocs.org/projects/lexrpc/builds/), then check that they look ok.\n1. On the [Versions page](https://readthedocs.org/projects/lexrpc/versions/), check that the new version is active, If it's not, activate it in the _Activate a Version_ section.\n\n\n## Changelog\n\n### 0.6 - 2024-03-16\n\n* Drop `typing-extensions` version pin now that [typing-validation has been updated to be compatible with it](https://github.com/hashberg-io/typing-validation/issues/1).\n* Update bundled `app.bsky` and `com.atproto` lexicons, as of [bluesky-social/atproto@50f209e](https://github.com/snarfed/atproto/commit/50f209e6507d8bfff20fb78eae1d3ec963e926de).\n\n### 0.5 - 2023-12-10\n\n* `Client`:\n  * Support binary request data automatically based on input type, eg `dict` vs `bytes`.\n  * Add new `headers` kwarg to `call` and auto-generated lexicon method calls, useful for providing an explicit `Content-Type` when sending binary data.\n  * Bug fix: don't infinite loop if `refreshSession` fails.\n  * Other minor authentication bug fixes.\n\n### 0.4 - 2023-10-28\n\n* Bundle [the official lexicons](https://github.com/bluesky-social/atproto/tree/main/lexicons/) for `app.bsky` and `com.atproto`, use them by default.\n* `Base`:\n  * Expose lexicons in `defs` attribute.\n* `Client`:\n  * Add minimal auth support with `access_token` and `refresh_token` constructor kwargs and `session` attribute. If you use a `Client` to call `com.atproto.server.createSession` or `com.atproto.server.refreshSession`, the returned tokens will be automatically stored and used in future requests.\n  * Bug fix: handle trailing slash on server address, eg `http://ser.ver/` vs `http://ser.ver`.\n  * Default server address to official `https://bsky.social` PDS.\n  * Add default `User-Agent: lexrpc (https://lexrpc.readthedocs.io/)` request header.\n* `Server`:\n  * Add new `Redirect` class. Handlers can raise this to indicate that the web server should serve an HTTP redirect. [Whether this is official supported by the XRPC spec is still TBD.](https://github.com/bluesky-social/atproto/discussions/1228)\n* `flask_server`:\n  * Return HTTP 405 error on HTTP requests to subscription (websocket) XRPCs.\n  * Support the new `Redirect` exception.\n  * Add the `error` field to the JSON response bodies for most error responses.\n\n\n### 0.3 - 2023-08-29\n\n* Add array type support.\n* Add support for non-JSON input and output encodings.\n* Add `subscription` method type support over websockets.\n* Add `headers` kwarg to `Client` constructor.\n* Add new `Server.register` method for manually registering handlers.\n* Bug fix for server `@method` decorator.\n\n\n### 0.2 - 2023-03-13\n\nBluesky's Lexicon design and schema handling is still actively changing, so this is an interim release. It generally supports the current lexicon design, but not full schema validation yet. I'm not yet trying to fast follow the changes too closely; as they settle down and stabilize, I'll put more effort into matching and fully implementing them. Stay tuned!\n\n_Breaking changes:_\n\n* Fully migrate to [new lexicon format](https://github.com/snarfed/atproto/commit/63b9873bb1699b6bce54e7a8d3db2fcbd2cfc5ab). Original format is no longer supported.\n\n\n### 0.1 - 2022-12-13\n\nInitial release!\n\nTested interoperability with the `lexicon`, `xprc`, and `xrpc-server` packages in [bluesky-social/atproto](https://github.com/bluesky-social/atproto). Lexicon and XRPC themselves are still very early and under active development; caveat hacker!\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Python implementation of AT Protocol's XRPC + Lexicon",
    "version": "0.6",
    "project_urls": {
        "Documentation": "https://lexrpc.readthedocs.io/",
        "Homepage": "https://github.com/snarfed/lexrpc"
    },
    "split_keywords": [
        "xrpc",
        "lexicon",
        "at protocol",
        "atp"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "941fe83f008f9ec45c7d7919eb7b92bfead8489decf918bdfa679e41dbb9279c",
                "md5": "59ffcfa0587bd74ad9b36b903a1bf77a",
                "sha256": "93f71a2764316fee1c65a010b75ada851e9652d953709b2b0c5d9d22beb3f7a7"
            },
            "downloads": -1,
            "filename": "lexrpc-0.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "59ffcfa0587bd74ad9b36b903a1bf77a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 99992,
            "upload_time": "2024-03-16T19:44:07",
            "upload_time_iso_8601": "2024-03-16T19:44:07.156975Z",
            "url": "https://files.pythonhosted.org/packages/94/1f/e83f008f9ec45c7d7919eb7b92bfead8489decf918bdfa679e41dbb9279c/lexrpc-0.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "58d84d4d52467c063a04dea554c4ce2f3bb035a31016878574975030aa49932b",
                "md5": "af0fdee520dc706b387a5eafafb125d0",
                "sha256": "6154ba199f768b6b3387d0c083f9e6833eedb6df3e09b5da16de349c9c678369"
            },
            "downloads": -1,
            "filename": "lexrpc-0.6.tar.gz",
            "has_sig": false,
            "md5_digest": "af0fdee520dc706b387a5eafafb125d0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 46327,
            "upload_time": "2024-03-16T19:44:09",
            "upload_time_iso_8601": "2024-03-16T19:44:09.188397Z",
            "url": "https://files.pythonhosted.org/packages/58/d8/4d4d52467c063a04dea554c4ce2f3bb035a31016878574975030aa49932b/lexrpc-0.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-16 19:44:09",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "snarfed",
    "github_project": "lexrpc",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "circle": true,
    "lcname": "lexrpc"
}
        
Elapsed time: 0.21567s