Skip to main content
pyrx
====

[![Build Status](https://travis-ci.org/uniphil/pyrx.png)](https://travis-ci.org/uniphil/pyrx)

Python implementation of the [Rx schema and validation system](http://rx.codesimply.com/)


Forked
------

Forked from the main [rx github repo](https://github.com/rjbs/rx) Nov 25 '13
because the python implementation deserves its own place and testing and stuff.

The copyright line of the license for the rx repository reads:

The contents of the Rx repository are copyright (C) 2008, Ricardo SIGNES.

The license itself is GPL2: https://github.com/rjbs/rx/blob/master/LICENSE


Requirements
------------

* No external dependencies
* Python2.7 (python3 support coming soon)


Installation
------------

```bash
$ pip install pyrx
```


Usage
-----

```python
import pyrx

rx = pyrx.Factory({"register_core_types": True})

schema_src = {
"type": "//rec",
"required": {
"a": "//str",
"b": "//int",
},
"optional": {
"c": "//bool",
},
}

schema = rx.make_schema(schema_src)

schema.check({"a": "a string", "b": 2}) # returns True
schema.check({"a": "a string", "b": "another string"}) # returns False

```


Testing
-------

I didn't bring the tests over from the rx repo. They used `TAP` or something
I'm not familiar with. The tests included here just run through a couple
trivial cases to make sure it doesn't straight-up crash.

So, porting tests will be next up, and then porting to python3.

And then built-in support for files, both json and yaml. Maybe...

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PyRx-0.02.tar.gz (4.2 kB view details)

Uploaded Source

File details

Details for the file PyRx-0.02.tar.gz.

File metadata

  • Download URL: PyRx-0.02.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for PyRx-0.02.tar.gz
Algorithm Hash digest
SHA256 63b36bf4511690468d7be9fa0e0695e959182f782dc0498f0cc2264711a7148e
MD5 2b5f7792382508dccba33283cb98841b
BLAKE2b-256 5a2a7e73c92c1d9e321d61adb03fa134111ae1c4546e137a254b1c160d5d6f51

See more details on using hashes here.

Release history Release notifications | RSS feed

0.3.0

1 file

0.2.0

1 file

This release

0.02 This release

1 file

0.01

1 file

0.1.0

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page