{"id":15050626,"url":"https://github.com/guardian/nitf-scala","last_synced_at":"2025-05-16T05:30:36.979Z","repository":{"id":57724787,"uuid":"123607116","full_name":"guardian/nitf-scala","owner":"guardian","description":"Scala library to parse and generate News Industry Text Format files","archived":true,"fork":false,"pushed_at":"2025-01-08T12:32:36.000Z","size":256,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":47,"default_branch":"master","last_synced_at":"2025-05-11T19:46:49.124Z","etag":null,"topics":["nitf","production","scala","xml-generator","xml-parser"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/guardian.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-02T17:06:24.000Z","updated_at":"2025-01-15T10:43:40.000Z","dependencies_parsed_at":"2023-01-19T19:02:51.295Z","dependency_job_id":null,"html_url":"https://github.com/guardian/nitf-scala","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guardian%2Fnitf-scala","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guardian%2Fnitf-scala/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guardian%2Fnitf-scala/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guardian%2Fnitf-scala/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guardian","download_url":"https://codeload.github.com/guardian/nitf-scala/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254473722,"owners_count":22077159,"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","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":["nitf","production","scala","xml-generator","xml-parser"],"created_at":"2024-09-24T21:28:11.819Z","updated_at":"2025-05-16T05:30:36.323Z","avatar_url":"https://github.com/guardian.png","language":"Scala","readme":"# nitf-scala\n[![License: Apache-2.0](https://img.shields.io/github/license/guardian/nitf-scala.svg)](https://github.com/guardian/nitf-scala/blob/master/LICENSE)\n[![Build Status](https://travis-ci.org/guardian/nitf-scala.svg?branch=master)](https://travis-ci.org/guardian/nitf-scala)\n[![Codacy Quality Rating](https://api.codacy.com/project/badge/Grade/a7f65308a2dd4f38ada2c53234194076)](https://www.codacy.com/app/hosamaly/nitf-scala?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=guardian/nitf-scala\u0026amp;utm_campaign=Badge_Grade)\n[![Latest release for Scala 2.11](https://img.shields.io/maven-metadata/v/http/central.maven.org/maven2/com/gu/nitf-scala_2.11/maven-metadata.xml.svg?label=scala%202.11)](https://mvnrepository.com/artifact/com.gu/nitf-scala)\n[![Latest release for Scala 2.12](https://img.shields.io/maven-metadata/v/http/central.maven.org/maven2/com/gu/nitf-scala_2.12/maven-metadata.xml.svg?label=scala%202.12)](https://mvnrepository.com/artifact/com.gu/nitf-scala)\n\nScala library to parse and generate [News Industry Text Format](https://iptc.org/standards/nitf/) files,\nbased on [ScalaXB](http://scalaxb.org).\n\nThis library supports versions 3.3 to 3.6.  \n(Previous versions don't have an XSD.)\n\n## Usage\n\nTo use this library, add the following dependencies to your project:\n```scala\nval nitfScalaVersion = \"3.6.2\"  // one of 3.3, 3.4, 3.5, and 3.6 followed by the release version\nval scalaXmlVersion = \"1.1.0\"\nlibraryDependencies ++= Seq(\n  \"org.scala-lang.modules\" %% \"scala-xml\" % scalaXmlVersion,\n  \"org.scala-lang.modules\" %% \"scala-parser-combinators\" % scalaXmlVersion,\n  \"com.gu\" %% \"nitf-scala\" % nitfScalaVersion\n)\n```\n\nThis is an example of how to parse XML into NITF:\n```scala\nimport com.gu.nitf.model._\nimport com.gu.nitf.scalaxb._\n\nval doc = scalaxb.fromXML[Nitf](\n  \u003cnitf\u003e\n    \u003chead\u003e\u003ctitle\u003eHello\u003c/title\u003e\u003c/head\u003e\n    \u003cbody\u003e\u003cbody.content\u003eWorld\u003c/body.content\u003e\u003c/body\u003e\n  \u003c/nitf\u003e\n)\n```\n\nThis is an example of how to create an NITF tree:\n```scala\nimport com.gu.nitf.model.builders._\n\nval doc = new NitfBuilder()\n  .withHead(new HeadBuilder().withTitle(\"News Article\"))\n  .withBody(new BodyBuilder()\n    .withContent(new BodyContentBuilder()\n      .withParagraph(new ParagraphBuilder().withText(\"That's it, really!\"))\n  ))\n  .build\n\nval xml = scalaxb.toXML(doc, None, None, BareNitfNamespace)\n```\n\n## Specifications\n\nNITF schema, documentation, and examples are available from IPTC.\n[This archive](http://www.iptc.org/std/NITF/NITF.zip) contains all of this for versions 2.5 to 3.6.\n\nThe schemas used to generate the classes in this project are available in the [schema](schema) folder.\n\n## Generated Sources\n\nThe source files were generated using an\n[unreleased version of ScalaXB](https://github.com/hosamaly/scalaxb/archive/451e9c59a3ed347c75e0d1d3924ee1be0e1939c6.zip)\nthat was built from source. Hopefully, it will be released in the main repository soon.\n\nThe following command was used to generate the files:\n```bash\nfor v in 3.{3..6}; do\n  scalaxb \"src/test/resources/nitf-$v.xsd\" \\\n    --outdir \"src/main/$v\" \\\n    --no-dispatch-client \\\n    --named-attributes \\\n    --capitalize-words \\\n    --symbol-encoding-strategy=discard \\\n    --default-package com.gu.nitf.model \\\n    --protocol-package com.gu.nitf.scalaxb\ndone\n```\n\n## Building\n\nTo build this project from source, run:\n```bash\nsbt clean +compile +test\n```\nNote that a clean build may take up to 10 minutes.\nYou may also need to increase the memory available to sbt (e.g. using `-mem`).  \n(The full compilation has more than 24k class files!)\n\nThe project is set up to build against Scala 2.11 and Scala 2.12.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguardian%2Fnitf-scala","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguardian%2Fnitf-scala","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguardian%2Fnitf-scala/lists"}