Skip to content

Commit

Permalink
Dedicated CFDP package cfdpy v0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
robamu committed Jan 24, 2024
0 parents commit 4b09b4e
Show file tree
Hide file tree
Showing 55 changed files with 8,525 additions and 0 deletions.
132 changes: 132 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# PyCharm
.idea
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
10 changes: 10 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
====
API
====

.. toctree::
:maxdepth: 2
:caption: Contents:

api/cfdp
api/cfdp.handler
34 changes: 34 additions & 0 deletions docs/api/cfdp.handler.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
CFDP Handler Package
=============================

Package Contents
-----------------

.. automodule:: cfdpy.handler
:members:
:undoc-members:
:show-inheritance:

Source Handler Module
-------------------------------------

.. automodule:: cfdpy.handler.source
:members:
:undoc-members:
:show-inheritance:

Destination Handler Module
-------------------------------------

.. automodule:: cfdpy.handler.dest
:members:
:undoc-members:
:show-inheritance:

Defintions Module
-------------------------------------

.. automodule:: cfdpy.handler.defs
:members:
:undoc-members:
:show-inheritance:
59 changes: 59 additions & 0 deletions docs/api/cfdp.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
CFDP Package
=============

Module contents
---------------

.. automodule:: cfdpy
:members:
:undoc-members:
:show-inheritance:

Filestore Module
-------------------------------

.. automodule:: cfdpy.filestore
:members:
:undoc-members:
:show-inheritance:


Management Information Base (MIB) Module
-------------------------------------------

.. automodule:: cfdpy.mib
:members:
:undoc-members:
:show-inheritance:

Request Module
-------------------------------

.. automodule:: cfdpy.request
:members:
:undoc-members:
:show-inheritance:

User Module
-------------------------------

.. automodule:: cfdpy.user
:members:
:undoc-members:
:show-inheritance:

Exceptions Module
-------------------------------------------

.. automodule:: cfdpy.exceptions
:members:
:undoc-members:
:show-inheritance:

Definitions Module
--------------------------

.. automodule:: cfdpy.defs
:members:
:undoc-members:
:show-inheritance:
77 changes: 77 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))


# -- Project information -----------------------------------------------------
from importlib.metadata import version

project = "cfdpy"
copyright = "2024, Robin Mueller"
author = "Robin Mueller"

# The full version, including alpha/beta/rc tags
release = version = version("cfdpy")


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.doctest",
"sphinx_rtd_theme",
]

# Disable the doctests of the full package because those would require the explicit specification
# of imports. The doctests inside the source code are covered by pytest, using the --doctest-modules
# configuration option.
doctest_test_doctest_blocks = ""

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = "en"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

# Mapping for external packages
intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"crcmod": ("https://crcmod.sourceforge.net/", None),
}

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]
18 changes: 18 additions & 0 deletions docs/examples.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
=====================
Example applications
=====================

You can find an example application inside the
`example directory <https://github.com/robamu-org/tmtccmd/tree/main/examples/cfdp-simple>`_
which shows an end-to-end file transfer on a host computer. This should give you a general idea of
how the source and destination handler work in practice.

There is also a
`test application <https://github.com/robamu-org/tmtccmd/tree/main/examples/cfdp-libre-cube-crosstest>`_
which cross-tests the `tmtccmd` CFDP implementation with the
`Libre Cube CFDP <https://gitlab.com/librecube/lib/python-cfdp>`_ implementation.

Finally, you can see a more complex example also featuring more features of the CFDP state machines
`here <https://github.com/robamu-org/tmtccmd/tree/main/examples/cfdp-cli-udp>`_. This example
uses UDP servers for communication and explicitely separates the local and remote entity
application.
33 changes: 33 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.. cfdpy documentation master file, created by
sphinx-quickstart on Tue Jan 23 21:37:44 2024.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
.. _cfdp:

==============================================================
cfdpy - A library for the CCSDS File Delivery Protocol (CFDP)
==============================================================

The ``cfdpy`` package offers some high-level CCSDS File Delivery Protocol (CFDP) components to
perform file transfers according to the `CCSDS Blue Book 727.0-B-5`_. The underlying base packet
library used to generate the packets to be sent is the `spacepackets`_ library.

.. _`CCSDS Blue Book 727.0-B-5`: https://public.ccsds.org/Pubs/727x0b5.pdf
.. _`spacepackets`: https://github.com/us-irs/spacepackets-py

.. toctree::
:maxdepth: 2
:caption: Contents:

introduction
examples
api


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
Loading

0 comments on commit 4b09b4e

Please sign in to comment.