Generated by GPT-5-mini| jansson | |
|---|---|
| Name | Jansson |
| Title | Jansson |
| Developer | Mikael Sundell |
| Released | 2007 |
| Latest release version | 2.14 |
| Operating system | Cross-platform |
| Genre | Library |
| License | MIT License |
jansson
Jansson is a C library for encoding, decoding, and manipulating JSON data. It provides a compact API for parsing, generating, and traversing JSON structures and is used in projects that interoperate with systems like Linux, FreeBSD, NetBSD, OpenBSD, macOS, and Windows. The library is integrated into many tooling ecosystems, including build systems and package managers such as Autotools, CMake, Debian, Fedora, Homebrew, and vcpkg.
Jansson implements a JSON parser and generator written in C (programming language), offering an API that maps JSON types to native C constructs. It emphasizes simplicity and small footprint suitable for embedding in applications like curl, systemd, nginx, postgresql, redis, and libreoffice. The library is often compared with other JSON libraries such as jansson alternative (note: placeholder), cJSON, RapidJSON, JSON-C, yajl, and jsmn in contexts where integration with projects like GCC, LLVM, GNOME, KDE, and Qt (software) is relevant.
Development began in the mid-2000s by Mikael Sundell during work on projects interfacing with RESTful API services and data interchange with JavaScript, Python (programming language), Ruby (programming language), and Perl. Early adoption occurred in systems maintained by organizations such as Mozilla Foundation, Red Hat, Canonical (company), SUSE, and Oracle Corporation. Over time, contributions were made by developers affiliated with GitHub, GitLab, SourceForge, and large open-source initiatives including Debian Project and The FreeBSD Project. Release management has followed patterns seen in projects like Linux kernel and Glibc with semantic versioning and community-driven issue triage via platforms such as GitHub.
The library exposes functions to create, modify, and serialize JSON values corresponding to objects, arrays, strings, numbers, booleans, and null. Internally it uses reference counting similar to strategies used in GLib and memory management patterns familiar to developers of SQLite and OpenSSL. Parsing follows a streaming model comparable to YAJL while offering convenience functions akin to APIs in RapidJSON and cJSON. The architecture supports UTF-8 handling in line with recommendations from Unicode and integrates with internationalization systems used by GTK+ and Qt (software) applications. Error reporting and diagnostics are influenced by conventions in POSIX and ISO C standards, and build integration provides compatibility with toolchains like GCC, Clang, and Microsoft Visual C++
Typical usage patterns appear in server-side components for NGINX, client libraries for libcurl, and utilities packaged for distributions such as Ubuntu, CentOS, and Arch Linux. Common examples include parsing API responses from services like GitHub, Twitter, Stripe (company), and Google Cloud Platform; serializing configuration for systemd units or Docker images; and transforming payloads consumed by Node.js bridges or Python bindings. Code snippets demonstrate creating objects, appending arrays, and serializing to compact or pretty-printed output compatible with consumers such as Logstash, Elasticsearch, Kibana, Prometheus, and Grafana.
Bindings and wrappers exist to expose functionality to higher-level languages including Python (programming language), Ruby (programming language), Lua (programming language), Perl, Haskell, Rust (programming language), Go (programming language), and Node.js. The C API is organized around functions for loading and dumping JSON, reference management, and type-specific accessors, comparable to interfaces offered by libxml2 and openssl libraries. Integration examples show use in projects leveraging build ecosystems like Autotools, CMake, and package repositories such as PyPI, Rubygems, and NPM.
The library is released under the MIT License, permitting use in both proprietary and open-source software, similar to licensing choices by projects such as SQLite and zlib. Distribution channels include source hosting on platforms like GitHub and packaged binaries in distributions maintained by Debian Project, Fedora Project, OpenBSD Project, and Homebrew. Corporate users and contributors follow contribution workflows akin to those in Linux Foundation projects, with issue tracking and pull requests processed through GitHub or GitLab repositories.
Category:JSON libraries