Skip to main content
Pypi Package Version Supported Python Versions Documentation Status Coverage Status https://github.com/aurzenligl/prophy/workflows/test/badge.svg

Prophy is a statically typed, binary, tag-free, unpacked serialization protocol.

You can define message schema:

struct MyMsg
{
    u16 x<>;
};

generate codecs for chosen languages:

prophyc --python_out . --cpp_full_out . --cpp_out . test.prophy

and serialize data in Python:

>>> import test
>>> msg = test.MyMsg()
>>> msg.x[:] = [1, 2, 3]
>>> msg.encode('<')
'\x03\x00\x00\x00\x01\x00\x02\x00\x03\x00\x00\x00'
>>> print msg
x: 1
x: 2
x: 3

in C++:

#include <iostream>
#include <iterator>
#include "test.ppf.hpp"

int main()
{
    prophy::generated::MyMsg msg{{1, 2, 3}};
    std::vector<uint8_t> data = msg.encode();
    std::copy(data.begin(), data.end(), std::ostream_iterator<unsigned>(std::cout, " "));
    std::cout << '\n' << msg.print();
    return 0;
}
3 0 0 0 1 0 2 0 3 0 0 0
x: 1
x: 2
x: 3

again in C++ (half hand-rolled, compiler-dependent, but fastest option):

#include <iostream>
#include <iterator>
#include <cstdlib>
#include "test.pp.hpp"

int main()
{
    MyMsg* msg = static_cast<MyMsg*>(std::malloc(12));
    msg->num_of_x = 3;
    msg->x[0] = 1;
    msg->x[1] = 2;
    msg->x[2] = 3;
    std::copy((uint8_t*)msg, ((uint8_t*)msg) + 12, std::ostream_iterator<unsigned>(std::cout, " "));
    std::cout << '\n';
    return 0;
}
3 0 0 0 1 0 2 0 3 0 0 0

Documentation: http://prophy.readthedocs.org

Issues: https://github.com/aurzenligl/prophy/issues

Release files for prophy 1.2.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for prophy 1.2.5
File Size Uploaded
prophy-1.2.5.tar.gz 178.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for prophy 1.2.5
File Interpreter ABI Platform
prophy-1.2.5-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 256.7 kB

Release files / prophy-1.2.5.tar.gz

Download URL prophy-1.2.5.tar.gz
Size 178.5 kB
Tags Source
SHA-256 checksum
How to use checksums
89a72102998eade68903270b0077167644861823ace8f03dc3204abb52b53474
BLAKE2b-256 checksum
How to use checksums
f10d28bdef9e28f4df58b2f45c15d45db88900bdd740f88c5bead7453764ca3b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

Release files / prophy-1.2.5-py2.py3-none-any.whl

Download URL prophy-1.2.5-py2.py3-none-any.whl
Size 78.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
40d93f1a7e249a8ffec2a5cba948d8d858e0532e65b5e4b78bdc5764485f1176
BLAKE2b-256 checksum
How to use checksums
5485b816fd36b4e7ce07cc30055bbc28ca8447b4af3dc7927eaf33c781d74fd8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

Release history Release notifications | RSS feed

This release

1.2.5 This release

2 release files

1.2.4

1 release file

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.8

1 release file

0.7.8

1 release file

0.7.7

1 release file

0.7.6

1 release file

0.7.5

1 release file

0.7.4

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7

2 release files

0.6

2 release files

0.5.1

2 release files

0.5

2 release files

0.4.2

2 release files

0.4.1

1 release file

0.4

1 release file

0.3

1 release file

0.2.5

1 release file

0.2.4

1 release 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