Reference OParl Client implementation
Stefan Graupner 010c37ef67 Change versioning to just use the tag's value | 6 years ago | |
---|---|---|
examples | 7 years ago | |
po | 6 years ago | |
src | 6 years ago | |
test | 6 years ago | |
.gitignore | 7 years ago | |
LICENSE | 7 years ago | |
README.md | 6 years ago | |
meson.build | 6 years ago | |
meson_options.txt | 7 years ago | |
oparl-0.2.deps | 7 years ago |
You are laying eyes on liboparl. A client implementation of the OParl-1.0 specification. It's your easy way to access endpoints in a straightforward fashion.
The library's objective is to abstract OParls object format away from you. You as someone who develops an application for OParl does not need to know how to resolve the ids that objects yield to you and how to parse the objects themselves and check them for correctness.
The library does not want to interfere with your way to write programs which is why liboparl
leaves all non-OParl-related tasks to you. OParl exposes anything it needs from you through
signals and interfaces. For example, if liboparl wants to request a new object via HTTP, it
triggers the signal resolve_url
that belongs to the OParl.Client
-Object. This
signal gives you an url and expects to get a JSON-string back. You can implement this method
however you feel is right for your project. If you program liboparl in Python you could use
requests. If you program liboparl in Perl, you could use LWP. This also gives you the
possibility to handle multithreading as you wish. And the best thing: liboparl can provide
an API that is as clean and uncluttered as possible.
As mentioned before, liboparl is a GObject-based library. This means that you can use it in any programming language that supports GObject-Introspection. Famous examples are e.g. Python Ruby or Lua. Check if your favoured language is available at GObjectIntrospecion
The following libraries have to be present for liboparl to run:
Meson > 0.40.0 is used as the buildsystem for liboparl. The build dependencies are the following:
gobject-introspection
in ubuntu)Clone and build the library as follows:
git clone https://github.com/oparl/liboparl
cd liboparl
mkdir build
cd build
meson ..
ninja
If you desire to install the library, execute as root:
ninja install
liboparl supports GObject-Introspection which means you can consume it in various popular languages including but not limited to: Python, Perl, Lua, JS, PHP. I compiled some examples on how to program against the library in Python in the examples-folder.
Feel free to add examples for your favorite language.
Note: If you installed the library in /usr/local, you have to export the following environment variables for the examples to work:
export LD_LIBRARY_PATH=/usr/local/lib
export GI_TYPELIB_PATH=/usr/local/lib/girepository-1.0/