{"id":31929507,"url":"https://github.com/sandtreader/obtools","last_synced_at":"2025-10-14T03:24:46.965Z","repository":{"id":152438512,"uuid":"282001202","full_name":"sandtreader/obtools","owner":"sandtreader","description":"C++ utility libraries for high-performance Unix servers and applications","archived":false,"fork":false,"pushed_at":"2025-07-03T11:01:07.000Z","size":3941,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-03T12:19:36.094Z","etag":null,"topics":["crypto","http","http-client","http-server","json","lexer","library","logging","multi-threading","mysql","portability","postgresql","sqlite","ssl","strings","threads","time","xml"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sandtreader.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-07-23T16:22:52.000Z","updated_at":"2025-07-03T11:01:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"e567aaa7-6dcb-49ed-99bc-6abe1dedf97f","html_url":"https://github.com/sandtreader/obtools","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/sandtreader/obtools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandtreader%2Fobtools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandtreader%2Fobtools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandtreader%2Fobtools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandtreader%2Fobtools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sandtreader","download_url":"https://codeload.github.com/sandtreader/obtools/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sandtreader%2Fobtools/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017786,"owners_count":26086144,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crypto","http","http-client","http-server","json","lexer","library","logging","multi-threading","mysql","portability","postgresql","sqlite","ssl","strings","threads","time","xml"],"created_at":"2025-10-14T03:24:41.786Z","updated_at":"2025-10-14T03:24:46.960Z","avatar_url":"https://github.com/sandtreader.png","language":"C++","readme":"# ObTools\nC++ utility libraries for high-performance Unix servers \u0026 applications.\n\nThese libraries were started in 2003 by Paul Clark\n([@sandtreader](https://github.com/sandtreader)) as a common platform\nfor use across multiple consultancy projects.  They became the\nfoundation of [Packet Ship](https://packetship.com)'s streaming media\nproducts, a custom digital coin architecture, an e-commerce retail\noffering and more recently the [ViGraph](https://vigraph.com) creative\nmedia platform.\n\nAlex Woods and Jon Barber of Packet Ship also contributed significant\nnew functionality between 2010 and 2020.\n\nIn 2020, Paul made ObTools Open Source under a permissive MIT licence.\n\n## Functionality\n\nThe libraries (`obtools/libs`) include:\n\n* XML parser\n* JSON parser/writer with CBOR encoder\n* Multithreading support\n* Crypto sugaring over OpenSSL\n* Common database interface for MySQL/MariaDB, PostgreSQL and SQLite\n* Multi-channel binary protocol/file packer/unpacker\n* IP networking and SSL\n* HTTP clients and servers\n* SOAP clients and servers\n* Framework for Linux daemons\n* Timestamp manipulation\n* Logging\n* ... and lots of other handy stuff\n\nXMLMesh (`obtools/xmlmesh`) is an XML-based publish-subscribe system\nwith clients / bindings for C, C++, PHP, Perl and Javascript.\n\nThe tools in `obtools/obcache` and `obtools/tools` should be\nconsidered an early experiment in automated ORM code generation in C++\ndirect from XMI.  If you don't know what that is, it's unlikely you\nwill need it 😀\n\n## Building\n\nThe libraries are in portable C++14 (using `clang`), primarily\ndesigned for Linux and use [Tup](http://gittup.org/tup/) to build.  A\ncross-compilation to Windows using MinGW is also possible.  Native\nbuild on MacOS has worked in the past, and could probably easily be\nadded again, but isn't currently supported.  Compilation to JavaScript\nthrough emscripten is a Work In Progress!\n\nThe libraries also have a basic Makefile, which may simplify your CI system.\n\n### Dependencies\n\nTo build ObTools you'll need the following packages on top of the standard Ubuntu 20.04 or Debian 10 install:\n\n       $ sudo apt install build-essential tup clang git pkg-config debhelper dh-exec\n       $ sudo apt install libssl-dev libsqlite3-dev libmysqlclient-dev libpq-dev libnl-genl-3-dev\n\nIf using another or older distribution which doesn't have Tup, you can build it yourself from the [Tup sources](http://gittup.org/tup/).  Why Tup?  It's blindingly fast and intelligent - I used to have a set of arcane [recursive Makefiles](https://www.cse.iitb.ac.in/~soumen/teach/1999.2A.CS699/make.html) which took ages and you could never quite trust for deep library changes - not any more!\n\nIf you have a newer distribution with MariaDB instead of MySql, you'll need `libmariadb-dev-compat` instead of `libmysqlclient-dev` in the above.\n\n### Installing gtest\n\nThe unit tests in ObTools use GTest, which you need to build yourself:\n\n        $ sudo apt install libgtest-dev cmake\n        $ cd /usr/src/gtest\n        $ sudo cmake CMakeLists.txt\n        $ sudo make\n        $ sudo cp lib/*.a /usr/lib/\n\n### How to build debug versions (with automated tests):\n\n1. Clone this repo, e.g.\n\n        $ git clone git@github.com:sandtreader/obtools.git\n\n2. Initialise debug build\n\n        $ cd obtools\n        $ build/init.sh -t debug\n\n3. Build it\n\n        $ tup\n\nThat gives you debug static libraries (.a) in the `build-debug/libs` directories (see note below).\n\n### How to build release versions\n\n1. Clone this repo, e.g.\n\n        $ git clone git@github.com:sandtreader/obtools.git\n\n2. Initialise release build\n\n        $ cd obtools\n        $ build/init.sh -t release\n\n    (ignore the warning about tup database already existing)\n\n3. Build it\n\n        $ tup\n\n(you can combine the two and build both together if you want)\n\nThis gives you release static libraries in `build-release/libs`, plus XMLMesh executables and Debian packages (if building on Debian/Ubuntu) in `build-release/xmlmesh`.\n\n### Simple library release build with make\n\n1. Clone this repo, e.g.\n\n        $ git clone git@github.com:sandtreader/obtools.git\n\n2. Make the libraries\n\n        $ cd obtools/libs\n        $ make\n\nThis will give you libraries (`ot-xxx.a`) in `libs/build/lib`\nand headers (`ot-xxx.h`) in `libs/build/include`.\n\n## Using\n\nThe build only produces individual static libraries (`.a`) rather than\na combined dynamic library (`.so`).  This is deliberate - the\nlibraries are small enough to not worry too much about duplicated code\nsize, are heavily reliant on templating, and I don't want the pain of\nmaintaining a binary-compatible API!\n\nThe simplest way to use the libraries is within the same build\nsystem - see the Tupfile in `xmlmesh/server` for an example.  You just\nhave to name the libraries you are directly dependent on - further\ndependencies within the libraries are handled automagically.\n\nIf you're using it in a separate project, you probably want to make\nObTools a sub-module, then run `obtools/build/init.sh/` at your\ntop-level.  You'll need to provide a `Tuppath.lua` at the top level to\ndirect the build system to the right paths for both the ObTools\nlibraries and any of your own which are used as dependencies.  You'll\nprobably want to grab ObTools' `.gitignore` too.\n\n       $ cd myproject\n       $ git submodule add git@github.com:sandtreader/obtools.git\n       $ vi Tuppath.lua\n\n       function get_dependency_path(name)\n         if name == 'ot-xmlmesh-core' then\n           return 'obtools/xmlmesh/core'\n         elseif name == 'ot-xmlmesh-send' then\n           return 'obtools/xmlmesh/bindings/cli/send'\n         elseif name == 'ot-xmlmesh-receive' then\n           return 'obtools/xmlmesh/bindings/cli/receive'\n         elseif string.sub(name, 1, 11) == 'ot-xmlmesh-' then\n           return 'obtools/xmlmesh/' .. string.sub(name, 12)\n         elseif name == 'ot-toolgen' then\n           return 'obtools/tools/toolgen'\n         elseif string.sub(name, 1, 11) == 'ot-obcache-' then\n           return 'obtools/obcache/libs/' .. string.sub(name, 12)\n         elseif string.sub(name, 1, 3) == 'ot-' then\n           return 'obtools/libs/' .. string.sub(name, 4)\n\n         -- Add your own name to path matches here --\n\n         end\n         return nil\n       end\n\n       $ obtools/build/init.sh -t debug\n       $ tup\n          --- should build successfully! ---\n       $ cp obtools/.gitignore .\n       $ git add .gitignore Tuppath.lua\n\nYou can see this all in operation in the [ViGraph server\nsource](https://github.com/vigraph/vg-server)\n\nIf you want to use the libraries in your own build system, you'll need\nto explicitly link with the individual `ot-xxx.a`'s from\n`build-debug/libs/xxx` or `build-release/libs/xxx`, and include the\n`ot-xxx.h` header files from each library.  The Tupfiles in each\nlibrary say what other libraries it depends on.\n\n## Contributions\n\nYes please!\n\nIf it's a bug-fix, test or tidy, please just go ahead and send a PR.  If it's anything major, please discuss it with me first...\n\nI ask all contributors to sign a standard, FSF-approved [Contributor License Agreement](http://contributoragreements.org/) to make the project easier to manage.  You can sign it when you generate a PR, or in advance [here](https://cla-assistant.io/sandtreader/obtools).  \n\nThanks!\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsandtreader%2Fobtools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsandtreader%2Fobtools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsandtreader%2Fobtools/lists"}