https://github.com/pylhc/sdds
Python 3 package to handle SDDS files
https://github.com/pylhc/sdds
python read-write sdds sdds-format
Last synced: about 2 months ago
JSON representation
Python 3 package to handle SDDS files
- Host: GitHub
- URL: https://github.com/pylhc/sdds
- Owner: pylhc
- License: mit
- Created: 2019-02-19T11:33:15.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-07-25T10:35:35.000Z (4 months ago)
- Last Synced: 2025-08-01T16:37:51.538Z (4 months ago)
- Topics: python, read-write, sdds, sdds-format
- Language: Python
- Homepage: https://pylhc.github.io/sdds/
- Size: 6.99 MB
- Stars: 9
- Watchers: 19
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Zenodo: .zenodo.json
Awesome Lists containing this project
README
# SDDS
[](https://github.com/pylhc/sdds/actions?query=workflow%3A%22Cron+Testing%22)
[](https://codeclimate.com/github/pylhc/sdds)
[](https://codeclimate.com/github/pylhc/sdds)
[](https://pypi.org/project/sdds/)
[](https://github.com/pylhc/sdds/)
[](https://anaconda.org/conda-forge/sdds)
[](https://doi.org/10.5281/zenodo.5705820)
This package provides reading and writing functionality for [**self describing data sets (sdds)**](https://ops.aps.anl.gov/SDDSIntroTalk/slides.html) files.
On the python side, the data is stored in a class structure with attributes corresponding to the sdds-format itself (see [sdds-format](https://ops.aps.anl.gov/manuals/SDDStoolkit/SDDStoolkitsu2.html)).
See the [API documentation](https://pylhc.github.io/sdds/) for details.
## Installing
Installation is easily done via `pip`:
```bash
python -m pip install sdds
```
One can also install in a `conda` environment via the `conda-forge` channel with:
```bash
conda install -c conda-forge sdds
```
## Example Usage
```python
import sdds
sdds_data = sdds.read("path_to_input.sdds")
sdds.write(sdds_data, "path_to_output.sdds")
```
### Read files with different endianness
By default the endianness (byte order) of the file is determined either by
a comment `!# little-endian` or `!# big-endian` in the header of the file.
If this comment is not found, the endianness of the running machine is assumed.
One can force a certain kind of endianness to the reader by supplying it to
the read function:
```python
import sdds
sdds_data = sdds.read("path_to_input_with_big_endian.sdds", endianness="big")
sdds_data = sdds.read("path_to_input_with_little_endian.sdds", endianness="little")
```
Be aware that `sdds.write` will always write the file in big-endian order and
will also leave a comment in the file, so that the reader can determine the
endianness and there is no need to supply it when reading
a file written by this package.
## Known Issues
- Can't read binary columns
- No support for `&include` tag
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.