Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

inxs – XML transformations without boilerplate.

inxs is inexcessive.

inxs is not XSLT.

inxs is ISC-licensed.

inxs is fully documented here: https://inxs.readthedocs.io.

At a glimpse

Wikipedia XSLT example #1:

inxs

XSLT

def extract_person(element):
    return element.attrib['username'], element.find('name').text

def append_person(previous_result, target):
    element = etree.SubElement(target, 'name', {'username': previous_result[0]})
    element.text = previous_result[1]
    return element

transformation = Transformation(
    Rule(('person',), (extract_person, append_person)),
    config=Config(result_object='context.target',
                  context={'target': etree.Element('root')}))
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:output method="xml" indent="yes"/>

   <xsl:template match="/persons">
     <root>
       <xsl:apply-templates select="person"/>
     </root>
   </xsl:template>

   <xsl:template match="person">
     <name username="{@username}">
       <xsl:value-of select="name" />
     </name>
   </xsl:template>

</xsl:stylesheet>

Wikipedia XSLT example #2:

inxs

XSLT

e = ElementMaker(namespace='http://www.w3.org/1999/xhtml',
                 nsmap={None: 'http://www.w3.org/1999/xhtml'})

def generate_skeleton(context, e):
    context.html = e.html(
        e.head(e.title('Testing XML Example')),
        e.body(e.h1('Persons'), e.ul()))
    context.persons_list = context.html.xpath('./body/ul', smart_prefix=True)[0]

def extract_person(element, persons):
    persons.append((element.find('name').text, element.find('family-name').text))

def list_persons(previous_result, persons_list, e):
    persons_list.extend(e.li(f'{x[1]}, {x[0]}') for x in previous_result)

transformation = Transformation(
    generate_skeleton,
    Rule(('person',), extract_person),
    sorter('persons', itemgetter(1)),
    list_persons,
    config=Config(result_object='context.html', e=e, context={'persons': []}))
 <xsl:stylesheet version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns="http://www.w3.org/1999/xhtml">

   <xsl:output method="xml" indent="yes" encoding="UTF-8"/>

   <xsl:template match="/persons">
    <html>
      <head> <title>Testing XML Example</title> </head>
      <body>
        <h1>Persons</h1>
        <ul>
          <xsl:apply-templates select="person">
            <xsl:sort select="family-name" />
          </xsl:apply-templates>
        </ul>
      </body>
    </html>
   </xsl:template>

   <xsl:template match="person">
    <li>
      <xsl:value-of select="family-name"/> (…) <xsl:value-of select="name"/>
    </li>
   </xsl:template>

</xsl:stylesheet>

Here you can find the source repository and issue tracker of inxs.

Roadmap

0.1b0

  • enough documentation to get someone started

  • take it to the cheeseshop

0.1

  • reasonable test coverage

  • some usages in the wild / feedback thereof

History

0.1a (unreleased)

  • First release on PyPI.

Metadata

Release files for inxs 0.1a0

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

Source distribution (sdist)

Source distribution for inxs 0.1a0
File Size Uploaded Provenance Actions
inxs-0.1a0.tar.gz 19.5 kB Without provenance Details for inxs-0.1a0.tar.gz

Release files / inxs-0.1a0.tar.gz

Download URL inxs-0.1a0.tar.gz
Size 19.5 kB
Tags Source
SHA-256 checksum
How to use checksums
2d79bb0c26443fd714cd4cd0097fa366ddde10ae999ed55e67b7ab4dd80200c6
BLAKE2b-256 checksum
How to use checksums
44a8e58a790efa3ff37c8a7f52ef97d6c8d1cbeecb231a7e8ec305964bdd7dd0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for inxs 0.1a0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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