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:
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.
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:
- Define your parser class in
src/<package-name>/parser.py. The class must inherit from thebam-masterdataparser interface,AbstractParser. - 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,
}
- Register the parser in
pyproject.toml:
[project.entry-points."bam.parsers"]
my_parser = "<package-name>:my_parser_entry_point"
- Update the remaining package-specific values in
pyproject.toml, such as the project name, package paths, URLs, andsetuptools-scmconfiguration.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b544d361b60df75257da7b1a71e1b63cd143535091025d3ebeaec59e8f4d895c
|
|
| MD5 |
4227b3dd60e3da3613dcc9118d0a39f2
|
|
| BLAKE2b-256 |
a47eb4e4f4f849c9130b79c547684656a785126f68d0f1015d556eb01e385a5a
|
Provenance
The following attestation bundles were made for openbis_parser_example-1.0.0.tar.gz:
Publisher:
publish.yml on BAMresearch/openbis-parser-example
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openbis_parser_example-1.0.0.tar.gz -
Subject digest:
b544d361b60df75257da7b1a71e1b63cd143535091025d3ebeaec59e8f4d895c - Sigstore transparency entry: 2793146096
- Sigstore integration time:
-
Permalink:
BAMresearch/openbis-parser-example@e6b5f1240d62af8fd33d88bca330f70202b5e7af -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/BAMresearch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e6b5f1240d62af8fd33d88bca330f70202b5e7af -
Trigger Event:
release
-
Statement type:
File details
Details for the file openbis_parser_example-1.0.0-py3-none-any.whl.
File metadata
- Download URL: openbis_parser_example-1.0.0-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f17647e82de931c4558ce63f22b53fdab07375408397438de284e1e03231edc
|
|
| MD5 |
1bc4aadb8aa63f3fef9507c40df8fdb6
|
|
| BLAKE2b-256 |
de96e7b8652e1db28b06c4becbc74cea07da9362b579adb22be20799b68e9bbf
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openbis_parser_example-1.0.0-py3-none-any.whl -
Subject digest:
0f17647e82de931c4558ce63f22b53fdab07375408397438de284e1e03231edc - Sigstore transparency entry: 2793146135
- Sigstore integration time:
-
Permalink:
BAMresearch/openbis-parser-example@e6b5f1240d62af8fd33d88bca330f70202b5e7af -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/BAMresearch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e6b5f1240d62af8fd33d88bca330f70202b5e7af -
Trigger Event:
release
-
Statement type: