Skip to main content

openbis-parser-example

Example parser for openBIS using the bam-masterdata parser interface.

This repository can be used as a template for creating new parsers that can be used with the openbis-upload-helper.

1. Create a new parser repository

You can either fork this repository or use it as a template.

Click Use this template and choose Create a new repository:

use-this-template

Choose:

  • the organization or profile where the repository will be created;
  • a repository name;
  • a short description;
  • the desired visibility.

At BAM, parsers are typically hosted under the BAMresearch organization.

create-new-template

2. Define your parser

Clone your new repository:

git clone https://github.com/BAMresearch/<repository-name>.git

Note: The examples below use this repository's current package name, openbis_parser_example. Replace it with your own repository name where needed.

The repository has the following structure:

openbis-parser-example
├── LICENSE
├── pyproject.toml
├── README.md
├── src
│   ├── openbis_parser_example
│       ├── __init__.py
│       ├── parser.py
│       └── _version.py
└── tests
    ├── __init__.py
    ├── conftest.py
    └── test_parser.py

To create your parser:

  1. Define your parser class in src/<package-name>/parser.py. The class must inherit from the bam-masterdata parser interface, AbstractParser.
  2. Expose the parser in src/<package-name>/__init__.py:
from .parser import MyParser

my_parser_entry_point = {
    "name": "My Parser",
    "description": "Description of the parser.",
    "parser_class": MyParser,
}
  1. Register the parser in pyproject.toml:
[project.entry-points."bam.parsers"]
my_parser = "<package-name>:my_parser_entry_point"
  1. Update the remaining package-specific values in pyproject.toml, such as the project name, package paths, URLs, and setuptools-scm configuration.

3. Implement and test the parser

Implement the parsing logic in:

src/<package-name>/parser.py

Add or update tests in:

tests/test_parser.py

The parser should transform the source files into bam-masterdata objects that can later be written to openBIS.

4. Use the parser with openbis-upload-helper

Once the parser is developed, tested, and released as a Python package, it can be included as a dependency of the openbis-upload-helper.

openbis-upload-helper automatically discovers installed parsers registered under the bam.parsers entry-point group.

If the parser should be included in the distributed application, contact the openbis-upload-helper maintainers and provide the parser repository and released package version.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openbis_parser_example-1.0.0.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openbis_parser_example-1.0.0-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file openbis_parser_example-1.0.0.tar.gz.

File metadata

  • Download URL: openbis_parser_example-1.0.0.tar.gz
  • Upload date:
  • Size: 18.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for openbis_parser_example-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b544d361b60df75257da7b1a71e1b63cd143535091025d3ebeaec59e8f4d895c
MD5 4227b3dd60e3da3613dcc9118d0a39f2
BLAKE2b-256 a47eb4e4f4f849c9130b79c547684656a785126f68d0f1015d556eb01e385a5a

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbis_parser_example-1.0.0.tar.gz:

Publisher: publish.yml on BAMresearch/openbis-parser-example

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openbis_parser_example-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for openbis_parser_example-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0f17647e82de931c4558ce63f22b53fdab07375408397438de284e1e03231edc
MD5 1bc4aadb8aa63f3fef9507c40df8fdb6
BLAKE2b-256 de96e7b8652e1db28b06c4becbc74cea07da9362b579adb22be20799b68e9bbf

See more details on using hashes here.

Provenance

The following attestation bundles were made for openbis_parser_example-1.0.0-py3-none-any.whl:

Publisher: publish.yml on BAMresearch/openbis-parser-example

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 files

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